-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DDW-376] Cleanup SimpleTheme Config in Daedalus #1139
Conversation
…operties in ABC order.
@MarcusHurney can you please add more info in the PR description? Thanks 🙏 |
…ore/ddw-376-cleanup-simple-theme [DDW-376] Pulls in latest develop branch
…ore/ddw-376-cleanup-simple-theme [DDW-376] Pulls in latests develop branch
@nikolaglumac |
@MarcusHurney can you please merge in latest |
@MarcusHurney i updated to latest |
@MarcusHurney @DominikGuzei the changes look good but I have failing tests - it's actually the same problem as with #1156 |
@MarcusHurney @DominikGuzei I just got the same issues on develop branch. It could be related to my local setup :-/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work guys!
To upgrade to the latest version of `react-polymorph` (v8) we need to do two upgrades: - [x] upgrade to v7.2 (based on [this PR](input-output-hk/daedalus#950)) - [x] upgrade to v8 (based on [this PR](input-output-hk/daedalus#1139)) I made both upgrades as the two commits to this PR and it's probably easier to read if you code review the two commits individually (since the changes are orthogonal). I also have a README change that explains what `react-polymorph` v8 does but you can find something similar in the Daedalus PR I linked above. v8 also introduces large refactoring changes that makes a mess of the whole thing. I tried my best to make all the UI look the same while keeping the improvements from v8 but one thing I couldn't stop is that the font size is not 1px bigger across the app (which honestly is not a big deal so I didn't bother). There are probably small things that changed here in there but I manually compared the whole UI and everything looked close enough I don't think anybody would notice any difference that did occur.
This PR refactors the theme configuration of Daedalus so that the css variables used in
react-polymorph
components are distinguishable from other css variables used in Daedalus internally.react-polymorph
css vars are organized into individual objects per component.Prefixes the
react-polymorph
css vars with--rp
and renames them to follow a uniform naming convention that describes their use from broad to specific.--rp-formfield-label-text-color
and--rp-formfield-label-text-color-disabled
.This convention follows
--rp- prefix
+component
+element
+property
+state
.Removes the existing configuration of
SimpleTheme
in Daedalus which importsSimpleTheme
from thereact-polymorph
module and overrides its scss variables manually.Creates new
react-polymorph
css vars in addition to the existing set. The new ones allow nearly all of the existing css properties within each component to be themed using a configuration object / template. This reduces existing single instance css variables in Daedalus which target properties onreact-polymorph
elements that are not currently exposed for customization. Such asfont-size
,border
,height
, andwidth
.Creates
source/renderer/app/themes/overrides
directory for styles that targetreact-polymorph
components but aren't configurable through--rp
css vars. These overrides are passed toThemeProvider
'sthemeOverrides
prop for composition with the base theme.Review Checklist:
Basics
yarn run test
)yarn run dev
)yarn run package
/ CI builds)yarn run flow:test
)yarn run lint
)yarn run manage:translations
produces no changes)yarn run storybook
)yarn.lock
file is updatedCode Quality
Testing
After Review:
done
on the Youtrack board