@wordpress/edit-site 4.10.0 → 4.12.1-next.d6164808d3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/add-new-template/add-custom-template-modal.js +26 -44
- package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build/components/add-new-template/new-template.js +45 -23
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/utils.js +493 -242
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/block-editor/index.js +1 -3
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +26 -12
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/global-styles/border-panel.js +3 -3
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +280 -20
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +4 -4
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +1 -1
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +51 -7
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-heading-color.js +157 -0
- package/build/components/global-styles/screen-heading-color.js.map +1 -0
- package/build/components/global-styles/screen-typography-element.js +4 -0
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +5 -0
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +82 -14
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +217 -0
- package/build/components/global-styles/typography-utils.js.map +1 -0
- package/build/components/global-styles/ui.js +11 -0
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +183 -52
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +85 -5
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/header/document-actions/index.js +1 -0
- package/build/components/header/document-actions/index.js.map +1 -1
- package/build/components/header/index.js +27 -12
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js +0 -4
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +13 -3
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/undo-redo/redo.js +2 -1
- package/build/components/header/undo-redo/redo.js.map +1 -1
- package/build/components/list/actions/index.js +1 -1
- package/build/components/list/actions/index.js.map +1 -1
- package/build/components/save-button/index.js +2 -3
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/default-sidebar.js +11 -1
- package/build/components/sidebar/default-sidebar.js.map +1 -1
- package/build/components/sidebar/navigation-menu-sidebar/navigation-menu.js +2 -2
- package/build/components/sidebar/navigation-menu-sidebar/navigation-menu.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +11 -1
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar/template-card/template-actions.js +1 -1
- package/build/components/sidebar/template-card/template-actions.js.map +1 -1
- package/build/components/template-details/edit-template-title.js +1 -1
- package/build/components/template-details/edit-template-title.js.map +1 -1
- package/build/components/template-details/index.js +19 -9
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +1 -1
- package/build/components/template-details/template-areas.js.map +1 -1
- package/build/components/template-details/template-part-area-selector.js +47 -0
- package/build/components/template-details/template-part-area-selector.js.map +1 -0
- package/build/components/template-part-converter/convert-to-template-part.js +4 -1
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/hooks/index.js +2 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/template-part-edit.js +86 -0
- package/build/hooks/template-part-edit.js.map +1 -0
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js +27 -45
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +45 -25
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +489 -230
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/block-editor/index.js +1 -2
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +26 -12
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +3 -3
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +278 -22
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +4 -4
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +1 -1
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +51 -7
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-heading-color.js +143 -0
- package/build-module/components/global-styles/screen-heading-color.js.map +1 -0
- package/build-module/components/global-styles/screen-typography-element.js +4 -0
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +5 -0
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +83 -15
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +204 -0
- package/build-module/components/global-styles/typography-utils.js.map +1 -0
- package/build-module/components/global-styles/ui.js +10 -0
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +182 -61
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +82 -5
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/header/document-actions/index.js +1 -0
- package/build-module/components/header/document-actions/index.js.map +1 -1
- package/build-module/components/header/index.js +30 -14
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js +0 -4
- package/build-module/components/header/mode-switcher/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +13 -3
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/undo-redo/redo.js +3 -2
- package/build-module/components/header/undo-redo/redo.js.map +1 -1
- package/build-module/components/list/actions/index.js +1 -1
- package/build-module/components/list/actions/index.js.map +1 -1
- package/build-module/components/save-button/index.js +3 -4
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/default-sidebar.js +9 -1
- package/build-module/components/sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js +3 -3
- package/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +9 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/template-card/template-actions.js +1 -1
- package/build-module/components/sidebar/template-card/template-actions.js.map +1 -1
- package/build-module/components/template-details/edit-template-title.js +1 -1
- package/build-module/components/template-details/edit-template-title.js.map +1 -1
- package/build-module/components/template-details/index.js +19 -10
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +1 -1
- package/build-module/components/template-details/template-areas.js.map +1 -1
- package/build-module/components/template-details/template-part-area-selector.js +35 -0
- package/build-module/components/template-details/template-part-area-selector.js.map +1 -0
- package/build-module/components/template-part-converter/convert-to-template-part.js +3 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +67 -0
- package/build-module/hooks/template-part-edit.js.map +1 -0
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +40 -33
- package/build-style/style.css +40 -33
- package/package.json +29 -29
- package/src/components/add-new-template/add-custom-template-modal.js +39 -48
- package/src/components/add-new-template/new-template.js +50 -58
- package/src/components/add-new-template/style.scss +20 -8
- package/src/components/add-new-template/utils.js +529 -231
- package/src/components/block-editor/index.js +0 -2
- package/src/components/block-editor/resizable-editor.js +28 -18
- package/src/components/editor/style.scss +1 -0
- package/src/components/global-styles/border-panel.js +3 -3
- package/src/components/global-styles/dimensions-panel.js +344 -45
- package/src/components/global-styles/hooks.js +6 -3
- package/src/components/global-styles/screen-color-palette.js +1 -1
- package/src/components/global-styles/screen-colors.js +46 -4
- package/src/components/global-styles/screen-heading-color.js +201 -0
- package/src/components/global-styles/screen-typography-element.js +4 -0
- package/src/components/global-styles/screen-typography.js +6 -0
- package/src/components/global-styles/style.scss +14 -6
- package/src/components/global-styles/test/typography-utils.js +130 -0
- package/src/components/global-styles/test/use-global-styles-output.js +143 -4
- package/src/components/global-styles/test/utils.js +68 -8
- package/src/components/global-styles/typography-panel.js +119 -48
- package/src/components/global-styles/typography-utils.js +228 -0
- package/src/components/global-styles/ui.js +13 -0
- package/src/components/global-styles/use-global-styles-output.js +203 -53
- package/src/components/global-styles/utils.js +70 -4
- package/src/components/header/document-actions/index.js +3 -0
- package/src/components/header/index.js +41 -14
- package/src/components/header/mode-switcher/index.js +0 -3
- package/src/components/header/more-menu/index.js +7 -2
- package/src/components/header/style.scss +5 -3
- package/src/components/header/undo-redo/redo.js +6 -2
- package/src/components/list/actions/index.js +3 -1
- package/src/components/save-button/index.js +10 -13
- package/src/components/sidebar/default-sidebar.js +12 -0
- package/src/components/sidebar/navigation-menu-sidebar/navigation-menu.js +1 -5
- package/src/components/sidebar/plugin-sidebar/index.js +12 -0
- package/src/components/sidebar/style.scss +4 -0
- package/src/components/sidebar/template-card/template-actions.js +3 -1
- package/src/components/template-details/edit-template-title.js +7 -3
- package/src/components/template-details/index.js +23 -8
- package/src/components/template-details/style.scss +0 -5
- package/src/components/template-details/template-areas.js +3 -1
- package/src/components/template-details/template-part-area-selector.js +38 -0
- package/src/components/template-part-converter/convert-to-template-part.js +3 -1
- package/src/hooks/index.js +1 -0
- package/src/hooks/template-part-edit.js +82 -0
- package/src/index.js +1 -1
- package/src/style.scss +0 -1
- package/build/components/edit-template-part-menu-button/index.js +0 -90
- package/build/components/edit-template-part-menu-button/index.js.map +0 -1
- package/build-module/components/edit-template-part-menu-button/index.js +0 -72
- package/build-module/components/edit-template-part-menu-button/index.js.map +0 -1
- package/src/components/edit-template-part-menu-button/index.js +0 -82
|
@@ -45,7 +45,9 @@ function BackgroundColorItem( { name, parentMenu } ) {
|
|
|
45
45
|
data-testid="background-color-indicator"
|
|
46
46
|
/>
|
|
47
47
|
</ColorIndicatorWrapper>
|
|
48
|
-
<FlexItem
|
|
48
|
+
<FlexItem className="edit-site-global-styles__color-label">
|
|
49
|
+
{ __( 'Background' ) }
|
|
50
|
+
</FlexItem>
|
|
49
51
|
</HStack>
|
|
50
52
|
</NavigationButtonAsItem>
|
|
51
53
|
);
|
|
@@ -72,7 +74,9 @@ function TextColorItem( { name, parentMenu } ) {
|
|
|
72
74
|
data-testid="text-color-indicator"
|
|
73
75
|
/>
|
|
74
76
|
</ColorIndicatorWrapper>
|
|
75
|
-
<FlexItem
|
|
77
|
+
<FlexItem className="edit-site-global-styles__color-label">
|
|
78
|
+
{ __( 'Text' ) }
|
|
79
|
+
</FlexItem>
|
|
76
80
|
</HStack>
|
|
77
81
|
</NavigationButtonAsItem>
|
|
78
82
|
);
|
|
@@ -102,7 +106,39 @@ function LinkColorItem( { name, parentMenu } ) {
|
|
|
102
106
|
<ColorIndicator colorValue={ colorHover } />
|
|
103
107
|
</ColorIndicatorWrapper>
|
|
104
108
|
</ZStack>
|
|
105
|
-
<FlexItem
|
|
109
|
+
<FlexItem className="edit-site-global-styles__color-label">
|
|
110
|
+
{ __( 'Links' ) }
|
|
111
|
+
</FlexItem>
|
|
112
|
+
</HStack>
|
|
113
|
+
</NavigationButtonAsItem>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function HeadingColorItem( { name, parentMenu } ) {
|
|
118
|
+
const supports = getSupportedGlobalStylesPanels( name );
|
|
119
|
+
const hasSupport = supports.includes( 'color' );
|
|
120
|
+
const [ color ] = useStyle( 'elements.heading.color.text', name );
|
|
121
|
+
const [ bgColor ] = useStyle( 'elements.heading.color.background', name );
|
|
122
|
+
|
|
123
|
+
if ( ! hasSupport ) {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<NavigationButtonAsItem
|
|
129
|
+
path={ parentMenu + '/colors/heading' }
|
|
130
|
+
aria-label={ __( 'Colors heading styles' ) }
|
|
131
|
+
>
|
|
132
|
+
<HStack justify="flex-start">
|
|
133
|
+
<ZStack isLayered={ false } offset={ -8 }>
|
|
134
|
+
<ColorIndicatorWrapper expanded={ false }>
|
|
135
|
+
<ColorIndicator colorValue={ bgColor } />
|
|
136
|
+
</ColorIndicatorWrapper>
|
|
137
|
+
<ColorIndicatorWrapper expanded={ false }>
|
|
138
|
+
<ColorIndicator colorValue={ color } />
|
|
139
|
+
</ColorIndicatorWrapper>
|
|
140
|
+
</ZStack>
|
|
141
|
+
<FlexItem>{ __( 'Headings' ) }</FlexItem>
|
|
106
142
|
</HStack>
|
|
107
143
|
</NavigationButtonAsItem>
|
|
108
144
|
);
|
|
@@ -129,7 +165,9 @@ function ButtonColorItem( { name, parentMenu } ) {
|
|
|
129
165
|
<ColorIndicator colorValue={ color } />
|
|
130
166
|
</ColorIndicatorWrapper>
|
|
131
167
|
</ZStack>
|
|
132
|
-
<FlexItem
|
|
168
|
+
<FlexItem className="edit-site-global-styles__color-label">
|
|
169
|
+
{ __( 'Buttons' ) }
|
|
170
|
+
</FlexItem>
|
|
133
171
|
</HStack>
|
|
134
172
|
</NavigationButtonAsItem>
|
|
135
173
|
);
|
|
@@ -166,6 +204,10 @@ function ScreenColors( { name } ) {
|
|
|
166
204
|
name={ name }
|
|
167
205
|
parentMenu={ parentMenu }
|
|
168
206
|
/>
|
|
207
|
+
<HeadingColorItem
|
|
208
|
+
name={ name }
|
|
209
|
+
parentMenu={ parentMenu }
|
|
210
|
+
/>
|
|
169
211
|
<ButtonColorItem
|
|
170
212
|
name={ name }
|
|
171
213
|
parentMenu={ parentMenu }
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { sprintf, __ } from '@wordpress/i18n';
|
|
5
|
+
import {
|
|
6
|
+
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
7
|
+
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
8
|
+
} from '@wordpress/components';
|
|
9
|
+
import { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';
|
|
10
|
+
import { useState } from '@wordpress/element';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
import ScreenHeader from './header';
|
|
16
|
+
import {
|
|
17
|
+
getSupportedGlobalStylesPanels,
|
|
18
|
+
useSetting,
|
|
19
|
+
useStyle,
|
|
20
|
+
useColorsPerOrigin,
|
|
21
|
+
useGradientsPerOrigin,
|
|
22
|
+
} from './hooks';
|
|
23
|
+
|
|
24
|
+
function ScreenHeadingColor( { name } ) {
|
|
25
|
+
const [ selectedLevel, setCurrentTab ] = useState( 'heading' );
|
|
26
|
+
|
|
27
|
+
const supports = getSupportedGlobalStylesPanels( name );
|
|
28
|
+
const [ solids ] = useSetting( 'color.palette', name );
|
|
29
|
+
const [ gradients ] = useSetting( 'color.gradients', name );
|
|
30
|
+
const [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );
|
|
31
|
+
const [ areCustomGradientsEnabled ] = useSetting(
|
|
32
|
+
'color.customGradient',
|
|
33
|
+
name
|
|
34
|
+
);
|
|
35
|
+
const [ isTextEnabled ] = useSetting( 'color.text', name );
|
|
36
|
+
const [ isBackgroundEnabled ] = useSetting( 'color.background', name );
|
|
37
|
+
|
|
38
|
+
const colorsPerOrigin = useColorsPerOrigin( name );
|
|
39
|
+
const gradientsPerOrigin = useGradientsPerOrigin( name );
|
|
40
|
+
|
|
41
|
+
const hasTextColor =
|
|
42
|
+
supports.includes( 'color' ) &&
|
|
43
|
+
isTextEnabled &&
|
|
44
|
+
( solids.length > 0 || areCustomSolidsEnabled );
|
|
45
|
+
|
|
46
|
+
const hasBackgroundColor =
|
|
47
|
+
supports.includes( 'backgroundColor' ) &&
|
|
48
|
+
isBackgroundEnabled &&
|
|
49
|
+
( solids.length > 0 || areCustomSolidsEnabled );
|
|
50
|
+
const hasGradientColor =
|
|
51
|
+
supports.includes( 'background' ) &&
|
|
52
|
+
( gradients.length > 0 || areCustomGradientsEnabled );
|
|
53
|
+
|
|
54
|
+
const [ color, setColor ] = useStyle(
|
|
55
|
+
'elements.' + selectedLevel + '.color.text',
|
|
56
|
+
name
|
|
57
|
+
);
|
|
58
|
+
const [ userColor ] = useStyle(
|
|
59
|
+
'elements.' + selectedLevel + '.color.text',
|
|
60
|
+
name,
|
|
61
|
+
'user'
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const [ backgroundColor, setBackgroundColor ] = useStyle(
|
|
65
|
+
'elements.' + selectedLevel + '.color.background',
|
|
66
|
+
name
|
|
67
|
+
);
|
|
68
|
+
const [ userBackgroundColor ] = useStyle(
|
|
69
|
+
'elements.' + selectedLevel + '.color.background',
|
|
70
|
+
name,
|
|
71
|
+
'user'
|
|
72
|
+
);
|
|
73
|
+
const [ gradient, setGradient ] = useStyle(
|
|
74
|
+
'elements.' + selectedLevel + '.color.gradient',
|
|
75
|
+
name
|
|
76
|
+
);
|
|
77
|
+
const [ userGradient ] = useStyle(
|
|
78
|
+
'elements.' + selectedLevel + '.color.gradient',
|
|
79
|
+
name,
|
|
80
|
+
'user'
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
if ( ! hasTextColor && ! hasBackgroundColor && ! hasGradientColor ) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
let backgroundSettings = {};
|
|
88
|
+
if ( hasBackgroundColor ) {
|
|
89
|
+
backgroundSettings = {
|
|
90
|
+
colorValue: backgroundColor,
|
|
91
|
+
onColorChange: setBackgroundColor,
|
|
92
|
+
};
|
|
93
|
+
if ( backgroundColor ) {
|
|
94
|
+
backgroundSettings.clearable =
|
|
95
|
+
backgroundColor === userBackgroundColor;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
let gradientSettings = {};
|
|
100
|
+
if ( hasGradientColor ) {
|
|
101
|
+
gradientSettings = {
|
|
102
|
+
gradientValue: gradient,
|
|
103
|
+
onGradientChange: setGradient,
|
|
104
|
+
};
|
|
105
|
+
if ( gradient ) {
|
|
106
|
+
gradientSettings.clearable = gradient === userGradient;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const controlProps = {
|
|
111
|
+
...backgroundSettings,
|
|
112
|
+
...gradientSettings,
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<>
|
|
117
|
+
<ScreenHeader
|
|
118
|
+
title={ __( 'Headings' ) }
|
|
119
|
+
description={ __(
|
|
120
|
+
'Set the default color used for headings across the site.'
|
|
121
|
+
) }
|
|
122
|
+
/>
|
|
123
|
+
<div className="edit-site-global-styles-screen-heading-color">
|
|
124
|
+
<h4>{ __( 'Select heading level' ) }</h4>
|
|
125
|
+
|
|
126
|
+
<ToggleGroupControl
|
|
127
|
+
label={ __( 'Select heading level' ) }
|
|
128
|
+
hideLabelFromVision={ true }
|
|
129
|
+
value={ selectedLevel }
|
|
130
|
+
onChange={ setCurrentTab }
|
|
131
|
+
isBlock
|
|
132
|
+
>
|
|
133
|
+
<ToggleGroupControlOption
|
|
134
|
+
value="heading"
|
|
135
|
+
/* translators: 'All' refers to selecting all heading levels
|
|
136
|
+
and applying the same style to h1-h6. */
|
|
137
|
+
label={ __( 'All' ) }
|
|
138
|
+
/>
|
|
139
|
+
<ToggleGroupControlOption value="h1" label={ __( 'H1' ) } />
|
|
140
|
+
<ToggleGroupControlOption value="h2" label={ __( 'H2' ) } />
|
|
141
|
+
<ToggleGroupControlOption value="h3" label={ __( 'H3' ) } />
|
|
142
|
+
<ToggleGroupControlOption value="h4" label={ __( 'H4' ) } />
|
|
143
|
+
<ToggleGroupControlOption value="h5" label={ __( 'H5' ) } />
|
|
144
|
+
<ToggleGroupControlOption value="h6" label={ __( 'H6' ) } />
|
|
145
|
+
</ToggleGroupControl>
|
|
146
|
+
</div>
|
|
147
|
+
{ hasTextColor && (
|
|
148
|
+
<div className="edit-site-global-styles-screen-heading-color">
|
|
149
|
+
<h4>
|
|
150
|
+
{ selectedLevel === 'heading'
|
|
151
|
+
? __( 'Text color for all heading levels' )
|
|
152
|
+
: sprintf(
|
|
153
|
+
/* translators: %s: heading level (h1-h6) */
|
|
154
|
+
__( 'Text color for %s' ),
|
|
155
|
+
selectedLevel.toUpperCase()
|
|
156
|
+
) }
|
|
157
|
+
</h4>
|
|
158
|
+
<ColorGradientControl
|
|
159
|
+
className="edit-site-screen-heading-text-color__control"
|
|
160
|
+
colors={ colorsPerOrigin }
|
|
161
|
+
disableCustomColors={ ! areCustomSolidsEnabled }
|
|
162
|
+
__experimentalHasMultipleOrigins
|
|
163
|
+
showTitle={ false }
|
|
164
|
+
enableAlpha
|
|
165
|
+
__experimentalIsRenderedInSidebar
|
|
166
|
+
colorValue={ color }
|
|
167
|
+
onColorChange={ setColor }
|
|
168
|
+
clearable={ color === userColor }
|
|
169
|
+
/>
|
|
170
|
+
</div>
|
|
171
|
+
) }
|
|
172
|
+
{ hasBackgroundColor && (
|
|
173
|
+
<div className="edit-site-global-styles-screen-heading-color">
|
|
174
|
+
<h4>
|
|
175
|
+
{ selectedLevel === 'heading'
|
|
176
|
+
? __( 'Background color for all heading levels' )
|
|
177
|
+
: sprintf(
|
|
178
|
+
/* translators: %s: heading level (h1-h6) */
|
|
179
|
+
__( 'Background color for %s' ),
|
|
180
|
+
selectedLevel.toUpperCase()
|
|
181
|
+
) }
|
|
182
|
+
</h4>
|
|
183
|
+
<ColorGradientControl
|
|
184
|
+
className="edit-site-screen-heading-background-color__control"
|
|
185
|
+
colors={ colorsPerOrigin }
|
|
186
|
+
gradients={ gradientsPerOrigin }
|
|
187
|
+
disableCustomColors={ ! areCustomSolidsEnabled }
|
|
188
|
+
disableCustomGradients={ ! areCustomGradientsEnabled }
|
|
189
|
+
__experimentalHasMultipleOrigins
|
|
190
|
+
showTitle={ false }
|
|
191
|
+
enableAlpha
|
|
192
|
+
__experimentalIsRenderedInSidebar
|
|
193
|
+
{ ...controlProps }
|
|
194
|
+
/>
|
|
195
|
+
</div>
|
|
196
|
+
) }
|
|
197
|
+
</>
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export default ScreenHeadingColor;
|
|
@@ -18,6 +18,10 @@ const elements = {
|
|
|
18
18
|
description: __( 'Manage the fonts and typography used on the links.' ),
|
|
19
19
|
title: __( 'Links' ),
|
|
20
20
|
},
|
|
21
|
+
heading: {
|
|
22
|
+
description: __( 'Manage the fonts and typography used on headings.' ),
|
|
23
|
+
title: __( 'Headings' ),
|
|
24
|
+
},
|
|
21
25
|
button: {
|
|
22
26
|
description: __( 'Manage the fonts and typography used on buttons.' ),
|
|
23
27
|
title: __( 'Buttons' ),
|
|
@@ -104,6 +104,12 @@ function ScreenTypography( { name } ) {
|
|
|
104
104
|
element="link"
|
|
105
105
|
label={ __( 'Links' ) }
|
|
106
106
|
/>
|
|
107
|
+
<Item
|
|
108
|
+
name={ name }
|
|
109
|
+
parentMenu={ parentMenu }
|
|
110
|
+
element="heading"
|
|
111
|
+
label={ __( 'Headings' ) }
|
|
112
|
+
/>
|
|
107
113
|
<Item
|
|
108
114
|
name={ name }
|
|
109
115
|
parentMenu={ parentMenu }
|
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
border-radius: $radius-block-ui;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
.edit-site-typography-panel__full-width-control {
|
|
25
|
+
grid-column: 1 / -1;
|
|
26
|
+
max-width: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.edit-site-global-styles-screen-heading-color,
|
|
24
30
|
.edit-site-global-styles-screen-typography {
|
|
25
31
|
margin: $grid-unit-20;
|
|
26
32
|
}
|
|
@@ -41,6 +47,7 @@
|
|
|
41
47
|
.component-color-indicator {
|
|
42
48
|
// Show a diagonal line (crossed out) for empty swatches.
|
|
43
49
|
background: linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%);
|
|
50
|
+
flex-shrink: 0;
|
|
44
51
|
}
|
|
45
52
|
}
|
|
46
53
|
|
|
@@ -72,12 +79,6 @@
|
|
|
72
79
|
padding: $grid-unit-20;
|
|
73
80
|
}
|
|
74
81
|
|
|
75
|
-
.edit-site-screen-background-color__control {
|
|
76
|
-
.block-editor-color-gradient-control__tab-panel {
|
|
77
|
-
padding: $grid-unit-20;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
82
|
.edit-site-global-styles-variations_item {
|
|
82
83
|
box-sizing: border-box;
|
|
83
84
|
|
|
@@ -107,4 +108,11 @@
|
|
|
107
108
|
.edit-site-global-styles__color-indicator-wrapper {
|
|
108
109
|
// Match the height of the rest of the icons (24px).
|
|
109
110
|
height: $grid-unit * 3;
|
|
111
|
+
flex-shrink: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.edit-site-global-styles__color-label {
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
text-overflow: ellipsis;
|
|
110
118
|
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { getTypographyFontSizeValue } from '../typography-utils';
|
|
5
|
+
|
|
6
|
+
describe( 'typography utils', () => {
|
|
7
|
+
describe( 'getTypographyFontSizeValue', () => {
|
|
8
|
+
it( 'should return the expected values', () => {
|
|
9
|
+
[
|
|
10
|
+
// Default return non-fluid value.
|
|
11
|
+
{
|
|
12
|
+
preset: {
|
|
13
|
+
size: '28px',
|
|
14
|
+
},
|
|
15
|
+
typographySettings: undefined,
|
|
16
|
+
expected: '28px',
|
|
17
|
+
},
|
|
18
|
+
// Should return non-fluid value when fluid is `false`.
|
|
19
|
+
{
|
|
20
|
+
preset: {
|
|
21
|
+
size: '28px',
|
|
22
|
+
fluid: false,
|
|
23
|
+
},
|
|
24
|
+
typographySettings: {
|
|
25
|
+
fluid: true,
|
|
26
|
+
},
|
|
27
|
+
expected: '28px',
|
|
28
|
+
},
|
|
29
|
+
// Should return fluid value.
|
|
30
|
+
{
|
|
31
|
+
preset: {
|
|
32
|
+
size: '1.75rem',
|
|
33
|
+
},
|
|
34
|
+
typographySettings: {
|
|
35
|
+
fluid: true,
|
|
36
|
+
},
|
|
37
|
+
expected:
|
|
38
|
+
'clamp(1.3125rem, 1.3125rem + ((1vw - 0.48rem) * 2.524), 2.625rem)',
|
|
39
|
+
},
|
|
40
|
+
// Should return default fluid values with empty fluid array.
|
|
41
|
+
{
|
|
42
|
+
preset: {
|
|
43
|
+
size: '28px',
|
|
44
|
+
fluid: [],
|
|
45
|
+
},
|
|
46
|
+
typographySettings: {
|
|
47
|
+
fluid: true,
|
|
48
|
+
},
|
|
49
|
+
expected:
|
|
50
|
+
'clamp(21px, 1.3125rem + ((1vw - 7.68px) * 2.524), 42px)',
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
// Should return default fluid values with null values.
|
|
54
|
+
{
|
|
55
|
+
preset: {
|
|
56
|
+
size: '28px',
|
|
57
|
+
fluid: null,
|
|
58
|
+
},
|
|
59
|
+
typographySettings: {
|
|
60
|
+
fluid: true,
|
|
61
|
+
},
|
|
62
|
+
expected:
|
|
63
|
+
'clamp(21px, 1.3125rem + ((1vw - 7.68px) * 2.524), 42px)',
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
// Should return size with invalid fluid units.
|
|
67
|
+
{
|
|
68
|
+
preset: {
|
|
69
|
+
size: '10em',
|
|
70
|
+
fluid: {
|
|
71
|
+
min: '20vw',
|
|
72
|
+
max: '50%',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
typographySettings: {
|
|
76
|
+
fluid: true,
|
|
77
|
+
},
|
|
78
|
+
expected: '10em',
|
|
79
|
+
},
|
|
80
|
+
// Should return fluid clamp value.
|
|
81
|
+
{
|
|
82
|
+
preset: {
|
|
83
|
+
size: '28px',
|
|
84
|
+
fluid: {
|
|
85
|
+
min: '20px',
|
|
86
|
+
max: '50rem',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
typographySettings: {
|
|
90
|
+
fluid: true,
|
|
91
|
+
},
|
|
92
|
+
expected:
|
|
93
|
+
'clamp(20px, 1.25rem + ((1vw - 7.68px) * 93.75), 50rem)',
|
|
94
|
+
},
|
|
95
|
+
// Should return clamp value with default fluid max value.
|
|
96
|
+
{
|
|
97
|
+
preset: {
|
|
98
|
+
size: '28px',
|
|
99
|
+
fluid: {
|
|
100
|
+
min: '2.6rem',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
typographySettings: {
|
|
104
|
+
fluid: true,
|
|
105
|
+
},
|
|
106
|
+
expected:
|
|
107
|
+
'clamp(2.6rem, 2.6rem + ((1vw - 0.48rem) * 0.048), 42px)',
|
|
108
|
+
},
|
|
109
|
+
// Should return clamp value with default fluid min value.
|
|
110
|
+
{
|
|
111
|
+
preset: {
|
|
112
|
+
size: '28px',
|
|
113
|
+
fluid: {
|
|
114
|
+
max: '80px',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
typographySettings: {
|
|
118
|
+
fluid: true,
|
|
119
|
+
},
|
|
120
|
+
expected:
|
|
121
|
+
'clamp(21px, 1.3125rem + ((1vw - 7.68px) * 7.091), 80px)',
|
|
122
|
+
},
|
|
123
|
+
].forEach( ( { preset, typographySettings, expected } ) => {
|
|
124
|
+
expect(
|
|
125
|
+
getTypographyFontSizeValue( preset, typographySettings )
|
|
126
|
+
).toBe( expected );
|
|
127
|
+
} );
|
|
128
|
+
} );
|
|
129
|
+
} );
|
|
130
|
+
} );
|
|
@@ -10,8 +10,10 @@ import {
|
|
|
10
10
|
getLayoutStyles,
|
|
11
11
|
getNodesWithSettings,
|
|
12
12
|
getNodesWithStyles,
|
|
13
|
+
getBlockSelectors,
|
|
13
14
|
toCustomProperties,
|
|
14
15
|
toStyles,
|
|
16
|
+
getStylesDeclarations,
|
|
15
17
|
} from '../use-global-styles-output';
|
|
16
18
|
import { ROOT_BLOCK_SELECTOR } from '../utils';
|
|
17
19
|
|
|
@@ -57,6 +59,11 @@ describe( 'global styles renderer', () => {
|
|
|
57
59
|
},
|
|
58
60
|
},
|
|
59
61
|
},
|
|
62
|
+
'core/image': {
|
|
63
|
+
border: {
|
|
64
|
+
radius: '9999px',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
60
67
|
},
|
|
61
68
|
elements: {
|
|
62
69
|
link: {
|
|
@@ -84,6 +91,10 @@ describe( 'global styles renderer', () => {
|
|
|
84
91
|
'core/heading': {
|
|
85
92
|
selector: '.my-heading1, .my-heading2',
|
|
86
93
|
},
|
|
94
|
+
'core/image': {
|
|
95
|
+
selector: '.my-image',
|
|
96
|
+
featureSelectors: '.my-image img, .my-image .crop-area',
|
|
97
|
+
},
|
|
87
98
|
};
|
|
88
99
|
|
|
89
100
|
expect( getNodesWithStyles( tree, blockSelectors ) ).toEqual( [
|
|
@@ -159,6 +170,15 @@ describe( 'global styles renderer', () => {
|
|
|
159
170
|
},
|
|
160
171
|
selector: '.my-heading1 a, .my-heading2 a',
|
|
161
172
|
},
|
|
173
|
+
{
|
|
174
|
+
styles: {
|
|
175
|
+
border: {
|
|
176
|
+
radius: '9999px',
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
selector: '.my-image',
|
|
180
|
+
featureSelectors: '.my-image img, .my-image .crop-area',
|
|
181
|
+
},
|
|
162
182
|
] );
|
|
163
183
|
} );
|
|
164
184
|
} );
|
|
@@ -430,6 +450,14 @@ describe( 'global styles renderer', () => {
|
|
|
430
450
|
},
|
|
431
451
|
},
|
|
432
452
|
},
|
|
453
|
+
'core/image': {
|
|
454
|
+
color: {
|
|
455
|
+
text: 'red',
|
|
456
|
+
},
|
|
457
|
+
border: {
|
|
458
|
+
radius: '9999px',
|
|
459
|
+
},
|
|
460
|
+
},
|
|
433
461
|
},
|
|
434
462
|
},
|
|
435
463
|
};
|
|
@@ -441,15 +469,34 @@ describe( 'global styles renderer', () => {
|
|
|
441
469
|
'core/heading': {
|
|
442
470
|
selector: 'h1,h2,h3,h4,h5,h6',
|
|
443
471
|
},
|
|
472
|
+
'core/image': {
|
|
473
|
+
selector: '.wp-block-image',
|
|
474
|
+
featureSelectors: {
|
|
475
|
+
border: '.wp-block-image img, .wp-block-image .wp-crop-area',
|
|
476
|
+
},
|
|
477
|
+
},
|
|
444
478
|
};
|
|
445
479
|
|
|
446
480
|
expect( toStyles( tree, blockSelectors ) ).toEqual(
|
|
447
481
|
'body {margin: 0;}' +
|
|
448
|
-
'body{background-color: red;margin: 10px;padding: 10px;}
|
|
449
|
-
'.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }' +
|
|
482
|
+
'body{background-color: red;margin: 10px;padding: 10px;}a{color: blue;}a:hover{color: orange;}a:focus{color: orange;}h1{font-size: 42px;}.wp-block-group{margin-top: 10px;margin-right: 20px;margin-bottom: 30px;margin-left: 40px;padding-top: 11px;padding-right: 22px;padding-bottom: 33px;padding-left: 44px;}h1,h2,h3,h4,h5,h6{color: orange;}h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{color: hotpink;}h1 a:hover,h2 a:hover,h3 a:hover,h4 a:hover,h5 a:hover,h6 a:hover{color: red;}h1 a:focus,h2 a:focus,h3 a:focus,h4 a:focus,h5 a:focus,h6 a:focus{color: red;}' +
|
|
483
|
+
'.wp-block-image img, .wp-block-image .wp-crop-area{border-radius: 9999px }.wp-block-image{color: red;}.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }' +
|
|
450
484
|
'.has-white-color{color: var(--wp--preset--color--white) !important;}.has-white-background-color{background-color: var(--wp--preset--color--white) !important;}.has-white-border-color{border-color: var(--wp--preset--color--white) !important;}.has-black-color{color: var(--wp--preset--color--black) !important;}.has-black-background-color{background-color: var(--wp--preset--color--black) !important;}.has-black-border-color{border-color: var(--wp--preset--color--black) !important;}h1.has-blue-color,h2.has-blue-color,h3.has-blue-color,h4.has-blue-color,h5.has-blue-color,h6.has-blue-color{color: var(--wp--preset--color--blue) !important;}h1.has-blue-background-color,h2.has-blue-background-color,h3.has-blue-background-color,h4.has-blue-background-color,h5.has-blue-background-color,h6.has-blue-background-color{background-color: var(--wp--preset--color--blue) !important;}h1.has-blue-border-color,h2.has-blue-border-color,h3.has-blue-border-color,h4.has-blue-border-color,h5.has-blue-border-color,h6.has-blue-border-color{border-color: var(--wp--preset--color--blue) !important;}'
|
|
451
485
|
);
|
|
452
486
|
} );
|
|
487
|
+
it( 'should output content and wide size variables if values are specified', () => {
|
|
488
|
+
const tree = {
|
|
489
|
+
settings: {
|
|
490
|
+
layout: {
|
|
491
|
+
contentSize: '840px',
|
|
492
|
+
wideSize: '1100px',
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
};
|
|
496
|
+
expect( toStyles( tree, 'body' ) ).toEqual(
|
|
497
|
+
'body {margin: 0; --wp--style--global--content-size: 840px; --wp--style--global--wide-size: 1100px;}.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }'
|
|
498
|
+
);
|
|
499
|
+
} );
|
|
453
500
|
} );
|
|
454
501
|
|
|
455
502
|
describe( 'getLayoutStyles', () => {
|
|
@@ -549,7 +596,7 @@ describe( 'global styles renderer', () => {
|
|
|
549
596
|
} );
|
|
550
597
|
|
|
551
598
|
expect( layoutStyles ).toEqual(
|
|
552
|
-
'
|
|
599
|
+
':where(.is-layout-flex) { gap: 0.5em; }body .is-layout-flow > .alignleft { float: left; margin-inline-start: 0; margin-inline-end: 2em; }body .is-layout-flow > .alignright { float: right; margin-inline-start: 2em; margin-inline-end: 0; }body .is-layout-flow > .aligncenter { margin-left: auto !important; margin-right: auto !important; }body .is-layout-flex { display:flex; }body .is-layout-flex { flex-wrap: wrap; align-items: center; }body .is-layout-flex > * { margin: 0; }'
|
|
553
600
|
);
|
|
554
601
|
} );
|
|
555
602
|
|
|
@@ -614,8 +661,100 @@ describe( 'global styles renderer', () => {
|
|
|
614
661
|
} );
|
|
615
662
|
|
|
616
663
|
expect( layoutStyles ).toEqual(
|
|
617
|
-
'.wp-block-group.is-layout-flex { gap: 2em; }'
|
|
664
|
+
':where(.wp-block-group.is-layout-flex) { gap: 2em; }'
|
|
618
665
|
);
|
|
619
666
|
} );
|
|
620
667
|
} );
|
|
668
|
+
|
|
669
|
+
describe( 'getBlockSelectors', () => {
|
|
670
|
+
it( 'should return block selectors data', () => {
|
|
671
|
+
const imageSupports = {
|
|
672
|
+
__experimentalBorder: {
|
|
673
|
+
radius: true,
|
|
674
|
+
__experimentalSelector: 'img, .crop-area',
|
|
675
|
+
},
|
|
676
|
+
color: {
|
|
677
|
+
__experimentalDuotone: 'img',
|
|
678
|
+
},
|
|
679
|
+
__experimentalSelector: '.my-image',
|
|
680
|
+
};
|
|
681
|
+
const imageBlock = { name: 'core/image', supports: imageSupports };
|
|
682
|
+
const blockTypes = [ imageBlock ];
|
|
683
|
+
|
|
684
|
+
expect( getBlockSelectors( blockTypes ) ).toEqual( {
|
|
685
|
+
'core/image': {
|
|
686
|
+
name: imageBlock.name,
|
|
687
|
+
selector: imageSupports.__experimentalSelector,
|
|
688
|
+
duotoneSelector: imageSupports.color.__experimentalDuotone,
|
|
689
|
+
fallbackGapValue: undefined,
|
|
690
|
+
featureSelectors: {
|
|
691
|
+
border: '.my-image img, .my-image .crop-area',
|
|
692
|
+
},
|
|
693
|
+
hasLayoutSupport: false,
|
|
694
|
+
},
|
|
695
|
+
} );
|
|
696
|
+
} );
|
|
697
|
+
} );
|
|
698
|
+
|
|
699
|
+
describe( 'getStylesDeclarations', () => {
|
|
700
|
+
const blockStyles = {
|
|
701
|
+
spacing: {
|
|
702
|
+
padding: {
|
|
703
|
+
top: '33px',
|
|
704
|
+
right: '33px',
|
|
705
|
+
bottom: '33px',
|
|
706
|
+
left: '33px',
|
|
707
|
+
},
|
|
708
|
+
},
|
|
709
|
+
color: {
|
|
710
|
+
background: 'var:preset|color|light-green-cyan',
|
|
711
|
+
},
|
|
712
|
+
typography: {
|
|
713
|
+
fontFamily: 'sans-serif',
|
|
714
|
+
},
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
it( 'Should output padding variables and other properties if useRootPaddingAwareAlignments is enabled', () => {
|
|
718
|
+
expect(
|
|
719
|
+
getStylesDeclarations( blockStyles, 'body', true )
|
|
720
|
+
).toEqual( [
|
|
721
|
+
'--wp--style--root--padding-top: 33px',
|
|
722
|
+
'--wp--style--root--padding-right: 33px',
|
|
723
|
+
'--wp--style--root--padding-bottom: 33px',
|
|
724
|
+
'--wp--style--root--padding-left: 33px',
|
|
725
|
+
'background-color: var(--wp--preset--color--light-green-cyan)',
|
|
726
|
+
'font-family: sans-serif',
|
|
727
|
+
] );
|
|
728
|
+
} );
|
|
729
|
+
|
|
730
|
+
it( 'Should output padding and other properties if useRootPaddingAwareAlignments is disabled', () => {
|
|
731
|
+
expect(
|
|
732
|
+
getStylesDeclarations( blockStyles, 'body', false )
|
|
733
|
+
).toEqual( [
|
|
734
|
+
'background-color: var(--wp--preset--color--light-green-cyan)',
|
|
735
|
+
'padding-top: 33px',
|
|
736
|
+
'padding-right: 33px',
|
|
737
|
+
'padding-bottom: 33px',
|
|
738
|
+
'padding-left: 33px',
|
|
739
|
+
'font-family: sans-serif',
|
|
740
|
+
] );
|
|
741
|
+
} );
|
|
742
|
+
|
|
743
|
+
it( 'Should not output padding variables if selector is not root', () => {
|
|
744
|
+
expect(
|
|
745
|
+
getStylesDeclarations(
|
|
746
|
+
blockStyles,
|
|
747
|
+
'.wp-block-button__link',
|
|
748
|
+
true
|
|
749
|
+
)
|
|
750
|
+
).toEqual( [
|
|
751
|
+
'background-color: var(--wp--preset--color--light-green-cyan)',
|
|
752
|
+
'padding-top: 33px',
|
|
753
|
+
'padding-right: 33px',
|
|
754
|
+
'padding-bottom: 33px',
|
|
755
|
+
'padding-left: 33px',
|
|
756
|
+
'font-family: sans-serif',
|
|
757
|
+
] );
|
|
758
|
+
} );
|
|
759
|
+
} );
|
|
621
760
|
} );
|