-
Notifications
You must be signed in to change notification settings - Fork 4
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Duplicate Sass variables as CSS variables #38
Comments
Original issue thread: https://github.iu.edu/UITS/rivet-source/issues/246 |
Here's another solution to integrating token-izing design system variables into CSS. Use the Why you should use CSS env(), April 5, 2019 |
Was thinking about the breakpoints that are defined in Rivet. It would be nice if there was some way to customize breakpoints. The breakpoints in the Rivet Header is not as tight as I'd like it, when there isn't much content in it. We can't use CSS variables in media queries, but we will eventually be able to have custom Change the width of the viewport, to see the "header" change size and color. There are three breakpoints. And one of them is overwritten by the "implementation" of the library. Read CSS comments for more. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Currently, all style variables are declared as Sass variables.
https://github.iu.edu/UITS/rivet-source/blob/develop/src/sass/core/_variables.scss
This works well for Rivet itself. It works fine if you're importing Rivet into a project that also uses Sass. But if you're using Less or no preprocessor or don't want to compile Rivet, there's no way to take advantage of these definitions. Instead, offer the variables also as CSS variables. There's good browser support for any browser over the last 1.5 years. If projects are still supporting IE, they won't be able to use CSS variables, but for everyone else, this would be a big advantage. It would minimally really help prototyping. And for those not wanting to use it, it is ignored.
Relevant articles:
To maintain backwards compatibility, Rivet should still use Sass variables internally. Just dually offer CSS variables. Given these would be global variables, it would be best to prefix them with
rvt-
. For example, this is how you could extend_variables.scss
:The text was updated successfully, but these errors were encountered: