Attribute to style
Duplicate HTML attributes to inline CSS.Usage
This Transformer is part of the CSS inlining process, you may enable it in yourconfig.js under the css.inline key:
config.js
Customization
You may enable it only for some attributes:config.js
config.js
Supported attributes
The following attributes can be duplicated as inline CSS.width
Inlined as:width: ${value}${unit}
Notes: supports only px and % values (defaults to px)
height
Inlined as:height: ${value}${unit}
Notes: supports only px and % values (defaults to px)
bgcolor
Inlined as:background-color: ${value}
background
Inlined as:background-image: url('${value}')
align
-
On
<table>elementsleftorrightvalues inlined asfloat: ${value}centervalue inlined asmargin-left: auto; margin-right: auto
-
On any other elements, it is inlined as
text-align: ${value}
valign
Inlined asvertical-align: ${value}
Overriding
This Transformer runs right before CSS inlining, so you can still override it through Tailwind CSS utility classes.API
The second argument must be an array of attribute names to handle:app.js