create-stylesheet

Dynamically create a stylesheet

Usage no npm install needed!

<script type="module">
  import createStylesheet from 'https://cdn.skypack.dev/create-stylesheet';
</script>

README

create-stylesheet build status

Dynamically create a stylesheet

Example

import createStyleSheet from 'create-stylesheet';

let style = createStyleSheet({
  '.foo': {
    fontSize: 12,
    padding: 5
  },
  '.bar': {
    fontSize: 16,
    color: 'grey'
  }
});

document.head.appendChild(style);