Add --farmos-map-accent-color CSS property #186
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #181
The basic issue here is that we define the
color: green
style in two places. Platforms integrating farmOS-map need to override this CSS in two (in the future, maybe more) places in order to achieve consistent colors.This introduces the concept of an "accent" color to farmOS-map as a custom CSS property
--farmos-map-accent-color
at the:root
pseudo-class. I got this idea from Drupal Gin which uses these custom properties quite extensively. The custom CSS property is like a variable that all internal farmOS-map styles should reference. Outside of farmOS-map this variable can be overwritten, ideally at the map wrapper class instead of the global:root
since custom CSS properties do inherit.eg following this, for farmOS core we would need to make this change:
More of the spec is here: https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties