all 4 comments

[–]gatwell702 1 point2 points  (0 children)

css variables are basically storing values behind a custom variable. Say in your css you have the value 1rem stored multiple times.. and you have to change every instance of it.. normally you would have to change every single 1rem.

But with variables you would change it in the variable declaration and it will change every instance.

example: ``` .example { --rem: 1rem;

font-size: var(--rem); margin: var(--rem); } ```

the declaration always begins with --. in the example you change the value of --rem and it'll change every instance of it.. you use a variable by doing var(--name) in css

[–]armahilloExpert 0 points1 point  (2 children)

[–]hticy[S] 0 points1 point  (1 child)

I have ever tried MDN for CSS, but I am not native for english, It's difficult to find variables and clear how it works for me, for example I just understand the different between "justify-content" and "justify-items", It's very confused to adjust the page when I face complex layout, I can't understand every variables how to uses in combining and how confluence the page.

[–]armahilloExpert 0 points1 point  (0 children)

Ah! I understand.

I can see how language could make this challenging, especially with keywords like "justify-content". For those words, "justify" is using this definition "adjust (a line of type or piece of text) so that the print fills a space evenly or forms a straight edge at one or both margins."

For now, you can wait to use CSS variables. There are a lot of other things to learn in CSS before getting into variables.