Use Tailwind utilities instead of direct CSS for static visual styling.
Do not add static visual styling with direct CSS when Tailwind can express the same result. This applies whether the CSS is written in a style="" attribute, a <style> block, a CSS file, an imported stylesheet, or a custom class whose only purpose is static visual styling such as spacing, width, height, color, typography, borders, shadows, text decoration, or layout.
Report these findings as direct CSS styling and recommend replacing the CSS with Tailwind utilities. Do not turn the finding into a color-token recommendation.
Direct CSS is allowed when the value is genuinely dynamic at runtime, browser-specific, generated by a third-party integration, required by a vendor, defines reusable project infrastructure that Tailwind cannot express safely, or cannot be represented with Tailwind utilities. Examples include Alpine-bound progress widths, CSS variables populated from runtime data, vendor-required attributes, third-party widget styles, or chart/library container sizing that cannot be moved to Tailwind utilities.
Specifically, these are not findings:
- A style whose value is an expression, such as
:style / x-bind:style bound to Alpine, or a style attribute interpolated by Blade.
style="display: none" paired with x-show or x-cloak, which hides the element until Alpine boots and takes over the display. That is behaviour, not static styling.
- Properties Tailwind has no utility for, such as
font-variation-settings on a variable icon font.
- Mail templates, where inline CSS is required, and templates published under
resources/views/vendor/, which carry the styling their own package ships.
A fixed container size is a finding, because Tailwind expresses it directly: style="height: 24rem" is h-96.
When direct CSS is necessary, keep it as narrow as possible and do not mix unrelated static styling into it.