fluid-tailwind icon indicating copy to clipboard operation
fluid-tailwind copied to clipboard

Is there a way to circumvent the Fails WCAG SC 1.4.4 error?

Open kobe-f8 opened this issue 1 year ago • 5 comments

I get this error on my latest project where i'm working with a lot of large font size that have to be reduced to a much smaller font size on mobile. Like this case for example: ~text-sm/4xl.

But that gives me this error:

/* not fluid from 0.875rem at 40rem to 2.25rem at 80rem: Fails WCAG SC 1.4.4 at i.e. 200rem */

I'm I doing something wrong or could this be a bug?

kobe-f8 avatar Apr 25 '24 12:04 kobe-f8

Hey, thanks for filing. The warning is there because that text wouldn't enlarge to 2x its size if someone tried to 5x zoom the page at a screen width of i.e. 100rem, which would create the accessibility violation.

That being said, it'd probably be good to be able to opt out of these warnings. I'll think about this and keep this open for now!

barvian avatar Apr 25 '24 13:04 barvian

Thank you for looking into it and for the quick response 🙌🏻

kobe-f8 avatar Apr 25 '24 13:04 kobe-f8

That being said, it'd probably be good to be able to opt out of these warnings.

This would be useful in some scenarios.

peterpalkovic avatar Apr 27 '24 07:04 peterpalkovic

@kobe-f8 @peterpalkovic I'm thinking of adding an option you could pass to the plugin that would warn about these issues on the console but still output the fluid code. Would that work for your use cases or were you hoping for a different approach?

barvian avatar May 01 '24 15:05 barvian

Sounds good to me!

kobe-f8 avatar May 02 '24 07:05 kobe-f8

@barvian any update on this? This would be really good for some design cases.

krstivoja avatar May 07 '24 14:05 krstivoja

@krstivoja Working on this feature for v0.2.0! Here's a preview of the docs

barvian avatar May 08 '24 11:05 barvian

This feature is now live in v0.2.0 (see #15)! Feel free to comment in the discussion or open another issue if you find a bug. Thanks for the feedback 🙂

barvian avatar May 08 '24 19:05 barvian