vanilla-cssjs

Size 300b

Usage no npm install needed!

<script type="module">
  import vanillaCssjs from 'https://cdn.skypack.dev/vanilla-cssjs';
</script>

README

vanilla-cssjs

Size 300b

Install

$ npm install --save vanilla-cssjs

Use BEM css

import css from 'vanilla-cssjs';

const box = document.getElementById('box');

// .__bod´╝ÜStart at underline is Random BEM name
// .text: It is global css

const bem = css`
  .text {
    color: #555;
  }
  ._box {
    background: #f00;
  }
`('project-bem');

console.log(bem`box`); // out .project-bem-box

box.classList.add('text', bem`box`);

// append <style>...css</style> in document.head
bem.init();

VSCode Plugin

you can install es6-string-css:

https://marketplace.visualstudio.com/items?itemName=bashmish.es6-string-css