Skip to content

Conversation

@Jeremy-Walton
Copy link
Member

@Jeremy-Walton Jeremy-Walton commented Dec 9, 2025

Why?

Add some new flex utilities for more declarative layouts without going the full stretch to make components.

What Changed

  • Add cluster
  • Add split
  • Add stack
  • Add layout example

Quality Assurance

  • Have you tagged the PR with the correct labels?
  • Have you validated the changes?
    • Have you run linters? (yarn sanity-check)
    • Have you run prettier?
    • Have you tried building the css?
    • Have you tried building storybook?
  • [ ] Have you updated any usage of changed tokens?
  • [ ] Did you add a component?
    • [ ] Have you added it to the dependency graph?
    • [ ] Have you added it to the docs?
  • [ ] Did you update a component?
    • [ ] Have you updated the dependency graph?
    • [ ] Have you updated the docs?
  • [ ] Do you need to update the package version?
    Planning on one more addition before release v2.3.0

Screenshots

Cluster

Screenshot 2025-12-08 at 10 03 03 PM Screenshot 2025-12-08 at 10 03 09 PM Screenshot 2025-12-08 at 10 03 13 PM Screenshot 2025-12-08 at 10 03 19 PM

Split

Screenshot 2025-12-08 at 10 13 30 PM Screenshot 2025-12-08 at 10 17 22 PM Screenshot 2025-12-08 at 10 13 44 PM Screenshot 2025-12-08 at 10 13 47 PM

Stack

Screenshot 2025-12-08 at 10 19 34 PM Screenshot 2025-12-08 at 10 19 40 PM Screenshot 2025-12-08 at 10 19 44 PM Screenshot 2025-12-08 at 10 19 52 PM Screenshot 2025-12-08 at 10 19 55 PM

Utility Layout

Screenshot 2025-12-08 at 10 47 36 PM Screenshot 2025-12-08 at 10 47 46 PM

@Jeremy-Walton Jeremy-Walton self-assigned this Dec 9, 2025
@Jeremy-Walton Jeremy-Walton added the Utilities Changes to the utilities label Dec 9, 2025
@Jeremy-Walton Jeremy-Walton marked this pull request as ready for review December 9, 2025 03:49
Copy link
Contributor

@theoluciano theoluciano left a comment

Choose a reason for hiding this comment

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

Do you want to repeat the description for each of the blocks when you're just changing one keyword (stack, split, cluster) at the end? Seems like
While flex utilities are great for moving quickly or for simple layouts, they can easily become cumbersome to manage and tend to turn into "Flex Spaghetti". In some of these cases, reaching for named components may make sense. However, there are times when a full component is more restrictive than you need and hurts productivity. Sometimes you need just a bit more structure to your layout, but not a component. could just be more of a top level thing and not need to be repeated. Just a thought.

Looks good otherwise; sheep it!

@Jeremy-Walton
Copy link
Member Author

@theoluciano It could be a top level thing, I'm just not sure where it would belong.

@Jeremy-Walton
Copy link
Member Author

@theoluciano I moved that code block to a full page for utilities and pulled in the writing Scott and I did a while back but never added to Optics.

Screenshot 2025-12-09 at 11 11 55 AM Screenshot 2025-12-09 at 11 13 13 AM Screenshot 2025-12-09 at 11 13 08 AM Screenshot 2025-12-09 at 11 13 02 AM

Copy link
Member

@dallasbpeters dallasbpeters left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@scriswell
Copy link
Collaborator

@Jeremy-Walton With these new layout utilities, can we start prefixing the classes with op- to future-proof these a bit? I’m thinking that since these are new to the system, we can remove some breakage in the future as we introduce class prefixing more broadly into the design system.

@Jeremy-Walton
Copy link
Member Author

  1. Will use the prefix op-stack etc.
  2. Can switch to :where since it has 0 specificity to provide the default gaps rather than the not selector.
:where(.stack) {
  gap: var(...);
}

@Jeremy-Walton Jeremy-Walton merged commit d65e291 into main Dec 14, 2025
5 checks passed
@Jeremy-Walton Jeremy-Walton deleted the new-layout-utilities branch December 14, 2025 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Utilities Changes to the utilities

Development

Successfully merging this pull request may close these issues.

5 participants