| 15 | // It is then processed by `transformElement` and included in the generated |
| 16 | // props. |
| 17 | export const transformStyle: NodeTransform = node => { |
| 18 | if (node.type === NodeTypes.ELEMENT) { |
| 19 | node.props.forEach((p, i) => { |
| 20 | if (p.type === NodeTypes.ATTRIBUTE && p.name === 'style' && p.value) { |
| 21 | // replace p with an expression node |
| 22 | node.props[i] = { |
| 23 | type: NodeTypes.DIRECTIVE, |
| 24 | name: `bind`, |
| 25 | arg: createSimpleExpression(`style`, true, p.loc), |
| 26 | exp: parseInlineCSS(p.value.content, p.loc), |
| 27 | modifiers: [], |
| 28 | loc: p.loc, |
| 29 | } |
| 30 | } |
| 31 | }) |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | const parseInlineCSS = ( |
| 36 | cssText: string, |
nothing calls this directly
no test coverage detected