Skip to content
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

Easily change highlight color (#9b4dca) #191

Open
mterron opened this issue Feb 22, 2018 · 9 comments
Open

Easily change highlight color (#9b4dca) #191

mterron opened this issue Feb 22, 2018 · 9 comments

Comments

@mterron
Copy link

mterron commented Feb 22, 2018

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;
}
@dkundel
Copy link

dkundel commented Mar 23, 2018

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

@ghost
Copy link

ghost commented Jun 29, 2019

Is their any progress or anything done on this so far? 😄

@danbaghilovici
Copy link

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.

@ghost
Copy link

ghost commented Jun 30, 2019

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.

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.

@cilim
Copy link

cilim commented Aug 26, 2020

Love this framework! Can't wait for this feature to be released 🚀

@cjpatoilo
Copy link
Member

Hey @mterron @dkundel @timrossback @dntzbgh @cilim

Maybe something like this?
https://github.com/milligram/milligram/pull/262/files#diff-7b0a61514569d183adbda861549f9d98

@Kkotiswar
Copy link

is this issue resolved or given to anybody ? I want to contribute to this...

@Zaid-Parkar
Copy link

Hello Sir,
I would like to contribute to this project,
I am new to hacktoctoberfest and this would be a great beginning.
Thank you...

@Anshikaa-agarwal
Copy link

Hello sir! I am interested in resolving this issue. May you please assign this issue to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants