-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make child themes inherit parent's style variations. (#46554)
* Include parent theme dir in style variation getter. * Fix mismatched variable names. * Refactor to static utility function. * Check for naming collisions via basename. * Fix linting errors and warnings. * Rebase trunk. * Update version since. * Use _Gutenberg class. * Add back line break. * Fix linting errors. * Refactor to allow parent theme variations to show up when child has no variations. * Add unit test for resolver class. * Comment the test. * Fix lint. * Rename variations to account for child overwriting parent variation.
- Loading branch information
Showing
8 changed files
with
190 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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 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 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
18 changes: 18 additions & 0 deletions
18
phpunit/data/themedir1/block-theme-child/styles/variation-a.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"version": 2, | ||
"settings": { | ||
"blocks": { | ||
"core/paragraph": { | ||
"color": { | ||
"palette": [ | ||
{ | ||
"slug": "dark", | ||
"name": "Dark", | ||
"color": "#010101" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": 1, | ||
"version": 2, | ||
"settings": { | ||
"color": { | ||
"palette": [ | ||
|
18 changes: 18 additions & 0 deletions
18
phpunit/data/themedir1/block-theme/styles/variation-a.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"version": 2, | ||
"settings": { | ||
"blocks": { | ||
"core/paragraph": { | ||
"color": { | ||
"palette": [ | ||
{ | ||
"slug": "light", | ||
"name": "Light", | ||
"color": "#f2f2f2" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
phpunit/data/themedir1/block-theme/styles/variation-b.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"version": 2, | ||
"settings": { | ||
"blocks": { | ||
"core/post-title": { | ||
"color": { | ||
"palette": [ | ||
{ | ||
"slug": "light", | ||
"name": "Light", | ||
"color": "#f1f1f1" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": 1, | ||
"version": 2, | ||
"settings": { | ||
"color": { | ||
"palette": [ | ||
|
da16e42
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.
Flaky tests detected in da16e42.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.
🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3946838829
📝 Reported issues:
specs/editor/blocks/classic.test.js