Hashed CSS variables & dependency on SASS
See original GitHub issueDescription
Cloudscape currently uses SASS .scss
files to build and output CSS files that contain CSS variables. These CSS variables contain random hash strings appended to the end of the name. For example, SASS var $color-red
outputs to CSS as--color-red-f921aa
).
CSS variables are currently widely supported by all major browser vendors (excluding IE11, which has reached EOL and is not officially supported by Cloudscape). Therefore, SASS is no longer needed to provide developers with variable support for their CSS files. Therefore:
- Can we remove the SASS dependency to provide developers with direct, native usage of modern CSS variables?
- This implicitly removes the auto-generated, randomized 6-digit hex hashes appended to the generated CSS
The randomization of the CSS variable names provides difficulty to developers who wish to use CSS variables natively. Here’s an example of the generated CSS variables:
Code of Conduct
- I agree to follow this project’s Code of Conduct
- I checked the current issues for duplicate requests
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to use global variables in CSS-Modules? - Stack Overflow
One way could be to use dependencies. For example, // variables.css .primaryColor { color: #f1f1f1 } // heading.css .heading { composes: primaryColor from...
Read more >how to use sass files · Issue #136 · PatrickJS/MFE-starter
The sass-loader transformes your scss files into valid css code, ... I'm wondering if i can use sass variables in an agular 2...
Read more >sass-loader - webpack - JS.ORG
Loads a Sass/SCSS file and compiles it to CSS. Getting Started. To begin, you'll need to install sass-loader : npm install sass- ...
Read more >How to use Sass and CSS Modules with create-react-app
Let's create another Sass file and name it variables.scss under ./src directory. Open this newly created Sass file and copy the following $ ......
Read more >How to dynamically update SCSS variables using ReactJS?
Basic knowledge of npm & create-react-app command. Basic knowledge of HTML/CSS. Basic Knowledge of react components & ES6.
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
Hello Chris, We currently don’t allow the SASS dependency to be removed neither the randomising of hashes. We’ve done this in order to guarantee backward compatibility. To accept this as a feature request, we need to gather feedback about possible use cases to help us better understand and prioritise it.
@AnthumChris if I understand correctly the whole idea behind the hash in variables names is to restrict usage of variables that are not “officially” exposed.
Which is questionable approach. Maybe owners can share why exactly it was done like that?