-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add color and typography presets to Global Styles #56622
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
3366eca
Add colors and typography to the styles tab
scruffian 9532adf
refactor
scruffian ddf005d
refactor
scruffian f075c7f
Add font family names
scruffian 92167fd
add heading and body previews
scruffian 379f62d
use palettes
scruffian c62be75
make typograpgy a grid
scruffian 1a3dd8a
make the styles look nicer
scruffian 5f50937
move component to its own file
scruffian de565ad
move color and type variations to different locations in the UI
scruffian db8fc25
revert
scruffian 76f9a9b
revert
scruffian 8663e68
revert
scruffian e2c18ec
revert
scruffian 32723f1
code dedupe
scruffian baab507
Add typesets
scruffian d8ec720
reorg typogrpahy
scruffian 0e94cbe
tidy up
scruffian e6d2392
tidy up code
scruffian dcf7f89
restyle color palettes
scruffian e8033c5
restyle color palettes
scruffian b4b0f80
remove typesets
scruffian f156dd5
add padding back
scruffian 00726ba
refactor
scruffian f401473
Show theme_name + style where there is no typography font family info.
ramonjd c0be163
Consolidating logic into a hook phase 1
ramonjd 1e15d41
2022 borks getFamilyPreviewStyle because `face.fontStyle` doesn't exist
ramonjd a23a6ca
comments
ramonjd 13bea45
Filtering results
ramonjd 63b85db
Create new convenience hook `useCurrentMergeThemeStyleVariationsWithU…
ramonjd c17157a
add a todo
ramonjd 3af2f95
A bit of clean up. Remove comments, adjust margins.
ramonjd f12bb72
move variation to a new component
scruffian da353ae
make variation a composible component
scruffian 88c8a3f
use the variation component for typography
scruffian 993a98e
Update typography preview
scruffian ecffb64
Add animation
scruffian 9493d20
move variation to a component
scruffian d368393
move preset to the higher level
scruffian 7bea0bf
Remove unneeded CSS
scruffian 6fbd619
updawte the design
scruffian 949f199
remove unsed css
scruffian 993c4af
Ensuring the cursor for the color previews is a pointer, which is the…
ramonjd e4eedf0
Reinstate removing property from user config before merging with vari…
ramonjd c642d19
i18n for letters
ramonjd e51b44f
Refactor unique font calculation
ramonjd b23d64c
move color and type variations higher
scruffian f7b735e
Use same box shadow as ColorIndicator so that there's a border around…
ramonjd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Ensuring the cursor for the color previews is a pointer, which is the…
… same as the typography preview Reducing the vheight of the color panel to match typography Some light refactoring
- Loading branch information
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 I noticed an issue with some themes that had only 2 palette colors, e.g., Freddie.
If those colors match heading or background colors, they're being filtered out:
gutenberg/packages/edit-site/src/components/global-styles/hooks.js
Lines 68 to 71 in f7b735e
The result is that, although there's a variation, the colors are empty:
CanvasLoader already gets around it this way:
gutenberg/packages/edit-site/src/components/canvas-loader/index.js
Lines 19 to 23 in f7b735e
Not sure what's appropriate in
<StylesPreviewColors />Maybe something like:
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.
Update: this is already an "feature" of trunk, in that style variation previews won't show them either.
I think it just looks strange in the preset previews. Maybe good for an immediate follow up.
To replicate the above issue, here's a style variation example. The palette colors are the same as the background and text colors so the variation will show nothing.
{ "version": 2, "settings": { "color": { "palette": [ { "color": "#000000", "name": "Base", "slug": "base" }, { "color": "#ffffff", "name": "Contrast", "slug": "contrast" } ] } }, "styles": { "color": { "text": "#000000", "background": "var(--wp--preset--color--contrast)" } } }