-
Notifications
You must be signed in to change notification settings - Fork 0
Styling
Brandon Jordan edited this page Sep 11, 2024
·
5 revisions
Spark provides a function that will turn an object of CSS rules, where the key is the selector and the value is an object containing properties with values, into a CSS string.
obj2CSS({"input":{"color":"green"}}); // Result: input{color:green;}
This function allows for the application of CSS properties to an HTMLElement
reference.
applyStyle(element, {
paddingTop: '5px'
});
Spark provides a Store
called MediaStore
that models its value based on if the provided CSS media query matches.
const darkMode = new MediaStore('(prefers-color-scheme: dark)');