Skip to content

Commit 6ec5a29

Browse files
t-hamanomichalczaplinski
authored andcommitted
Theme.json: fix some outline properties doesn't work properly on the editor (#44504)
1 parent 09b46dd commit 6ec5a29

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

packages/edit-site/src/components/global-styles/use-global-styles-output.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,14 @@ export const getNodesWithStyles = ( tree, blockSelectors ) => {
434434

435435
const pickStyleKeys = ( treeToPickFrom ) =>
436436
pickBy( treeToPickFrom, ( value, key ) =>
437-
[ 'border', 'color', 'spacing', 'typography', 'filter' ].includes(
438-
key
439-
)
437+
[
438+
'border',
439+
'color',
440+
'spacing',
441+
'typography',
442+
'filter',
443+
'outline',
444+
].includes( key )
440445
);
441446

442447
// Top-level.
@@ -605,12 +610,12 @@ export const toStyles = (
605610
}
606611

607612
if ( useRootPaddingAlign ) {
608-
ruleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }
609-
.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }
610-
.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; }
611-
.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }
612-
.has-global-padding :where(.has-global-padding) > .alignfull { margin-right: 0; margin-left: 0; }
613-
.has-global-padding > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }
613+
ruleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }
614+
.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }
615+
.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; }
616+
.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }
617+
.has-global-padding :where(.has-global-padding) > .alignfull { margin-right: 0; margin-left: 0; }
618+
.has-global-padding > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }
614619
.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;`;
615620
}
616621

packages/style-engine/src/styles/outline/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const offset = {
2222
style: Style,
2323
options: StyleOptions,
2424
path: string[] = [ 'outline', 'offset' ],
25-
ruleKey: string = 'outlineColor'
25+
ruleKey: string = 'outlineOffset'
2626
): GeneratedCSSRule[] => {
2727
return generateRule( style, options, path, ruleKey );
2828
},

0 commit comments

Comments
 (0)