1.0.1 • Published 3 years ago

css-map-variable v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

css-map-variable

  import CssTheme from 'css-map-variable'
  const map = new Map([
    ['color', 'red']
  ])
  const cssTheme = new CssTheme(
    map, document.styleSheets[0], true, '--'
  )//map, styleSheets[0], Whether to add a prefix or not, prefix
  
  setTimeout(()=> {
    map.set('color', 'blue')
  }, 1000)

index.css

:root {
  --color: white;
}

It will re-create your first style tag or [linkcss] first rule