Minimize Work needed for Theme Changes/Additions #345
Labels
area:frontend
Related to Nebula's Frontend Electron app
focus:layout
things involving UI layout changes (for frontend)
priority:low
Issues that are low priority don't need to be solved right away
type:enhancement
New feature or request
type:tech-debt
Issues related to adjusting underlying implementation details without affecting the end product
Is your feature request related to a problem? Please describe.
With #344 about to merge, we have theme support and some automation with regards to adding new themes. This is focused on sass specifically and is great! However, we still have css-in-js classes that are applied to the
react-select
components separately from sass.The current implementation will require manual changes to be made when adjusting or adding themes.
Describe the solution you'd like
Ideally we should have a separate file that contains all theme related style data and have both the
sass
classes andcss-in-js
styles pull from that single source of truth. This would minimize the work needed to adjust/add themes as well as keep both style injections in sync with each other.There will be two things we need to take care of:
sass
andjs
can pull fromselect.jsx
file to lookup data rather than have it hardcodedFor
#1
I think we can use a.json
format to handle the theme data. This can be imported automatically in js and we can use a library to get it imported intosass
(something like this library would work).For
#2
I think we can simply look up the data from the.json
file based on the giventheme
that is passed in.Describe alternatives you've considered
There are other libraries that allow you to extract structured variables from a sass file, but I'm not sure which direction is more efficient.
Additional context
Originally from https://github.com/walmat/nebula/pull/344#discussion_r258280697
The text was updated successfully, but these errors were encountered: