Skip to content

Conversation

brijeshb42
Copy link
Contributor

@brijeshb42 brijeshb42 commented Oct 3, 2025

Add the source tailwind v4 stylesheet to the prettier plugin option.

Edit: removed the preserve whitespaces option (this doesn't preserve multiline classes).

@brijeshb42 brijeshb42 requested a review from a team October 3, 2025 07:53
@brijeshb42 brijeshb42 added the scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). label Oct 3, 2025
Copy link

pkg-pr-new bot commented Oct 3, 2025

vite-css-base-ui-example

pnpm add https://pkg.pr.new/mui/base-ui/@base-ui-components/react@2911
pnpm add https://pkg.pr.new/mui/base-ui/@base-ui-components/utils@2911

commit: 258b778

Add the source tailwind v4 stylesheet and preserve whitespaces
@brijeshb42 brijeshb42 force-pushed the fix-tailwind-config branch from 25ce07f to 258b778 Compare October 3, 2025 07:54
Copy link

netlify bot commented Oct 3, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 25ce07f
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/68df80e4bfbc4b00086802f3
😎 Deploy Preview https://deploy-preview-2911--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Oct 3, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 258b778
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/68df8147c144250008c372f5
😎 Deploy Preview https://deploy-preview-2911--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mui-bot
Copy link

mui-bot commented Oct 3, 2025

Bundle size report

Bundle Parsed size Gzip size
@base-ui-components/react 0B(0.00%) 0B(0.00%)

Details of bundle changes

Copy link
Member

@Janpot Janpot left a 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

Copy link
Contributor

@atomiks atomiks left a 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

@brijeshb42
Copy link
Contributor Author

brijeshb42 commented Oct 3, 2025

Is there a plugin that formats long strings over multiple lines?

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.

@atomiks
Copy link
Contributor

atomiks commented Oct 3, 2025

@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 cn instead of a plain string).

Here's its suggestion for Toast.Root:

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:

const triggerClassName =
'box-border flex items-center justify-center gap-1.5 h-10 ' +
'px-2 xs:px-3.5 m-0 rounded-md bg-gray-50 text-gray-900 font-medium ' +
'text-[0.925rem] xs:text-base leading-6 select-none no-underline ' +
'hover:bg-gray-100 active:bg-gray-100 data-[popup-open]:bg-gray-100 ' +
'focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-blue-800 focus-visible:relative';
const contentClassName =
'w-[calc(100vw_-_40px)] h-full p-6 xs:w-max xs:min-w-[400px] xs:w-max ' +
'transition-[opacity,transform,translate] duration-[var(--duration)] ease-[var(--easing)] ' +
'data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 ' +
'data-[starting-style]:data-[activation-direction=left]:translate-x-[-50%] ' +
'data-[starting-style]:data-[activation-direction=right]:translate-x-[50%] ' +
'data-[ending-style]:data-[activation-direction=left]:translate-x-[50%] ' +
'data-[ending-style]:data-[activation-direction=right]:translate-x-[-50%]';
const linkCardClassName =
'block rounded-md p-2 xs:p-3 no-underline text-inherit ' +
'hover:bg-gray-100 focus-visible:relative focus-visible:outline focus-visible:outline-2 ' +
'focus-visible:-outline-offset-1 focus-visible:outline-blue-800';

@brijeshb42
Copy link
Contributor Author

Closing in favor of #2923

@brijeshb42 brijeshb42 closed this Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants