Build a style provider to load different style setting dynamically.
The only package dependency: @emotion/react
(11.10.0)
https://tzynwang.github.io/react-home-made-style-provider/
- styles: in this demo we have 2 style settings
coffee
andgarden
src/styles/coffee/index.ts
src/styles/garden/index.ts
- models:
src/models/style/index.tsx
: where the style context is created
- components:
src/components/Common/StyleToggle/index.tsx
: to toggle style option betweencoffee
andgarden
src/components/Layer/StyleProvider/index.tsx
: to apply style object base on the style name toggles byStyleToggle