programming.dev
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
codeinabox to CSSEnglish · 7 days ago

Interpolate contrast-color() to manipulate lightness

daverupert.com

external-link
message-square
0
link
fedilink
1
external-link

Interpolate contrast-color() to manipulate lightness

daverupert.com

codeinabox to CSSEnglish · 7 days ago
message-square
0
link
fedilink
In my first post on contrast-color() I demo’d using color-mix() to change a background-color on hover, but I will be honest… mixing black and white isn’t always what you want. It would be cool and helpful to coerce contrast-color() to return either 1 or -1 so that we could adjust lightness in a color function on hover instead of only mixing white and black.
alert-triangle
You must log in or # to comment.

CSS

css

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 9 users / day
  • 14 users / week
  • 51 users / month
  • 157 users / 6 months
  • 227 local subscribers
  • 680 subscribers
  • 157 Posts
  • 110 Comments
  • Modlog
  • mods:
  • Ategon
  • BE: 0.19.13
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org