-
Notifications
You must be signed in to change notification settings - Fork 172
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
feat(editor): show correct responsive value according to breakpoint #6723
Conversation
#15424 Bundle Size — 58.22MiB (~+0.01%).be8d377(current) vs d1d46c1 master#15423(baseline) Warning Bundle contains 70 duplicate packages – View duplicate packages Bundle metrics
|
Current #15424 |
Baseline #15423 |
|
---|---|---|
Initial JS | 41.19MiB (~+0.01% ) |
41.19MiB |
Initial CSS | 0B |
0B |
Cache Invalidation | 18.26% |
18.14% |
Chunks | 20 |
20 |
Assets | 22 |
22 |
Modules | 4191 (+0.02% ) |
4190 |
Duplicate Modules | 213 |
213 |
Duplicate Code | 27.24% |
27.24% |
Packages | 477 |
477 |
Duplicate Packages | 70 |
70 |
Bundle size by type 2 changes
1 regression
1 improvement
Current #15424 |
Baseline #15423 |
|
---|---|---|
JS | 58.21MiB (~+0.01% ) |
58.21MiB |
HTML | 9.4KiB (-0.21% ) |
9.42KiB |
Bundle analysis report Branch feat/show-correct-value Project dashboard
Generated by RelativeCI Documentation Report issue
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.
Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.
Files not reviewed (2)
- editor/src/components/canvas/canvas-types.ts: Evaluated as low risk
- editor/src/components/canvas/commands/utils/property-utils.ts: Evaluated as low risk
Comments suppressed due to low confidence (1)
editor/src/components/canvas/plugins/inline-style-plugin.ts:49
- [nitpick] The
modifiers
parameter in thecssVariant
function is optional, but it's being passed an empty array. Ensure that this behavior is intended and consistent.
const currentVariant = cssVariant(parsed.value, [])
This PR adds the ability to display the correct value in the controller according to the Scene size.
For example - if the element has
className='pt-[20px] lg:pt-[150px] md:pt-[110px]
, and the Scene has a width of1000px
(which is larger thanmd
but smaller thanlg
) - thepaddingTop
control will correctly show110px
.Details:
ParsedCSSStyleProperty
, so instead of containing just thevalue
it now holds:variants
(the possible values and for each one themodifier
s that when applied, the value is chosen. a screen size is a modifier)currentVariant
- which is the value that is currently selected according to the Scene size.getModifiers
, that converts the Tailwind specific variants from the parser representation that looks like:to our generic representation:
getModifiers
function uses an interalscreensConfigToScreenSizes
function - that parses the Tailwind config to have a map of<screenAlias>
toScreenSize
tailwind-responsive-utils.spec.ts
selectValueByBreakpoint
to select the best matching variant)Example (note that this PR does not contain the Scene resize buttons):
Monosnap.screencast.2024-12-04.19-40-23.mp4
Manual Tests:
I hereby swear that: