Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
85a9598
Edit block style variations from global styles
tellthemachines Dec 7, 2022
6c065bf
It's not working yet but we'll get there
tellthemachines Dec 8, 2022
6943f00
Hardcoded a bunch of stuff to see if it works
tellthemachines Dec 9, 2022
9f89d2e
Add back empty line
tellthemachines Dec 13, 2022
d6bf36b
update panel paths to use encodeURIComponent
tellthemachines Dec 13, 2022
fd3451b
Move updated sanitize function to 6.2 folder
tellthemachines Dec 13, 2022
91350f4
Output CSS for edited style variations
tellthemachines Dec 13, 2022
564fd4e
Any [a-z]* style variation name should be possible
tellthemachines Dec 14, 2022
822b800
Fix test failures
tellthemachines Dec 14, 2022
201f6a0
Add handling of feature selectors
tellthemachines Dec 15, 2022
6e9f10c
Add colors and typography
tellthemachines Dec 15, 2022
df3c408
Re-add changes to class-wp-theme-json
tellthemachines Dec 19, 2022
79d760b
Fix color paths
tellthemachines Dec 20, 2022
6cfb120
Add dimensions styles
tellthemachines Dec 20, 2022
3467f9d
Bump up front end specificity.
tellthemachines Dec 20, 2022
fa02475
Only core variations should be editable
tellthemachines Dec 20, 2022
60d95e2
Basic functionality to create a new variation
tellthemachines Dec 21, 2022
174f1c7
Revert adding new variations for now
tellthemachines Jan 2, 2023
510aa3f
Add preview panel to variation screen.
tellthemachines Jan 3, 2023
25048fe
ItemGroup UI
tellthemachines Jan 3, 2023
8dab200
Fix color screen bug
tellthemachines Jan 3, 2023
aac1e1b
Disable editing on default styles.
tellthemachines Jan 3, 2023
d8972ce
Fix variation showing on general block preview
tellthemachines Jan 5, 2023
967e319
Fix previews for design tools screens inside variations.
tellthemachines Jan 5, 2023
127305a
Address feedback.
tellthemachines Jan 6, 2023
513db1c
Remove default variation from panel.
tellthemachines Jan 6, 2023
a6b2d9c
Default style should always be called Default.
tellthemachines Jan 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test failures
  • Loading branch information
tellthemachines committed Jan 2, 2023
commit 822b800e0d17d66c3e097c28b00dded141a7d872
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ describe( 'global styles renderer', () => {
const imageBlock = { name: 'core/image', supports: imageSupports };
const blockTypes = [ imageBlock ];

expect( getBlockSelectors( blockTypes ) ).toEqual( {
expect( getBlockSelectors( blockTypes, () => {} ) ).toEqual( {
'core/image': {
name: imageBlock.name,
selector: imageSupports.__experimentalSelector,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -854,11 +854,13 @@ export const getBlockSelectors = ( blockTypes, getBlockStyles ) => {

const blockStyleVariations = getBlockStyles( name );
const styleVariationSelectors = {};
blockStyleVariations.forEach( ( variation ) => {
const styleVariationSelector = `.is-style-${ variation.name }${ selector }`;
styleVariationSelectors[ variation.name ] = styleVariationSelector;
} );

if ( blockStyleVariations?.length ) {
blockStyleVariations.forEach( ( variation ) => {
const styleVariationSelector = `.is-style-${ variation.name }${ selector }`;
styleVariationSelectors[ variation.name ] =
styleVariationSelector;
} );
}
// For each block support feature add any custom selectors.
const featureSelectors = {};
Object.entries( BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS ).forEach(
Expand Down
19 changes: 9 additions & 10 deletions schemas/json/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -1950,21 +1950,20 @@
"$ref": "#/definitions/stylesElementsPropertiesComplete"
},
"variations": {
"^[a-z-]*$": {
"border": {},
"color": {},
"spacing": {},
"typography": {},
"filter": {},
"shadow": {},
"outline": {},
"css": {}
}
"$ref": "#/definitions/stylesVariationPropertiesComplete"
}
},
"additionalProperties": false
}
]
},
"stylesVariationPropertiesComplete": {
"type": "object",
"patternProperties": {
"^[a-z][a-z0-9-]*$": {
"$ref": "#/definitions/stylesPropertiesComplete"
}
}
}
},
"type": "object",
Expand Down