-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add a Theme Color select #276
Add a Theme Color select #276
Conversation
... instead of picking an arbitrary color and a light or dark theme to go with it This changeset adds a new ThemeColorBlock option, which is basically a <select> where the value is a CSS class string comprising a theme class (mzp-l-dark|light) and also one of 10 color classes, drawn from the protocol color palette. This new ThemeColorBlock is used in the HeroBlock and the ColumnBlock, to replace the two places we used a ColorBlock + a ThemeBlock. It's a breaking change, but it's one that we can fixup after deployment with likely no one noticing. This work is not complete, though. Outstanding points to fix: 1) The hero text area used to have a drop shadow on it which was based on the color from the ColorBlock, which is now not at all available to the CSS. This means we can remove the inline CSS (yay) but we'll need a new approach to make the drop-shadow work. 2) The colors themselves selected for the mozorg and firefox themes are just proofs of concept and could do with some tuning. The only two that MUST remain (or have very similar ones) for consistency on future.m.o are color-purple-10 and color-green-20
… we can dynamically change them, based on the theme in use. This because light-01 in Mozorg might be Color X, but in Firefox theme it's Y. This work gives us stable keys to replace with human-readable names instead, in the next commmit
…ck select... with approriate human-friendly labels that fit the active theme for the site.
a12837d
to
46f1226
Compare
@craigcook I've done some tweaks to this branch to dynamically update the labels for the (You'll need to run migrations/ |
This seems to work well. Human-readable names for the humans, machine-readable names for the machines. |
... instead of picking an arbitrary color and a light or dark theme to go with it
This changeset adds a new ThemeColorBlock option, which is basically a
<select>
where the value is a CSS class string comprising a theme class (mzp-l-dark|light
) and also one of 10 color classes, drawn from the protocol color palette.This new ThemeColorBlock is used in the HeroBlock and the ColumnBlock, to replace the two places we used a ColorBlock + a ThemeBlock. It's a breaking change, but it's one that we can fixup after deployment with likely no one noticing.
This work is not complete, though. Handing over to @craigcook
Outstanding points to fix
The hero text area used to have a drop shadow on it which was based on the color from the ColorBlock, which is now not at all available to the CSS. This means we can remove the inline CSS (yay) but we'll need a new approach to make the drop-shadow work.
The colors themselves selected for the mozorg and firefox themes are just proofs of concept and could do with some tuning. The only two that MUST remain (or have very similar ones) for consistency on future.m.o are color-purple-10 and color-green-20
Issue
Resolves #212
Testing
@craigcook I have a dump of a local DB here if you want it.