localgovdrupal / localgov_microsites

A repository for the LocalGov Drupal Microsites project.
GNU General Public License v2.0
4 stars 2 forks source link

Site design UI: update fields to reflect the default colours used in the base theme #131

Open msayoung opened 2 years ago

msayoung commented 2 years ago

Case 1

In the Global Styles tab the primary colour could either be set to the defaults we've set in the base theme

  --color-accent: #682558;
  --color-accent-2: var(--color-white);
  --color-text-light: var(--color-white);
  --color-text-dark: var(--color-black);
  --color-text: var(--color-text-dark);

or we could put the current value as placeholder.

Image

Case 2

Once we've set the primary colour this affects the colour elsewhere (for example the header) until they are overridden. Can we indicate on the override field what things are currently set as?

Perhaps as dynamic help text ?

msayoung commented 2 years ago

Be worth having your thoughts on this @markconroy

markconroy commented 2 years ago

I've been thinking about this. And I'm coming to the conclusion that I do not think this is possible/desired.

When we set a colour, we then inline some CSS to set a CSS variable with that value. This inline CSS will take precedence in the cascade order, meaning that if someone adds something like this to a CSS file --colour-heading-2: red it will not be read, since our inline CSS will will the specificity war. This is fine when someone explicitly sets a value, but if they haven't set a value (initial state) we don't want to be forcing our values on top of them. What this would mean is that someone could not ignore our settings page and just use a CSS file instead.

willguv commented 2 years ago

What's your view on @markconroy's comment @msayoung? Cheers

markconroy commented 2 years ago

Here's a related issue to remove the current default options that we have: https://github.com/localgovdrupal/localgov_microsites_group/issues/235