Skip to content
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 aware padding #6637

Merged
merged 6 commits into from
Nov 15, 2024
Merged

Tailwind aware padding #6637

merged 6 commits into from
Nov 15, 2024

Conversation

bkrmendy
Copy link
Contributor

@bkrmendy bkrmendy commented Nov 13, 2024

Problem

The padding controls cannot be used to read/write values in projects that use Tailwind for styling.

Fix

Use the style plugins and the StyleInfo system to make this possible.

Specifically,

  • Add the padding shorthand prop/padding longhand prop to the StyleInfo interface
  • Update InlineStylePlugin and TailwindStylePlugin to support the new props in StyleInfo
  • Refactor the padding strategy, the padding control handle and the subdued padding control to read element styles through a StyleInfoReader instance
  • Add a new property patcher in style-plugins@patchers to take care of patching removed padding props
  • Add tests with a tailwind project to the padding strategy test suite

Out of scope

The jump in the bounding box after the interaction ends (video) will be addressed on a follow-up PR

Manual Tests

I hereby swear that:

  • I opened a hydrogen project and it loaded
  • I could navigate to various routes in Play mode

Copy link
Contributor

github-actions bot commented Nov 13, 2024

Try me

Copy link

relativeci bot commented Nov 13, 2024

#15132 Bundle Size — 58.08MiB (~+0.01%).

79399a8(current) vs d1d46c1 master#15127(baseline)

Warning

Bundle contains 70 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#15132
     Baseline
#15127
Regression  Initial JS 41.05MiB(~+0.01%) 41.05MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 21.42% 18.01%
No change  Chunks 20 20
No change  Assets 22 22
No change  Modules 4169 4169
No change  Duplicate Modules 213 213
No change  Duplicate Code 27.3% 27.3%
No change  Packages 477 477
No change  Duplicate Packages 70 70
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
#15132
     Baseline
#15127
Regression  JS 58.07MiB (~+0.01%) 58.07MiB
Improvement  HTML 7.37KiB (-0.24%) 7.39KiB

Bundle analysis reportBranch feature/tailwind-aware-paddingProject dashboard


Generated by RelativeCIDocumentationReport issue

@bkrmendy bkrmendy changed the title Feature/tailwind aware padding Tailwind aware padding Nov 14, 2024
@bkrmendy bkrmendy marked this pull request as ready for review November 14, 2024 15:12
@bkrmendy bkrmendy mentioned this pull request Nov 14, 2024
2 tasks
@bkrmendy bkrmendy merged commit 35148f9 into master Nov 15, 2024
16 checks passed
@bkrmendy bkrmendy deleted the feature/tailwind-aware-padding branch November 15, 2024 13:13
seanparsons pushed a commit that referenced this pull request Nov 18, 2024
## Problem
The padding controls cannot be used to read/write values in projects
that use Tailwind for styling.

## Fix
Use the style plugins and the `StyleInfo` system to make this possible.

Specifically,
- Add the padding shorthand prop/padding longhand prop to the
`StyleInfo` interface
- Update `InlineStylePlugin` and `TailwindStylePlugin` to support the
new props in `StyleInfo`
- Refactor the padding strategy, the padding control handle and the
subdued padding control to read element styles through a
`StyleInfoReader` instance
- Add a new property patcher in `style-plugins@patchers` to take care of
patching removed padding props
- Add tests with a tailwind project to the padding strategy test suite

### Out of scope
The jump in the bounding box after the interaction ends
([video](https://screenshot.click/14-02-e9ktf-say96.mp4)) will be
addressed on 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
liady pushed a commit that referenced this pull request Dec 13, 2024
## Problem
The padding controls cannot be used to read/write values in projects
that use Tailwind for styling.

## Fix
Use the style plugins and the `StyleInfo` system to make this possible.

Specifically,
- Add the padding shorthand prop/padding longhand prop to the
`StyleInfo` interface
- Update `InlineStylePlugin` and `TailwindStylePlugin` to support the
new props in `StyleInfo`
- Refactor the padding strategy, the padding control handle and the
subdued padding control to read element styles through a
`StyleInfoReader` instance
- Add a new property patcher in `style-plugins@patchers` to take care of
patching removed padding props
- Add tests with a tailwind project to the padding strategy test suite

### Out of scope
The jump in the bounding box after the interaction ends
([video](https://screenshot.click/14-02-e9ktf-say96.mp4)) will be
addressed on 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants