-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add global styles sidebar at edit site screen #24250
Conversation
Size Change: +1.99 kB (0%) Total Size: 1.2 MB
ℹ️ View Unchanged
|
afa925f
to
d2c93b2
Compare
I may have done something wrong, but I can not get the PR to work fully, following the instructions above. +For an early implementation the sidebar looks good in the site editor. So happy to see progress on this. (I think the block type list needs better grouping because it get's too long to manage) -Styles are not saved. So they are also not visible when I switch to the post editor, nor on the front. I was wondering if the duplication of the wrapper is on purpose: |
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.
I was not being able to run this branch and the always crashed. Turns I had user global styles data save using a previous format. If someone experiments a similar issue verify the posts with
SELECT * FROM `wp_posts` WHERE `post_name` LIKE 'wp-global-styles-global-styles' ORDER BY `ID` DESC
And if there is data in a strange format delete all the posts matching the condition.
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.
While testing this PR, I noticed that when I changed the global preset font size, it was not affecting the paragraphs or the headings, and I initially thought something was not working because chaning the global value did not seemed to have any impact at all.
Then I noticed that the theme.json file specified a size for the paragraph and headings, making the global value not used at all. I guess users may be confused easily. In some themes, the global setting affected the paragraph in other themes it does not affect at all. I think it may be helpful to have toggle/hint that allows us to see which blocks will not be affected because they have a block specific theme/user overwrite. Not in scope of this PR, just leaving a suggestion for the future.
packages/edit-site/src/components/editor/global-styles-renderer.js
Outdated
Show resolved
Hide resolved
packages/edit-site/src/components/editor/global-styles-provider.js
Outdated
Show resolved
Hide resolved
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.
Awesome work @nosolosw this PR seems to be working well 👍 I guess we should try to merge it soon.
It would be great to get this first iteration into Gutenberg, and make it possible to test by turning on the experiment through Gutenberg -> Experiments screen. It would make it a lot easier for people to test and give feedback. Thanks! |
d2c93b2
to
3d51c30
Compare
packages/edit-site/src/components/editor/global-styles-provider.js
Outdated
Show resolved
Hide resolved
packages/edit-site/src/components/editor/global-styles-provider.js
Outdated
Show resolved
Hide resolved
793403d
to
408abde
Compare
I'm moving this from draft to open for reviews. It still needs some tweaks, but it's now in a good state. We can start thinking of merging it. 🤞 💪 |
Since #22520 was merged on May we've been enqueuing the presets as CSS variables whether or not the theme had support for theme.json as a way to speed up themes using them and get feedback. There are enough checks in place that this is inocuous.
80f350d
to
76a68c3
Compare
Good catch, Carolina, thanks! It's fixed as of 20fcaaa |
This has been merged and will be part of the next Gutenberg release. Thanks for your time, everyone! 💪 I created some follow-up issues:
|
Previous attempts: #20061 #20530
This PR resumes the work to add a mechanism for the user to tweak the styles that are defined by core and theme via
experimental-theme.json
.Test instructions
Test in
edit-site
:Test in
edit-post
:edit-site
.