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" },
  });
});

V4 counterpart PR: #13888

@hbendev hbendev force-pushed the items-baseline-position-v3 branch from 3f62621 to 3e0e1f7 Compare August 15, 2024 23:29
@hbendev hbendev force-pushed the items-baseline-position-v3 branch from 3e0e1f7 to cae4260 Compare September 18, 2024 22:22
@thecrypticace thecrypticace requested a review from a team as a code owner December 3, 2024 19:05
@RobinMalfait RobinMalfait changed the base branch from main to v3 January 27, 2025 11:19
@RobinMalfait
Copy link
Member

Hey!

Thanks for this PR, but since Tailwind CSS v4 is out we won't be adding new features to v3. If you want this feature to v4, feel free to contribute against the next branch (at the time of writing this).

If you want to add this to your own v4 projects today, you can use:

@import "tailwindcss";

@utility items-first-baseline {
  align-items: first baseline;
}

@utility items-last-baseline {
  align-items: last baseline;
}

Example Play: https://play.tailwindcss.com/AMP4hBxpCX?file=css

Thanks again for this PR, appreciate it!

@hbendev
Copy link
Contributor Author

hbendev commented Jan 28, 2025

@RobinMalfait v4 counterpart PR: #13888 :)

But I like the example already so much! Thanks, and congrats on the new major version!

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