Skip to content

Conversation

@adamwathan
Copy link
Member

Summary

This PR adds support for logical block-start and block-end CSS properties in Tailwind CSS utilities. These properties are part of the CSS Logical Properties specification and provide writing-mode-aware alternatives to physical top/bottom properties.

The following new utilities are added:

  • Border utilities: border-bs-* and border-be-* (for border-block-start and border-block-end)
  • Margin utilities: mbs-* and mbe-* (for margin-block-start and margin-block-end)
  • Scroll margin utilities: scroll-mbs-* and scroll-mbe-* (for scroll-margin-block-start and scroll-margin-block-end)
  • Scroll padding utilities: scroll-pbs-* and scroll-pbe-* (for scroll-padding-block-start and scroll-padding-block-end)
  • Padding utilities: pbs-* and pbe-* (for padding-block-start and padding-block-end)

These utilities follow the same patterns as their existing inline-start/inline-end counterparts and support all standard modifiers (arbitrary values, negative values, opacity modifiers, etc.).

Changes

  1. utilities.ts: Added new utility definitions for all block-start/block-end properties
  2. property-order.ts: Updated CSS property ordering to include the new logical properties in the correct cascade order
  3. utilities.test.ts: Added comprehensive test cases for all new utilities
  4. utilities.test.ts.snap: Updated snapshots showing generated CSS for the new utilities

Test plan

All changes are covered by existing test infrastructure:

  • Unit tests verify correct CSS generation for each utility variant
  • Snapshot tests validate the complete output for border utilities
  • Invalid modifier combinations are tested to ensure proper error handling
  • Tests cover standard values, arbitrary values, negative values, and opacity modifiers

https://claude.ai/code/session_01V89HxEtppGVvMtuPbYrayM

Add new logical property utilities following the existing pattern for inline-start/inline-end:

- pbs-*, pbe-* for padding-block-start, padding-block-end
- mbs-*, mbe-* for margin-block-start, margin-block-end
- border-bs-*, border-be-* for border-block-start, border-block-end
- scroll-pbs-*, scroll-pbe-* for scroll-padding-block-start, scroll-padding-block-end
- scroll-mbs-*, scroll-mbe-* for scroll-margin-block-start, scroll-margin-block-end

These complement the existing ps-*, pe-*, ms-*, me-*, border-s-*, border-e-*
utilities by providing block axis equivalents.

https://claude.ai/code/session_01V89HxEtppGVvMtuPbYrayM
@adamwathan adamwathan requested a review from a team as a code owner January 27, 2026 13:24
@adamwathan
Copy link
Member Author

@claude Can you update the changelog too?

@coderabbitai
Copy link

coderabbitai bot commented Jan 27, 2026

Walkthrough

Adds block-axis CSS property variants to Tailwind’s property ordering and registers corresponding utilities/shorthands. Property-order updates include margin-block-start/margin-block-end, scroll-margin-block-start/scroll-margin-block-end, scroll-padding-block-start/scroll-padding-block-end, border-block-start-{width,style,color}/border-block-end-{width,style,color}, and padding-block-start/padding-block-end. Utilities and shorthands added include mbs, mbe, scroll-mbs, scroll-mbe, pbs, pbe, border-bs, and border-be. Tests were added covering utility parsing, CSS output, theme variable resolution, and custom property handling.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding logical block-start/block-end border, margin, and padding utilities to Tailwind CSS.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the new CSS logical properties utilities, listing all additions, and documenting the test coverage.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Line 21: Update the placeholder PR link in the changelog entry by replacing
`#XXXXX` with the actual PR number (e.g. `#NNNNN`) so the link is not broken,
and extend the utilities list that currently includes `pbs-*`, `pbe-*`, `mbs-*`,
`mbe-*`, `border-bs-*`, `border-be-*` to also mention the new scroll logical
utilities for scroll padding/margin (add the corresponding `scroll-pbs-*`,
`scroll-pbe-*`, `scroll-mbs-*`, `scroll-mbe-*` or a single `scroll-*` notation
consistent with the existing naming pattern) so the release note accurately
reflects the PR changes.

adamwathan and others added 2 commits January 27, 2026 10:03
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.

4 participants