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 HSL as default for color

See original GitHub issue

Prerequisites

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:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mdocommented, Apr 6, 2022

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 😃.

0reactions
Eseperiocommented, May 23, 2022

No. It is a private project. You must try at your own risk.

Read more comments on GitHub >

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

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