Known Behavior
File processing scope
Section titled “File processing scope”- The transformer only runs on files matching:
.tsx,.jsx,.vue,.svelte,.html. - It runs in Vite
enforce: 'pre'mode.
Two-pass transform model
Section titled “Two-pass transform model”- Pass 1 sanitizes:
- Variant prefixes like
hover:...into__hover__.... - Arbitrary-value bracket utilities like
w-[50.5px]intow-50_5px.
- Variant prefixes like
- Pass 2 scans opening tags and:
- Extracts inline style declarations.
- Converts safe declarations into generated utility classes.
- Merges generated classes with existing
class/className.
Variant behavior
Section titled “Variant behavior”- Supported pseudo-class variants mapped to single-colon selectors:
hover,focus,focus-within,focus-visible,active,first-child,last-child,only-child.
- Supported pseudo-elements mapped to double-colon selectors:
before,after,selection.
- Supported parameterized variant:
nth-child-*→:nth-child(*).
- Any other variant is treated as a custom class-based state selector.
- Warning is emitted when
selection:is used with utilities outside text/background color intent.
Inline style extraction behavior
Section titled “Inline style extraction behavior”- Recognized forms include:
- JSX:
style={{ ... }} - Vue:
:style="{ ... }"and:style={{ ... }} - HTML/Svelte/Vue static string:
style="..." - State form:
style:hover={{ ... }} - Svelte directives:
style:prop="value"andstyle:prop='value'(static strings only)
- JSX:
- Existing class attributes are removed and rebuilt as one merged class attribute.
Dynamic style preservation
Section titled “Dynamic style preservation”- Static style entries are extracted into generated classes.
- Dynamic entries are kept in residual inline style when entry appears to use:
- ternary
? : - logical
&& - logical
||
- ternary
Encoding/decoding behavior for style values
Section titled “Encoding/decoding behavior for style values”- Values are sanitized when class names are generated:
- quotes removed
#→hex-.→_- spaces →
--space-- (→--lp--)→--rp--,→--cm--
- Preset decode reverses those transformations except quote removal (irreversible).
Preset utility behavior
Section titled “Preset utility behavior”- Generated classes follow:
gf-prop--<css-property>--<encoded-value>
- Additional handled utilities include:
- width/height/min/max with numeric unit patterns (
px|em|rem|%|vh|vw) bg-hex-<hex>andtext-hex-<hex>
- width/height/min/max with numeric unit patterns (
- Shortcuts:
heading-<n>→ text size + bold + leadingparagraph-<n>→ text size + normal weight + conditional leading
Warning behavior
Section titled “Warning behavior”- Warnings are printed unless
suppressWarningsis enabled. - Warnings include timestamp and plugin label.
- Warnings are triggered for:
- unsupported CSS properties
- unsupported values for specific properties
- shorthand CSS properties using CSS variables (e.g.
border: var(--x))
Important limitations
Section titled “Important limitations”- The scanner only handles opening tags and rewrites attributes there.
style:prop={expr}(dynamic Svelte style directive expression) is not extracted.- String parsing for style extraction is regex-based; edge cases with complex nested syntax can remain in residual style.
© 2026 Coherent Labs. All rights reserved.