Use css variables for editor markup
See original GitHub issueGiven that all modern browsers (https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties#Browser_compatibility) support CSS variables, the added value of using SCSS for them is limited.
I do not propose fully removing SCSS, what I do propose is the following:
- Replace all uses of
darken()
andlighten()
functions and replace them with SCSS variable in_gjs_variables.scss
. - For all sass variables used in
_gjs_variables.scss
replace it with css variable:
// This
$primaryColor: #444 !default;
// Becomes
:root {
--gjs-primary-color: #444;
}
$primaryColor: var(--gjs-primary-color);
This is a simple change that should not result in a BC break. After doing this theming the editor will become even simpler since we can just specify the variables directly in CSS and we’re done; no recompilation needed.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Live Theming with CSS Variables | Jonathan Harrell
The process is fairly simple — setup initial variable values in CSS, markup some inputs, add event listeners and set the values in...
Read more >Using CSS custom properties (variables) - MDN Web Docs
Custom properties (sometimes referred to as CSS variables or cascading variables) are entities defined by CSS authors that contain specific ...
Read more >CSS Variables: What They Are and How They Work
CSS variables let us create our own custom values so our code is easier to understand and edit. Let's unpack how to use...
Read more >How to set up site theming with CSS variables | Creative Bloq
CSS Custom Properties, commonly known as CSS variables, are now supported by all major modern browsers. This means that for projects that ...
Read more >Customizing Docs Using CSS Variables
Our CSS vars are targeted on the :root selector and load in after yours, so use the body selector to ensure your variables...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @artf After a year, I wonder if your opinion on this matter changed? We’d love to use it and IE11 becomes less and less of a thing 😉 @SamMousa if you need help with the PR, we can contribute as well. Looking forward to hearing back from you! Philipp
Unfortunately, it doesn’t depend only on my decision, from what I know, they’re still a good percentage of users relying on IE11 compatibility. So, the only solution would be creating a good SCSS file import usage (avoid writing the same styles declaration twice) and generate a new CSS file with custom properties.
For now, I’ll close the issue as the traction for this is very low, but a PR would still be welcome