🔰variables

a.k.a css custom properties

🔸 Valid NamesCheatsheetKey Points

:root {
    /* ⭐️ define css vars */
    --panel-bg: #fff;
    --panel-color: #000;
}

.panel {
    /* ⭐️ use css vars */
    color: var(--panel-color);
    background-color: var(--panel-bg);
}

Valid Names

⭐️ valid CSS variable names ( begin with two dashes "--" ❗️):

Cheatcheet

key points

  • The custom properties behave as a sort of scoped variable because the values are inherited by descendant elements.

redefine css vars

Last updated

Was this helpful?