Repository navigation
Conversation
3cbbe53 to
e06b61a
Compare
sirreal
left a comment
There was a problem hiding this comment.
I left a few questions about SASS variables.
| // Preview positioning | ||
| $preview-max-width: 960px; | ||
| $preview-right-margin: 24px; | ||
| $preview-left-sidebar-reduced: calc( 30% + #{$wp-org-sidebar-reduced} ); | ||
| $preview-left-sidebar-full: calc( 30% + #{$wp-org-sidebar-full} ); | ||
|
|
||
| $template-large-preview-title-height: 120px; |
There was a problem hiding this comment.
I believe these will become global, there's no module-scoping of variables in SASS.
It would be good to make sure "local" variables have namespace style prefixes.
There was a problem hiding this comment.
I copied all of this from existing SPT styling 😅 Think there's potential for regression?
| $wp-org-sidebar-reduced: 36px; | ||
| $wp-org-sidebar-full: 160px; |
There was a problem hiding this comment.
Are these meant to replace some existing variables? This seems dangerous, see my other comment about global variables and namespaces.
There was a problem hiding this comment.
I think they're just used by SPT for some calculations.
We could use these upstream vars though: https://github.com/WordPress/gutenberg/blob/fdd69535ecbec018bfabad783c890de3d72b7e07/packages/base-styles/_variables.scss#L30-L32
| $template-selector-modal-offset-right: 32px; | ||
| $template-selector-blank-template-mobile-height: 70px; | ||
|
|
||
| @mixin screen-reader-text() { |
There was a problem hiding this comment.
Isn't this mixin either in Calypso or Gutenberg base styles already? Could we import it from there?
There was a problem hiding this comment.
I couldn't find it in Calypso upon a quick search. It appears to be in Gutenberg, https://github.com/WordPress/gutenberg/blob/bfd1117846c7802d62dbba046c27968d961781e7/packages/block-editor/src/components/responsive-block-control/style.scss#L1-L12, so we might be able to use that -- unless there's more implicit dependencies (like this: WordPress/gutenberg#19159).
Overall, this PR is just moving around pre-existing styling; I'd like to limit changes that go beyond that in order to unblock it soon 😬
There was a problem hiding this comment.
(We might actually want to use that entire component rather than just its styling.)
There was a problem hiding this comment.
Just moving things around in this PR makes sense. 👍
| $template-selector-border-color-selected: #555d66; | ||
| $template-selector-border-color-active: #00a0d2; | ||
| $template-selector-border-color-hover: #c9c9ca; | ||
| $template-selector-empty-background: #fff; |
There was a problem hiding this comment.
While it's ok to have them here, should these variables be pulled in from Gutenberg base styles or color studio? I.e.:
$template-selector-empty-background: $white;|
|
||
| // Template Selector Preview | ||
| .template-selector-preview { | ||
| @media screen and ( max-width: 659px ) { |
There was a problem hiding this comment.
Do we have mixins or variables available in Gutenberg for these screen sizes?
There was a problem hiding this comment.
Couldn't find any (tried grepping 660px and 659px).
There was a problem hiding this comment.
Gotcha — I guess in some follow up some day we could re-use breakpoints from ~@wordpress/base-styles/breakpoints
| $preview-max-width: 960px; | ||
| $preview-right-margin: 24px; | ||
| $preview-left-sidebar-reduced: calc( 30% + #{$admin-sidebar-width-collapsed} ); | ||
| $preview-left-sidebar-full: calc( 30% + #{$admin-sidebar-width} ); |
There was a problem hiding this comment.
Will $admin-sidebar-width work both in wp-admin when WP sidebar is visible and when Gutenberg is iframed in Calypso and the sidebar is hidden?
There was a problem hiding this comment.
idk 😅 -- But all I did in f4adda3 is remove two SASS var definitions with two other ones that I'm importing from @wordpress/base-styles. That shouldn't change any behavior, should it?
There was a problem hiding this comment.
That shouldn't change any behavior, should it?
It shouldn't indeed and sounds fair! :-) Just good to test both scenarios anyway always when CSS is touched for anything FSE plugin related.
|
Left a few scss variables questions as well — I haven't tested so I'm little ignorant about how things actually work, hence some questions might not make sense. 😁 Hope this helps anyway! |
| @@ -0,0 +1,189 @@ | |||
| @import '~@wordpress/base-styles/variables'; | |||
There was a problem hiding this comment.
Since WordPress/gutenberg#19159 is an issue at the moment, you could also import the whole set via this file:
There was a problem hiding this comment.
I pushed be80333 which seems to be enough.
|
Ehm... this PR says hi: #38065 😅 |
|
Closing; obsolete as of #38456. |
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~30 bytes added 📈 [gzipped]) DetailsCommon code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
Changes proposed in this Pull Request
Isolate
TemplateSelectorControlcomponent, and rename toTemplateSelector.While working on #38403, I discovered that
TemplateSelectorControl's styling is a bit weird, and doesn't lend itself easily to removing the white bar at the bottom of each item that contains the template name.This is due to some
padding-top: 100%, absolute positioning, translating, etc. I think that we can achieve the same styling in a more semantic way, that will also allow us to conditionally remove the label.To that end, I'd like to isolate the
TemplateSelectorControlcomponent and styling, so it becomes easier to modify them, since currently, there's just one big style file in FSE.This PR renames
TemplateSelectorControltoTemplateSelector, and moves it (and its dependencies, and styling) to a separate folder.Testing instructions
apps/full-site-editing/full-site-editing-plugin/starter-page-templates/page-template-modal/components/template-selector/test/:cd apps/full-site-editing/ && npm ci && npm run test:unit