Commit Graph

10 Commits

Author SHA1 Message Date
ramonopoly 94b9ccd020 Block Styles: Ensure unique classname generation for variations
This commit simplifies block style variation class name generation to ensure unique class names by replacing the hashing of block attributes in the block style variation class names with a call to `wp_unique_id`.

Doing so avoids potential for non-unique class names and conflicting styles when exact copies of a block are inserted via a repeated pattern.


Props aaronrobertshaw, martinkrcho, mukesh27, peterwilsoncc, ramonopoly.

Fixes #61877.


Built from https://develop.svn.wordpress.org/trunk@58951


git-svn-id: http://core.svn.wordpress.org/trunk@58347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-29 05:41:10 +00:00
talldanwp 2468ef9f8c Block Styles: Fix ordering of stylesheets when a style variation is applied.
Adjusts the dependency order to ensure stylesheets are output in the correct order.

Syncs the PHP changes from https://github.com/WordPress/gutenberg/pull/63918.

Props talldanwp, aaronrobertshaw, andrewserong, aristath, mukesh27, ramonopoly, ytfeldrawkcab.
Fixes #61748.


Built from https://develop.svn.wordpress.org/trunk@58850


git-svn-id: http://core.svn.wordpress.org/trunk@58246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-05 06:41:14 +00:00
ellatrix c56593dfe1 Section Styles: Fix ref values within block style variations.
Fixes #61589.
Fixes https://github.com/WordPress/wordpress-develop/pull/6989.
See https://github.com/WordPress/gutenberg/pull/63172.

Props aaronrobertshaw, andrewserong, ramonopoly.


Built from https://develop.svn.wordpress.org/trunk@58691


git-svn-id: http://core.svn.wordpress.org/trunk@58093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-09 10:24:19 +00:00
oandregal 6476fd96ec Section styles: improve performance and conceptual consistency.
These changes involve:

- Move shared variation definitions from styles.blocks.variations to styles.variations
- Remove blockTypes from styles.variations.
- Do not register shared variations from theme style variation or primary theme.json files.
- Move the merging of theme.json data into the WP_Theme_JSON_Resolver and WP_Theme_JSON classes.

These changes improve performance and are more future-proof API wise.
See conversation at https://github.com/WordPress/gutenberg/issues/62686

Props aaronrobertshaw, oandregal, andrewserong, joemcgill, talldanwp, andrewserong, ramonopoly, richtabor, youknowriad.

See #61312, #61451.

Built from https://develop.svn.wordpress.org/trunk@58466


git-svn-id: http://core.svn.wordpress.org/trunk@57915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-24 08:51:16 +00:00
oandregal 9a8a0b3fcd Do not use init to register block style variations defined via theme.json.
Props oandregal, aaronrobertshaw, joemcgill, ramonopoly, andrewserong, swissspidy.
See #61451.
Fixes #61312.

Built from https://develop.svn.wordpress.org/trunk@58429


git-svn-id: http://core.svn.wordpress.org/trunk@57878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-18 07:09:06 +00:00
oandregal 963175f228 Global Styles: Avoid unnecessary processing of theme.json variation partials.
Props aaronrobertshaw, oandregal, mukesh27.
See #61451.

Built from https://develop.svn.wordpress.org/trunk@58423


git-svn-id: http://core.svn.wordpress.org/trunk@57872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-17 10:08:12 +00:00
oandregal c9fa3d2f32 Global styles: prevent duplicate CSS for block style variations.
Props aaronrobertshaw, mukesh27, ramonopoly, isabel_brison, oandregal.
Fixes #61443.

Built from https://develop.svn.wordpress.org/trunk@58422


git-svn-id: http://core.svn.wordpress.org/trunk@57871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-17 09:44:10 +00:00
oandregal d2ebe7d776 Section styles: add slug to override non-kebab-cased variations.
Props aaronrobertshaw, oandregal.
Fixes #61440.

Built from https://develop.svn.wordpress.org/trunk@58413


git-svn-id: http://core.svn.wordpress.org/trunk@57862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-14 09:05:11 +00:00
oandregal 24a4ef96be Editor: register block style variations defined by the theme using the init action.
Props oandregal, aaronrobertshaw, annezazu.

Follow-up to [58264].
See #61312.


Built from https://develop.svn.wordpress.org/trunk@58394


git-svn-id: http://core.svn.wordpress.org/trunk@57843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-12 07:17:12 +00:00
noisysocks 51c676d7ea Block Themes: Add section styling via extended block style variations
Provide users with the ability to style entire sections of a page without
having to tediously reapply the same sets of styles.

This is done by extending block style variations to apply to nested blocks.

See https://github.com/WordPress/gutenberg/pull/57908.

Fixes #61312.
Props aaronrobertshaw, talldanwp, ramonopoly, isabel_brison, andrewserong.

Built from https://develop.svn.wordpress.org/trunk@58264


git-svn-id: http://core.svn.wordpress.org/trunk@57727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-31 05:49:14 +00:00