Comparing version 3.1.0 to 3.2.0
{ | ||
"name": "style-mod", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "A minimal CSS module shim", | ||
@@ -5,0 +5,0 @@ "main": "dist/style-mod.cjs", |
@@ -54,2 +54,5 @@ <!-- To edit this file, edit /src/README.md, not /README.md --> | ||
* **`getRules`**`() → string`\ | ||
Returns a string containing the module's CSS rules. | ||
* `static `**`newName`**`() → string`\ | ||
@@ -56,0 +59,0 @@ Generate a new unique CSS class name. |
export class StyleModule { | ||
constructor(spec: {[selector: string]: StyleSpec}, | ||
options?: {process(sel: string): string, extend(template: string, sel: string): string}) | ||
getRules(): string | ||
static mount(root: Document | ShadowRoot | DocumentOrShadowRoot, module: StyleModule | ReadonlyArray<StyleModule>): void | ||
@@ -5,0 +6,0 @@ static newName(): string |
const C = "\u037c" | ||
const COUNT = typeof Symbol == "undefined" ? "__" + C : Symbol.for(C) | ||
const SET = typeof Symbol == "undefined" ? "__styleSet" + Math.floor(Math.random() * 1e8) : Symbol("styleSet") | ||
const top = typeof global == "undefined" ? window : global | ||
const top = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : {} | ||
@@ -56,2 +56,6 @@ // :: - Style modules encapsulate a set of CSS rules defined from | ||
// :: () → string | ||
// Returns a string containing the module's CSS rules. | ||
getRules() { return this.rules.join("\n") } | ||
// :: () → string | ||
// Generate a new unique CSS class name. | ||
@@ -127,3 +131,3 @@ static newName() { | ||
for (let i = 0; i < this.modules.length; i++) | ||
text += this.modules[i].rules.join("\n") + "\n" | ||
text += this.modules[i].getRules() + "\n" | ||
this.styleTag.textContent = text | ||
@@ -130,0 +134,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22542
371
102