MCPcopy Create free account
hub / github.com/cssinjs/jss / constructor

Method constructor

packages/jss/src/plugins/keyframesRule.js:23–45  ·  view source on GitHub ↗
(key, frames, options)

Source from the content-addressed store, hash-verified

21 isProcessed = false
22
23 constructor(key, frames, options) {
24 const nameMatch = key.match(nameRegExp)
25 if (nameMatch && nameMatch[1]) {
26 this.name = nameMatch[1]
27 } else {
28 this.name = 'noname'
29 warning(false, `[JSS] Bad keyframes name ${key}`)
30 }
31 this.key = `${this.type}-${this.name}`
32 this.options = options
33 const {scoped, sheet, generateId} = options
34 this.id = scoped === false ? this.name : escape(generateId(this, sheet))
35 this.rules = new RuleList({...options, parent: this})
36
37 for (const name in frames) {
38 this.rules.add(name, frames[name], {
39 ...options,
40 parent: this
41 })
42 }
43
44 this.rules.process()
45 }
46
47 /**
48 * Generates a CSS string.

Callers

nothing calls this directly

Calls 3

processMethod · 0.80
generateIdFunction · 0.50
addMethod · 0.45

Tested by

no test coverage detected