Socket
Socket
Sign inDemoInstall

style-mod

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

style-mod - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc