MCPcopy
hub / github.com/cssinjs/jss / FontFaceRule

Class FontFaceRule

packages/jss/src/plugins/fontFaceRule.js:4–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import getWhitespaceSymbols from '../utils/getWhitespaceSymbols'
3
4export class FontFaceRule {
5 type = 'font-face'
6
7 at = '@font-face'
8
9 isProcessed = false
10
11 constructor(key, style, options) {
12 this.key = key
13 this.style = style
14 this.options = options
15 }
16
17 /**
18 * Generates a CSS string.
19 */
20 toString(options) {
21 const {linebreak} = getWhitespaceSymbols(options)
22 if (Array.isArray(this.style)) {
23 let str = ''
24 for (let index = 0; index < this.style.length; index++) {
25 str += toCss(this.at, this.style[index])
26 if (this.style[index + 1]) str += linebreak
27 }
28 return str
29 }
30
31 return toCss(this.at, this.style, options)
32 }
33}
34
35const keyRegExp = /@font-face/
36

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…