|
It is generally good to have canonical classes warning and quick fixes. However, I found it is more straightforward to use Thanks in advance! |
Replies: 4 comments 1 reply
|
What's a situation where you prefer the arbitrary value notation? We recently made a change where large numbers that don't make sense stay as-is. For example I wonder if your situation is one that we could also make an exception for. |
|
At the moment, I don't believe the extension supports disabling canonical class warnings on a per-line, per-block, or per-file basis. The warning is designed to encourage the use of Tailwind's canonical utility classes (for example, However, I think there are cases where arbitrary values like
For now, the only available option may be to disable the warning globally in the extension settings, if that's supported. |
|
@RobinMalfait Thank you so much for the quick response! My use case is a draggable divider used for resizing. I'm not sure if that's the optimal way to style it, but here I set the width to be <div class="flex h-screen w-screen">
<div class="flex-1"></div>
<div class="-mx-[5px] w-[11px] flex-none cursor-col-resize border-x-[5px] border-transparent bg-zinc-300 bg-clip-padding transition-all duration-200 hover:border-blue-500/50 hover:bg-blue-500"></div>
<div class="flex-1"></div>
</div>I found using the |
|
@RobinMalfait I have an unusual situation where I use JSX to simulate a video, and I dynamically adjust the root font-size so that content scales with the viewport; however, video controls lying over the content do not get this treatment. (It is roughly like setting |
At the moment, I don't believe the extension supports disabling canonical class warnings on a per-line, per-block, or per-file basis.
The warning is designed to encourage the use of Tailwind's canonical utility classes (for example,
w-4instead ofw-[16px]) and is typically configured at the project level rather than the code level.However, I think there are cases where arbitrary values like
w-[123px]are the most practical solution, especially when:For now, the only available option may be to disable the warning global…