Skip to content

Commit

Permalink
Global Styles Sidebar: Re-add Colors: Heading to selected blocks (#49131
Browse files Browse the repository at this point in the history
)

* Add heading color block support

* Try to update the test file

* try to resolve conflicts

* Add heading color block support

* Limit the Heading color option to blocks that support Heading color

* another attempt to fix conflicts

* Fix typo
  • Loading branch information
carolinan authored Jun 30, 2023
1 parent 099ea67 commit d9ee487
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 8 deletions.
14 changes: 7 additions & 7 deletions docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ A single column within a columns block. ([Source](https://github.com/WordPress/g
- **Name:** core/column
- **Category:** design
- **Parent:** core/columns
- **Supports:** anchor, color (background, gradients, link, text), layout, spacing (blockGap, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Supports:** anchor, color (background, gradients, heading, link, text), layout, spacing (blockGap, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:** allowedBlocks, templateLock, verticalAlignment, width

## Columns
Expand Down Expand Up @@ -181,7 +181,7 @@ An advanced block that allows displaying post comments using different visual co

- **Name:** core/comments
- **Category:** theme
- **Supports:** align (full, wide), color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Supports:** align (full, wide), color (background, gradients, heading, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** legacy, tagName

## Comments Pagination
Expand Down Expand Up @@ -239,7 +239,7 @@ Add an image or video with a text overlay. ([Source](https://github.com/WordPres

- **Name:** core/cover
- **Category:** media
- **Supports:** align, anchor, color (text, ~~background~~), layout (~~allowJustification~~), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Supports:** align, anchor, color (heading, text, ~~background~~), layout (~~allowJustification~~), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** allowedBlocks, alt, backgroundType, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, gradient, hasParallax, id, isDark, isRepeated, minHeight, minHeightUnit, overlayColor, tagName, templateLock, url, useFeaturedImage

## Details
Expand Down Expand Up @@ -302,7 +302,7 @@ Gather blocks in a layout container. ([Source](https://github.com/WordPress/gute

- **Name:** core/group
- **Category:** design
- **Supports:** align (full, wide), anchor, ariaLabel, color (background, gradients, link, text), dimensions (minHeight), layout (allowSizingOnChildren), position (sticky), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Supports:** align (full, wide), anchor, ariaLabel, color (background, gradients, heading, link, text), dimensions (minHeight), layout (allowSizingOnChildren), position (sticky), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** allowedBlocks, tagName, templateLock

## Heading
Expand Down Expand Up @@ -394,7 +394,7 @@ Set media and words side-by-side for a richer layout. ([Source](https://github.c

- **Name:** core/media-text
- **Category:** media
- **Supports:** align (full, wide), anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Supports:** align (full, wide), anchor, color (background, gradients, heading, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** align, allowedBlocks, focalPoint, href, imageFill, isStackedOnMobile, linkClass, linkDestination, linkTarget, mediaAlt, mediaId, mediaLink, mediaPosition, mediaSizeSlug, mediaType, mediaUrl, mediaWidth, rel, verticalAlignment

## Unsupported
Expand Down Expand Up @@ -544,7 +544,7 @@ Display a post's comments form. ([Source](https://github.com/WordPress/gutenberg

- **Name:** core/post-comments-form
- **Category:** theme
- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Supports:** color (background, gradients, heading, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** textAlign

## Post Comments Link
Expand Down Expand Up @@ -732,7 +732,7 @@ Give quoted text visual emphasis. "In quoting others, we cite ourselves." — Ju

- **Name:** core/quote
- **Category:** text
- **Supports:** anchor, color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~
- **Supports:** anchor, color (background, gradients, heading, link, text), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** align, citation, value

## Read More
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function useHasColorPanel( settings ) {
const hasBackgroundPanel = useHasBackgroundPanel( settings );
const hasLinkPanel = useHasLinkPanel( settings );
const hasHeadingPanel = useHasHeadingPanel( settings );
const hasButtonPanel = useHasHeadingPanel( settings );
const hasButtonPanel = useHasButtonPanel( settings );
const hasCaptionPanel = useHasCaptionPanel( settings );

return (
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/column/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"html": false,
"color": {
"gradients": true,
"heading": true,
"link": true,
"__experimentalDefaultControls": {
"background": true,
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/comments/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"html": false,
"color": {
"gradients": true,
"heading": true,
"link": true,
"__experimentalDefaultControls": {
"background": true,
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/cover/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
},
"color": {
"__experimentalDuotone": "> .wp-block-cover__image-background, > .wp-block-cover__video-background",
"heading": true,
"text": true,
"background": false,
"__experimentalSkipSerialization": [ "gradients" ]
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/group/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"html": false,
"color": {
"gradients": true,
"heading": true,
"link": true,
"__experimentalDefaultControls": {
"background": true,
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/media-text/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"html": false,
"color": {
"gradients": true,
"heading": true,
"link": true,
"__experimentalDefaultControls": {
"background": true,
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/post-comments-form/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"html": false,
"color": {
"gradients": true,
"heading": true,
"link": true,
"__experimentalDefaultControls": {
"background": true,
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/quote/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
},
"color": {
"gradients": true,
"heading": true,
"link": true,
"__experimentalDefaultControls": {
"background": true,
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 @@ -148,6 +148,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

0 comments on commit d9ee487

Please sign in to comment.