( node: MinimalBlendMixin, isJsx: boolean, )
| 9 | * node.opacity is between [0, 1]; output will be [0, 100] |
| 10 | */ |
| 11 | export const htmlOpacity = ( |
| 12 | node: MinimalBlendMixin, |
| 13 | isJsx: boolean, |
| 14 | ): string => { |
| 15 | // [when testing] node.opacity can be undefined |
| 16 | if (node.opacity !== undefined && node.opacity !== 1) { |
| 17 | // formatWithJSX is not called here because opacity unit doesn't end in px. |
| 18 | if (isJsx) { |
| 19 | return `opacity: ${numberToFixedString(node.opacity)}`; |
| 20 | } else { |
| 21 | return `opacity: ${numberToFixedString(node.opacity)}`; |
| 22 | } |
| 23 | } |
| 24 | return ""; |
| 25 | }; |
| 26 | |
| 27 | export const htmlBlendMode = ( |
| 28 | node: MinimalBlendMixin, |
no test coverage detected