-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tailwind-compatible flex section: round 1 #6650
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…to feature/tailwind-flex-section
#15181 Bundle Size — 58.09MiB (~-0.01%).8b7cdb1(current) vs d1d46c1 master#15178(baseline) Warning Bundle contains 70 duplicate packages – View duplicate packages Bundle metrics
Bundle size by type
Bundle analysis report Branch feature/tailwind-flex-section Project dashboard Generated by RelativeCI Documentation Report issue |
seanparsons
approved these changes
Nov 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the tests!
gbalint
approved these changes
Nov 19, 2024
liady
pushed a commit
that referenced
this pull request
Dec 13, 2024
## Problem The controls to set `justify-contents`, `align-items` and `flex-direction` don't work with Tailwind ## Fix - Add the necessary class names to `TailwindClassNameMapping`, so that the Tailwind style plugin can write these classes. These controls read props from `specialSizeMeasurements`, so I'm leaving `StyleInfo` unchanged in this PR, and add the flex-related classes I added to `TailwindClassNameMapping` when something actually needs to read them through `StyleInfo`. - Add tests for Tailwind editing in the affected controls ### Commit Details - Add the necessary class names to `TailwindClassNameMapping` - Add tests for `NineBlockControl` (used to set `justify-contents` and `align-items`) - Add tests for `ThreebarControl` (used to set `align-items` when `justify-contents` is set to `space-between`) - Add tests for `SpacedPackedControls` (sets `justify-contents` to either `space-between` for spaced or to `flex-start` for `packed`) - Add tests for `FlexDirectionToggle` (used to set flex direction) ### Out of scope There are two other controls in the flex section, used for setting `flex-wrap` and `flex-gap`. These controls use `useInspectorInfo` under the hood, making that work is left to a follow-up PR ## Manual Tests I hereby swear that: - [x] I opened a hydrogen project and it loaded - [x] I could navigate to various routes in Play mode
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The controls to set
justify-contents
,align-items
andflex-direction
don't work with TailwindFix
TailwindClassNameMapping
, so that the Tailwind style plugin can write these classes. These controls read props fromspecialSizeMeasurements
, so I'm leavingStyleInfo
unchanged in this PR, and add the flex-related classes I added toTailwindClassNameMapping
when something actually needs to read them throughStyleInfo
.Commit Details
TailwindClassNameMapping
NineBlockControl
(used to setjustify-contents
andalign-items
)ThreebarControl
(used to setalign-items
whenjustify-contents
is set tospace-between
)SpacedPackedControls
(setsjustify-contents
to eitherspace-between
for spaced or toflex-start
forpacked
)FlexDirectionToggle
(used to set flex direction)Out of scope
There are two other controls in the flex section, used for setting
flex-wrap
andflex-gap
. These controls useuseInspectorInfo
under the hood, making that work is left to a follow-up PRManual Tests
I hereby swear that: