1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00
Oinktube/node_modules/style-mod/src
2023-08-12 10:32:47 -03:00
..
README.md Do not ignore node_modules 2022-06-30 12:23:35 -03:00
style-mod.d.ts Do not ignore node_modules 2022-06-30 12:23:35 -03:00
style-mod.js npm update 2023-08-12 10:32:47 -03:00

style-mod

Minimal CSS module shim for generating CSS rules and anonymous class names for sets of style declarations and attaching such a set to a document or shadow root.

Using it would look something like this:

const {StyleModule} = require("style-mod")
const myModule = new StyleModule({
  main: {
    fontFamily: "Georgia, 'Nimbus Roman No9 L'",
    margin: "0"
  },
  callout: {
    color: "red",
    fontWeight: "bold",
    "&:hover": {color: "orange"}
  }
})
StyleModule.mount(document, myModule)
document.body.className = myModule.main

This code is open source, released under an MIT license.

Documentation

@StyleModule

Where the Style type is defined as:

@Style