-
-
Notifications
You must be signed in to change notification settings - Fork 243
[code-infra] Fix prettier formatting of tailwind classes #2911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
commit: |
Add the source tailwind v4 stylesheet and preserve whitespaces
25ce07f
to
258b778
Compare
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Bundle size report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks legit, to @mui/base-ui to approve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a plugin that formats long strings over multiple lines?
Toast.Root
for example is unreadable
I couldn't find any that does this. Author's recommendation is to just turn on line wrap in editor or just not use this plugin. |
@brijeshb42 it's still unreadable with line wrapping unfortunately Tailwind's API falls apart with moderately complex CSS if there is no line wrapping 😬 I think @michaldudak suggested we migrate to multiple lines in the demos It seems like AI might be good at converting to a semantic multi-line structure too, with comments to help out (if using Here's its suggestion for className="
absolute right-0 bottom-0 left-auto origin-bottom z-[calc(1000-var(--toast-index))]
w-full h-[var(--height)] mr-0 p-4
rounded-lg border border-gray-200 bg-gray-50 bg-clip-padding shadow-lg select-none
[--gap:0.75rem]
[--peek:0.75rem]
[--height:var(--toast-frontmost-height,var(--toast-height))]
[--scale:calc(max(0,1-(var(--toast-index)*0.1)))]
[--shrink:calc(1-var(--scale))]
[--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))]
[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))]
[transition:transform_0.5s_cubic-bezier(0.22,1,0.36,1),opacity_0.5s,height_0.15s]
after:absolute after:top-full after:left-0
after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']
data-[limited]:opacity-0
data-[ending-style]:opacity-0
data-[expanded]:h-[var(--toast-height)]
data-[starting-style]:[transform:translateY(150%)]
data-[expanded]:[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--offset-y)))]
data-[ending-style]:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]
data-[expanded]:data-[ending-style]:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]
data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]
data-[expanded]:data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]
data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]
data-[expanded]:data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]
data-[ending-style]:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]
data-[expanded]:data-[ending-style]:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]
[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]
" Navigation Menu sort of does this: Lines 123 to 142 in d13abf4
|
Closing in favor of #2923 |
Add the source tailwind v4 stylesheet to the prettier plugin option.
Edit: removed the preserve whitespaces option (this doesn't preserve multiline classes).