Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sicherheitslücken (CVE)5 ways AI is reshaping the cybersecurity job market(21.09.2026 um 10:25 Uhr)
IT Security NachrichtenRevoking the token didn’t kill the backdoor(21.09.2026 um 11:00 Uhr)
Malware / Trojaner / VirenChainScript-RAT per Polygon: ClickFix-Kampagnen drehen C2-Infrastruktur(21.09.2026 um 10:55 Uhr)
IT Security NachrichtenEnterprise Mobile KI: So lassen sich Shadow-AI-Risiken kontrollieren(21.09.2026 um 12:00 Uhr)
Malware / Trojaner / VirenChainScript-RAT setzt auf Polygon-Blockchain für C2-Rotation(21.09.2026 um 12:19 Uhr)
Sicherheitslücken (CVE)5 ways AI is reshaping the cybersecurity job market(21.09.2026 um 10:25 Uhr)
IT Security NachrichtenRevoking the token didn’t kill the backdoor(21.09.2026 um 11:00 Uhr)
Malware / Trojaner / VirenChainScript-RAT per Polygon: ClickFix-Kampagnen drehen C2-Infrastruktur(21.09.2026 um 10:55 Uhr)
IT Security NachrichtenEnterprise Mobile KI: So lassen sich Shadow-AI-Risiken kontrollieren(21.09.2026 um 12:00 Uhr)
Malware / Trojaner / VirenChainScript-RAT setzt auf Polygon-Blockchain für C2-Rotation(21.09.2026 um 12:19 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

"--variables " in CSS 🤯 THE COMPLETE GUIDE ⚡

Hi, guys it's me MINCE again. If you don't follow me I am Mince a UI designer for the web. From the intro you might get it that I love CSS. Yeah, it's true. Today, we will talking about variables in CSS. The Basics For storing…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Hi, guys it's me MINCE again. If you don't follow me I am Mince a UI designer for the web. From the intro you might get it that I love CSS. Yeah, it's true. Today, we will talking about variables in CSS.






The Basics



For storing values in CSS and reusing them you can create variables. Once changed they change where ever you declared them. Just like javascript, css, python or any other programming language.




Fun fact: variables is one of the most common thing in every programming language. But, their syntax is different in every language




The syntax for variables in css is a bit complicated. But it will come handy. So, why not ? You declare all the variables in the *::root * selector. Like this:




::root{

variables here...

}






Then to declare a variable's name you enter the name with two "--" ( dashes ) in front of the name. Something like this.




::root{

--name: ;

}






Now inside this "--name" you can store any css code like colours, certain animation, width, height, margin and everything. Here's an example for you





::root{

--background: black;
--box-anime: box-turn 2s infinite;
--height: 45vw;

}







Now, does it make sense. But how do you use them. Well that's simple, just enter the name of the variable in the var() function. Like this:




element{
background: var(--bg);
}






That's all






But, why variables



Variables in css let you change data dynamically suppose you have a colour let's say orange. When you click a button orange should change into black. Well for this you select every element in js and then change the background colour of every element individually. This will take a ton of time. With, CSS variable you take the "--color" variable and change it. Well, that's more simple. It can also simplify your process if you have dark and light mode shifting in your application. It's useful to make responsive website simply when used along with media queries. So, give it a try



Comment, if you have any doubts.






Thanks for reading 😉..



Links 🔗:



W3schools article

My website

Daily.dev

Codepen

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten "--variables " in CSS 🤯 THE COMPLETE GUIDE ⚡

Thematisch verwandte Begriffe: variables, COMPLETE, GUIDE · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94036 | A security flaw has been discovered in D-Link DIR-X1860 and DIR-X1860Z u…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick