v5: shift-color() not working correctly with dark default link color?
See original GitHub issueIf I want a dark color as my default link color (e.g. #111111
), I would want its hover state to lighten the color instead of darkening it. It would appear that v5 accounts for this in its variables file, using the shift-color()
function.
$link-color: $primary !default;
$link-decoration: underline !default;
$link-shade-percentage: 20% !default;
$link-hover-color: shift-color($link-color, $link-shade-percentage) !default;
$link-hover-decoration: null !default;
According to shift-color()
’s comment , it should “Shade the color if the weight is positive, else tint it”. This sounds perfect and is exactly what I hope for. But if I pass a negative percentage like -20%
to $link-shade-percentage
in hopes of tinting it, I get a Sass compilation error: $weight: Expected -20% to be within 0% and 100%
.
This aligns with that Sass says, that mix()
only accepts 0% - 100% weight, but I don’t know. Am I doing this wrong? Thanks for your work getting v5 out!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:6 (3 by maintainers)
Top Results From Across the Web
SASS/SCSS: Bootstrap 5 Color functions not working well?
I'm using SASS and bootstrap the new version V5 as CSS Framework in some of my academic project in color ...
Read more >Discover how to override theme colors in Bootstrap 5 using Sass
1 Bootstrap Sass override variables by using the right import sequence ... //Bootstrap v5 $link-color: $primary !default;.
Read more >Sass · Bootstrap v5.0
These functions will mix colors with black or white, unlike Sass' native lighten() and darken() functions which will change the lightness by a...
Read more >Improved dark mode default styling with the color-scheme ...
Dark mode: Styles specified by the developer and the user agent. The text is white and the background is black as per the...
Read more >Dark Mode to Change Color Schemes and CSS Properties
Developers are adding dark mode CSS on native applications to support their user preferences. Read to learn more about dark color schemes for...
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
When I try to set
$link-shade-percentage: -20%;
in hopes of lightening my link hover color, node-sass gives me:Just figured I’d add my $0.02.
Indeed, the goal is the same but the approach diverges. The variable is not the bug, but there’s something to clarify and improve for sure.