Inwerpsel / use-theme-editor

A React theme editor
GNU General Public License v3.0
4 stars 0 forks source link

Allow saving and managing user created set of screen sizes #54

Open Inwerpsel opened 1 year ago

Inwerpsel commented 1 year ago

Currently, there are 2 hardcoded sets of screen sizes to pick from: 1 small (called "simple") and 1 more complete set.

A lot of the things needed to support user created screen sizes are already there, in terms of code structure, so this should be relatively straightforward. It can also take inspiration of other similar user managed sets of data (the UI arrangement, name replacements), though those are also in somewhat early state of development.

Intended functionality

Current code

https://github.com/Inwerpsel/use-theme-editor/blob/72df0ad273000d62f082f3041b01de6d5e2c2741/src/state/index.ts#L18-L21

https://github.com/Inwerpsel/use-theme-editor/blob/72df0ad273000d62f082f3041b01de6d5e2c2741/src/components/ui/ScreenSwitcher.jsx#L8-L18

The following component consumes the screenoptions, but won't need changes here. However the styles may need to be adapted to deal with arbitrary amounts of options. Currently the "all screen options" case often results in style issues.

https://github.com/Inwerpsel/use-theme-editor/blob/72df0ad273000d62f082f3041b01de6d5e2c2741/src/components/inspector/VariableScreenSwitcher.jsx#L31-L45