Skip to content

Add cop to ensure Tailwind is used properly

Paul Gascou-Vaillancourt requested to merge tailwind-cop into master

What does this MR do and why?

This new cop enforces fully qualified util names so as to not confuse Tailwind's parser. In the future, we'll add more checks to this cop, like disallowing desktop-first responsive utils, arbitrary values, etc.

Examples of invalid code

bgColor = "gl-bg-#{palette}-#{variant}"
cssClasses = "gl-#{display} gl-border"
width = "gl-w-1/#{denominator}"

Examples of valid code

bgColor = "gl-bg-red-800"
cssClasses = "gl-flex gl-border"
width = "gl-w-1/2"

Closes #73 (closed)

Edited by Paul Gascou-Vaillancourt

Merge request reports

Loading