Skip to content

klicat/apply-style-json-defined

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

apply-style-json-defined

This function applies styles dynamically with auto merge

Call function with styles passed as a Json

You can pass all css properties

Example :

applyStyles({
  "myclass" : {
    "color" : "rgb(254, 254, 254)",
    "font-size": "12px"
},
  "myotherclass" : {
    "background-color" : "rgb(56, 60, 66)",
    "border-color" : "rgba(0, 0, 0, 0.51)"
 },
  "myotherclass:hover" : {
    "background-color" : "blue"
 },
  "myotherclass:active" : {
    "background-color" : "red"
 }
})

All tags with these classes (myclass & myotherclass) will be impacted.