Skip to content

Conversation

@hbendev
Copy link
Contributor

@hbendev hbendev commented Jun 23, 2024

This PR adds the items-first-baseline and items-last-baseline utility classes that can control baseline-position for the align-items property.

Browser support:

The feature were requested multiple times:

A special plugin in tailwind.config.js can be used as an existing workaround:

plugin(function extendItemsBaselineUtilities({ addUtilities }) {
  // https://developer.mozilla.org/en-US/docs/Web/CSS/align-items#start
  // https://developer.mozilla.org/en-US/docs/Web/CSS/align-items#end
  addUtilities({
    ".items-first-baseline": { "align-items": "first baseline" },
    ".items-last-baseline": { "align-items": "last baseline" },
  });
});

V3 counterpart PR: #13887

@philipp-spiess philipp-spiess force-pushed the items-baseline-position-v4 branch from 5b3098e to d7e8acd Compare March 17, 2025 12:27
@philipp-spiess philipp-spiess changed the title Add items-first-baseline and items-last-baseline utilities - v4 Add items-baseline-last utility Mar 17, 2025
@philipp-spiess philipp-spiess force-pushed the items-baseline-position-v4 branch from d7e8acd to 2aff552 Compare March 17, 2025 12:30
Copy link
Member

@philipp-spiess philipp-spiess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Thanks for your contribution. We want to land this in Tailwind CSS v4.1 so I've gone ahead and updated the PR and put it behind a feature flag for now. 👍

I did make some changes to call it items-baseline-last and removed the start-equivalent since it's the default for items-baseline anyways. I added last as a suffix for consistency with our plans with the safe-alignment APIs but note that we might change the name before the actual release.

@philipp-spiess philipp-spiess merged commit 1d2d50e into tailwindlabs:main Mar 17, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants