obsidian-sample-plugin/node_modules/style-mod/src
naive231 5cb4dbfd1a Recompile 'main.ts'.
Add 'node_modules' to repo.
Remove essential, runtime environment files from ignoring list.
2024-11-21 18:49:58 +08:00
..
README.md Recompile 'main.ts'. 2024-11-21 18:49:58 +08:00
style-mod.d.ts Recompile 'main.ts'. 2024-11-21 18:49:58 +08:00
style-mod.js Recompile 'main.ts'. 2024-11-21 18:49:58 +08:00

README.md

style-mod

Minimal CSS module shim for generating CSS rules 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)

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

Documentation

@StyleModule

Where the Style type is defined as:

@Style