0.1.0 • Published 6 years ago

as-css-vars v0.1.0

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

as-css-vars

Coverage Status Build Status License: ISC

This is a micro-utility to convert a generic object into CSS variables, as string.

// --some-test:someValue;
asCSSVars({someTest: 'someValue'});

// --a:a;--b:b;
asCSSVars({a: 'a', b: 'b'})

// --component-a:a;--component-b:b;
asCSSVars('component', {a: 'a', b: 'b'});

CSS variables can be set all at once on a generic element, since these reflect the cascading property of CSS.

You could use a tiny utility like this to create updates, as shown in this CodePen.

0.1.0

6 years ago

0.0.0

6 years ago