| 2 | import getWhitespaceSymbols from '../utils/getWhitespaceSymbols' |
| 3 | |
| 4 | export 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 | |
| 35 | const keyRegExp = /@font-face/ |
| 36 |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…