Wie verwendet man CSS Variablen (CSS & HTML & Javascript - Anleitung / Tutorial]

https://video.maechler.cloud/w/c8AkMdkXY7EDz9nop8N9Q4

Wie verwendet man CSS Variablen (CSS & HTML & Javascript - Anleitung / Tutorial]

PeerTube

#CSS gotcha: if you set a list of gradient stops on an element:
.a { --l: var(--c0), var(--c1) }

... and expect to be able to get *a different gradient* if you just modify --c0 & --c1 on its .b children... I have bad news.๐Ÿ˜พ

You need to set:
.a, .b { --l: var(--c0), var(--c1) }

Live demo on @codepen
https://codepen.io/thebabydino/pen/rNEpbJK?editors=1100

Particularly annoying when that gradient is used on tens of various children. ๐Ÿ˜ฟ

#cssVariable #gotcha #cssGotcha #code #coding #fronten #web #webDev #dev #webDevelopment

CSS variables gotcha

...

#tinyCSStip What if you need to set `color` to the inverted value of a CSS variable? You can't invert the whole element because the rest of it shouldn't be inverted. And you can't use the Sass `invert()` on a CSS var.

Here's how! ๐Ÿ‘‡

(see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_colors/Relative_colors for more details)

#css #cssVariable #code #coding #rgb #frontend #web #webDev #webDevelopment #dev

Using relative colors - CSS | MDN

The CSS colors module defines relative color syntax, which allows a CSS <color> value to be defined relative to another color. This is a powerful feature that enables easy creation of complements to existing colors โ€” such as lighter, darker, saturated, semi-transparent, or inverted variants โ€” enabling more effective color palette creation.

MDN Web Docs

1โƒฃ1โƒฃ Pure CSS 1 div animated ๐ŸŒˆ โˆž logo
https://codepen.io/thebabydino/pen/zRZKxK

Also has a video of me live coding it.

#CodePen #geometry #maths #CSS #noJS #transform #code #coding #web #webDev #dev #frontend #webDevelopment #cssGradient #cssVariable

Pure CSS 1 div animated ๐ŸŒˆ โˆž logo with Houdini magic ๐ŸŽฉ๐Ÿ‡โœจ

[Watch me](https://www.youtube.com/watch?v=NmKlaFf2PVw) animate [yesterday's Pen](https://codepen.io/thebabydino/pen/LQbovN) in 4 minutes . --- If th...

#Development #Techniques
Add superpowers to your CSS variables ยท โ€œWeโ€™re on the verge of yet another CSS revolution.โ€ https://ilo.im/15y7gy

_____
#Browser #ProgressiveEnhancement #WebDev #Frontend #CSS #MediaQuery #StyleQuery #CustomProperty #CssVariable

Add Superpowers to Your CSS Variables with Style Queries

Weโ€™re on the verge of yet another CSS revolution. Say hello to themes!

That HTML Blog

#Development #Techniques
CSS-based state management ยท The power and versatility of CSS custom properties https://ilo.im/15xiam

_____
#WebDev #Frontend #CSS #JavaScript #CustomProperty #CssVariable #StyleQuery

CSS-based state management

Use CSS for storing context-like JavaScript state.