-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(editor): update correct breakpoint value (#6724)
This PR adds the functionality of updating the correct breakpoint value in Tailwind (`lg-`, `md-`, etc) according to the current Scene size. **Details:** - We're checking the current Scene size to see if the element has some variant for this prop that matches it (we're choosing the best one if there are several), and updating only this value - If there are no variants or none matching, we update the default value (no breakpoint) - We're currently updating the value per-breakpoint **only** if it was defined per-breakpoint in the first place (for example via the code editor, with prefix) - The main change is building a map of each property to the modifiers that are *currenty* affecting it - (`getPropertiesToAppliedModifiersMap()`) - so that the property updating methods (that already exist in [tailwind-class-list-utils.ts](https://github.com/concrete-utopia/utopia/compare/feat/update-breakpoint-value?expand=1#diff-a2fc3b378fc847952f33e12c787ded13ff87a7c1f4dc0e3154b73b976117f9f5)) could use this information to understand *which* variant they need to update or remove (instead of always changing the default one as it was until now). Example: (Note - in this PR the controls **are not** indicated in green, this is left for future design decisions) <video src="https://github.com/user-attachments/assets/40815423-61e6-4f00-8a19-6d7cfc0d3bc3"></video> **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
- Loading branch information
Showing
6 changed files
with
209 additions
and
33 deletions.
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.