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

Grid resize: remove shorthand, serialize other longhand when not auto #6581

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

ruggi
Copy link
Contributor

@ruggi ruggi commented Oct 22, 2024

Problem:

If a grid is configured with the gridTemplate shorthand, resizing the grid does not handle that correctly.

Fix:

This PR handles gridTemplate shorthands during template changes via the canvas.
An incremental PR will do the same for the inspector template editing.

For example, if a grid is configured as follows: gridTemplate: 1fr 2fr / 3fr 4fr, changing its first column to 3.5fr will result in the following style:

gridTemplateColumns: '3.5fr 4fr',
gridTemplateRows: '1fr 2fr'

If a grid has a shorthand with an axis being the default (a single auto keyword), for example gridTemplate: auto / 3fr 4fr, the same change as above will result in:

gridTemplateColumns: '3.5fr 4fr',

Fixes #6580

Copy link
Contributor

github-actions bot commented Oct 22, 2024

Try me

Copy link

relativeci bot commented Oct 22, 2024

#14909 Bundle Size — 57.98MiB (~+0.01%).

60150e4(current) vs 916e8b9 master#14908(baseline)

Warning

Bundle contains 70 duplicate packages – View duplicate packages

Bundle metrics  Change 3 changes Regression 1 regression
                 Current
#14909
     Baseline
#14908
Regression  Initial JS 40.96MiB(~+0.01%) 40.96MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 17.99% 0%
No change  Chunks 20 20
No change  Assets 22 22
No change  Modules 4152 4152
No change  Duplicate Modules 213 213
Change  Duplicate Code 27.33%(-0.04%) 27.34%
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
#14909
     Baseline
#14908
Regression  JS 57.97MiB (~+0.01%) 57.97MiB
Improvement  HTML 7.37KiB (-0.25%) 7.39KiB

Bundle analysis reportBranch feat/grid-resize-shorthand-handl...Project dashboard


Generated by RelativeCIDocumentationReport issue

@ruggi ruggi merged commit b7687ff into master Oct 25, 2024
17 checks passed
@ruggi ruggi deleted the feat/grid-resize-shorthand-handle branch October 25, 2024 13:20
liady pushed a commit that referenced this pull request Dec 13, 2024
…#6581)

**Problem:**

If a grid is configured with the `gridTemplate` shorthand, resizing the
grid does not handle that correctly.

**Fix:**

This PR handles `gridTemplate` shorthands during template changes via
the canvas.
**An incremental PR will do the same for the inspector template
editing**.

For example, if a grid is configured as follows: `gridTemplate: 1fr 2fr
/ 3fr 4fr`, changing its first column to `3.5fr` will result in the
following style:
```
gridTemplateColumns: '3.5fr 4fr',
gridTemplateRows: '1fr 2fr'
```

If a grid has a shorthand with an axis being the default (a single
`auto` keyword), for example `gridTemplate: auto / 3fr 4fr`, the same
change as above will result in:
```
gridTemplateColumns: '3.5fr 4fr',
```

Fixes #6580
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.

Grid resize shorthand handling
4 participants