Skip to content
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

Global Styles Sidebar: Re-add Colors: Heading to selected blocks #49131

Merged
merged 14 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 2 additions & 0 deletions packages/block-editor/src/components/global-styles/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export const ROOT_BLOCK_SUPPORTS = [
'color',
'linkColor',
'buttonColor',
'headingColor',
'headingBackgroundColor',
carolinan marked this conversation as resolved.
Show resolved Hide resolved
'fontFamily',
'fontSize',
'fontStyle',
Expand Down
8 changes: 8 additions & 0 deletions packages/blocks/src/api/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ export const __EXPERIMENTAL_STYLE_PROPERTY = {
value: [ 'elements', 'button', 'color', 'background' ],
support: [ 'color', 'button' ],
},
headingColor: {
value: [ 'elements', 'heading', 'color', 'text' ],
support: [ 'color', 'heading' ],
},
headingBackgroundColor: {
value: [ 'elements', 'heading', 'color', 'background' ],
support: [ 'color', 'heading' ],
},
fontFamily: {
value: [ 'typography', 'fontFamily' ],
support: [ 'typography', '__experimentalFontFamily' ],
Expand Down
2 changes: 2 additions & 0 deletions packages/blocks/src/store/private-selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const ROOT_BLOCK_SUPPORTS = [
'color',
'linkColor',
'buttonColor',
'headingColor',
'headingBackgroundColor',
carolinan marked this conversation as resolved.
Show resolved Hide resolved
'fontFamily',
'fontSize',
'fontStyle',
Expand Down
6 changes: 6 additions & 0 deletions packages/blocks/src/store/test/private-selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ describe( 'private selectors', () => {
'color',
'linkColor',
'buttonColor',
'headingColor',
'headingBackgroundColor',
'fontFamily',
'fontSize',
'fontStyle',
Expand All @@ -52,6 +54,8 @@ describe( 'private selectors', () => {
'color',
'linkColor',
'buttonColor',
'headingColor',
'headingBackgroundColor',
'fontFamily',
'fontSize',
'fontStyle',
Expand All @@ -78,6 +82,8 @@ describe( 'private selectors', () => {
'color',
'linkColor',
'buttonColor',
'headingColor',
'headingBackgroundColor',
'fontFamily',
'fontStyle',
'fontWeight',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ function HeadingColorItem( { name, parentMenu, variation = '' } ) {
const prefix = variation ? `variations.${ variation }.` : '';
const urlPrefix = variation ? `/variations/${ variation }` : '';
const supports = useSupportedStyles( name );
const hasSupport = supports.includes( 'color' );
const hasSupport =
supports.includes( 'headingColor' ) ||
supports.includes( 'headingBackgroundColor' );
const [ color ] = useGlobalStyle(
prefix + 'elements.heading.color.text',
name
Expand Down