Skip to content

Global Styles: allow users to store duotone data#35318

Merged
oandregal merged 5 commits into
trunkfrom
update/secure-styles-duotone
Oct 7, 2021
Merged

Global Styles: allow users to store duotone data#35318
oandregal merged 5 commits into
trunkfrom
update/secure-styles-duotone

Conversation

@oandregal
Copy link
Copy Markdown
Member

Follow-up to #34667
Related #35228 #35248 #35255

With this PR, duotone data provided by the users in the proper format will be stored safely in the CPT that holds the user data. This has no effect on the UI because we still don't have duotone in the global styles sidebar. When we add it, it'll work fine.

How to test

Test duotone works as expected:

  • Use a theme that provides a theme.json and add within styles.blocks the following code:
"core/image": {
  "filter": {
    "duotone": "var(--wp--preset--duotone--blue-red)"
  }
}
  • Add two images in the post editor and set a duotone filter for one. Leave the other in the default state.
  • Publish the post and verify that both images have the proper filters applied in the post editor and in the front of the site.

Test that the user data filter works as expected:

  • Run npm run test-php should pass.

@oandregal oandregal self-assigned this Oct 4, 2021
@oandregal oandregal requested review from a team and ajlende October 4, 2021 10:59
@oandregal oandregal added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Oct 4, 2021
@oandregal oandregal changed the title Allow users to store duotone data Global Styles: allow users to store duotone data Oct 4, 2021
Comment thread lib/class-wp-theme-json-gutenberg.php Outdated
Comment thread lib/class-wp-theme-json-gutenberg.php
@oandregal oandregal merged commit 396e61a into trunk Oct 7, 2021
@oandregal oandregal deleted the update/secure-styles-duotone branch October 7, 2021 06:41
@github-actions github-actions Bot added this to the Gutenberg 11.8 milestone Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants