[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/css/ - CSS Masters

Advanced styling, animations & modern CSS techniques
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1795478962760.jpg (190.72 KB, 1200x860, img_1795478924278_620x8ezp.jpg)ImgOps Exif Google Yandex

edac9 No.2529

i've been seeing so many design systems still relying on sass color functions for everything like lightness or saturation and it honestly feels like we're fighting ignoring how much better native css color-mix is getting. when you use sass to pre-calculate these values, the colors are baked into the static css file so you lose that ability to let the user change a theme or tweak a brightness slider in real time via javascript. it makes the dev experience feel so much more rigid when we could just be passing variables around and letting the browser handle the heavy lifting of blending. i really think we should be moving toward using native functions for anything that isn't a hardcoded brand color to keep things flexible.
--brand-primary: #3498db;--brand-light: color-mix(in srgb, var(--brand-primary), white 20%);

does anyone actually find the sass math more predictable for complex component states?

edac9 No.2545

>>2529
>the colors are baked into the static css file so you lose that ability to let the user change a theme

I've been using oklch() for this exact reason lately because it's way easier to tweak lightness without messing up the hue. It works great for those dynamic sliders, but I still stick to sass for my heavy brand palettes where I need pixel-perfect consistency across old browsers that don't handle color-mix well yet.

edac9 No.2549

File: 1795768065812.jpg (119.68 KB, 1000x960, img_1795768050761_tmtw41zc.jpg)ImgOps Exif Google Yandex

>>2529
>>2545 oklch is fine but you still cant rely on sass for pixel-perfect consistency if your users are on browsers that dont support it anyway.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]