Skip to content

Latest commit

 

History

History
executable file
·
28 lines (21 loc) · 529 Bytes

vars-object.md

File metadata and controls

executable file
·
28 lines (21 loc) · 529 Bytes

Polyclass .vars() function

Polyclass supports an object of key values, applied to the CSS as --var properties. The exposed keys can be accessed with the class key var-* for any CSS key:

cg.vars({
    "very-red": "#88000"
})

Producing the constructed CSS:

:root {
    --very-red: #88000;
}

Applied to the HTML through the property assignment *-var-very-red. Here we apply color:

<div class="color-var-very-red">
    <p>Very red text color</p>
</div>