CSS variable
know everything about CSS variable
π§΅π§΅ππ
01. Intro of a CSS variable
It is a custom property of a CSS that is defined by a CSS author that contains some specific values that are reusable through a document.
it is used in the google chrome browser
see exampleππ
02. Syntax or how to use
ππ
:root{
--color-primary: #001f3f;
}
p {
color: var(--color-primary);
}
03. use case of a CSS variable
1. colors
2. font sizes
3. SVG
4. Grid layouts
5. column proportions
6. Buttons
04. Tipπ‘π‘
always defined variable in root section because it gives you global reach through your entire Html document
you can define it in the Html section also so it can be
treated as a global variable.
05. conclusion
So many good uses, and weβre barely getting started Use the comments to ask follow-up questions or share your ideas for using CSS custom properties (variables).
Thank you for reading the full thread. If you like this thread
Hit β₯οΈ
retweetπ
comment π
follow me ππ
share this full thread for more reach
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.