Create Single CSS Block
You can create Single CSS Block with JavaScript Object with the code below.
yugal.css(css_object, property_holder);
css_object
You have to define CSS styling in form of JavaScript object, in place of kebab casing, use came casing in property name, and use strings in value, in case of using number
as property value, it will be converted automatically to string with px
in runtime.
Kebab Casing to Camel Casing example: For font-style
use fontStyle
Example
a = {
fontSize: 20,
color: "#000000",
textDecoration: "none"
}
property_holder
This defines for what element this css is for, for example if element is defined with class name abc
then ".abc"
will be valid input. Noticed .
in this string
? Yes this is same as CSS, .
for class
, #
for id
and if no special character at starting, then this is for all respected tags.
Last updated
Was this helpful?