Using CSS3 variables (custom properties) it is possible to override the highlight color in 1 line of CSS.
In milligram.css have something along the lines of:
:root {
--highlight-color: #9b4dca;
}
and then replace every #9b4dca
with var(--highlight-color)
.
Once this is done, replacing the highlight color is as easy as including a custom.css file with
:root {
--highlight-color: #abcabc;
}
I came here for the same thing ^^ but since it is written in SASS and you might want to support old browsers I would recommend doing a more fallback proven example like this:
button {
background-color: $color-primary;
background-color: var(--color-primary, $color-primary);
}
This way browsers who don't support CSS custom properties will still fallback to a working version. Also this way no :root {}
in the actual stylesheets is needed since var()
already provides a fallback option.
Cheers,
Dominik
Is their any progress or anything done on this so far? 😄
Is their any progress or anything done on this so far? 😄
you can always change the values of the colors from the src/_Color.sass
and then recompile again with sass --update
. You can also add your own sass files.
Is their any progress or anything done on this so far? 😄
you can always change the values of the colors from the
src/_Color.sass
and then recompile again withsass --update
. You can also add your own sass files.
Good point! I guess I'm looking for a bit more out-of-the-box solution since I don't use Sass, but I don't really know how that could be easily done other than changing the values themselves in /dist/milligram.min.css
which would be problematic.
Love this framework! Can't wait for this feature to be released 🚀
Hey @mterron @dkundel @timrossback @dntzbgh @cilim
Maybe something like this?
https://github.com/milligram/milligram/pull/262/files#diff-7b0a61514569d183adbda861549f9d98
Most helpful comment
I came here for the same thing ^^ but since it is written in SASS and you might want to support old browsers I would recommend doing a more fallback proven example like this:
This way browsers who don't support CSS custom properties will still fallback to a working version. Also this way no
:root {}
in the actual stylesheets is needed sincevar()
already provides a fallback option.Cheers,
Dominik