-
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
Make child themes inherit parent's style variations. #46554
Merged
jffng
merged 15 commits into
trunk
from
try/child-theme-inherit-parent-style-variations
Jan 18, 2023
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
176d5a2
Include parent theme dir in style variation getter.
jffng 5e6133b
Fix mismatched variable names.
jffng 06e756a
Refactor to static utility function.
jffng 6a94315
Check for naming collisions via basename.
jffng b3f2162
Fix linting errors and warnings.
jffng 621ba97
Rebase trunk.
jffng 34f972f
Update version since.
jffng e704e85
Use _Gutenberg class.
jffng 745cea6
Add back line break.
jffng 8e64d72
Fix linting errors.
jffng 7b1018f
Refactor to allow parent theme variations to show up when child has n…
jffng 2393211
Add unit test for resolver class.
jffng 90f2780
Comment the test.
jffng 7877289
Fix lint.
jffng fcfbc12
Rename variations to account for child overwriting parent variation.
jffng 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
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": [ | ||
|
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.
I updated the version number here, which seems like it was incorrect to begin with since it was already using the
customTemplates
andtemplateParts
properties which were added in v2.