Use HSL as default for color
See original GitHub issuePrerequisites
- I have searched for duplicate or closed feature requests
- I have read the contributing guidelines
Proposal
HSL is the acronym of Hue, Saturation and Lightness, which means that without the need of scss we can easily darken or adjust hue to any color. See the example below:
darken($primary,10%)
can be replaced with:
background-color: hsl(var(--bs-primary-h), var(--bs-primary-s), calc(var(--bs-primary-l) - 10%))
See this codepen
This will allow the full color customization via css variables, which now is not possible. I.e; buttons require darken
method and everytime you want to create a new theme, must compile scss.
The same happens to adjust-hue
, which can be replaced with HSL and a calc()
in the hue variable.
Motivation and context
This change will allow live preview of the color changes within the browser.
Will improve theme development as not compilation is need.
Will allow a better implementation with future css4 features, like color
mixins
, etc…
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
hsl() - CSS: Cascading Style Sheets - MDN Web Docs - Mozilla
The hsl() functional notation expresses an sRGB color according to its hue, saturation, and lightness components.
Read more >Using HSL colors in CSS - LogRocket Blog
By default, hue is measured in degrees: Red: 0 degrees and 360 degrees; Yellow: 60 degrees; Green: 120 degrees; Cyan: 120 degrees; Blue:...
Read more >Colors HSL - W3Schools
HSL color values are supported in IE9+, Firefox, Chrome, Safari, and in Opera 10+. HSL stands for hue, saturation, and lightness. HSL color...
Read more >How to use HSL and calc functions in ... - DEV Community
Perfect, first step complete, we have the default red color. Using calc function for darken and light. Now that you've been decouple the...
Read more >Change default display of color values to HSL? - Share an idea
Hex values can be useful for developers (although lately we've just been using HSL in our CSS), but is not very useful to...
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
This is something we could evaluate for v6, but no sooner. Labelling accordingly and closing out for now. No promises one way or another either 😃.
No. It is a private project. You must try at your own risk.