question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use css variables for editor markup

See original GitHub issue

Given 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:

  1. Replace all uses of darken() and lighten() functions and replace them with SCSS variable in _gjs_variables.scss.
  2. 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:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
isarphilippcommented, Apr 22, 2020

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

0reactions
artfcommented, Apr 22, 2020

After a year, I wonder if your opinion on this matter changed?

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found