home.social

#css5 — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #css5, aggregated by home.social.

  1. It's time to put to rest #hex and #rgb() / #rgba() colours in #CSS and embrace the future: #oklch() and #oklab()

    * oklch() model: caniuse.com/?search=oklch%28%2
    * oklab(): caniuse.com/?search=oklab%28%2

    I'm not sure why we still need to add/support lch() and lab() since the ‘okay’ version is the ‘fixed’ version… which is better. Then again, I'm not a #colour expert, hence I can't think of a reason. (Can someone enlighten us, mortals? Thank you!)

    Since oklch(), oklab(), lch(), and lab() are still not widely supported (yet), and many end-users are still using an old version of browsers without support, there is #hwb().

    As you can see from caniuse.com/?search=hwb%28%29 hwb() is widely supported already. The only browsers still without hwb() support are niche browsers, mainly from China (they don't even support rgb() according to #CanIUse).

    * Base #color model: hwb()
    * To be future proof: oklch() or oklab()

    What I'm more excited about is the #RelativeColor feature from #CSSColor5, but that's for another day.

    #CSSColor4 #CSS5 #CSS #colors #color #webdev #webmaster