From 83f51f1663eaca401e0e020c0b5e3828da227cef Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Thu, 8 Dec 2022 22:05:20 +0900 Subject: [PATCH] Doc: Fix description and documentation for link color support --- .../block-api/block-supports.md | 31 ++++++------------- schemas/json/block.json | 2 +- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/docs/reference-guides/block-api/block-supports.md b/docs/reference-guides/block-api/block-supports.md index f3d15f118ae8fa..68afd793231eff 100644 --- a/docs/reference-guides/block-api/block-supports.md +++ b/docs/reference-guides/block-api/block-supports.md @@ -351,36 +351,25 @@ supports: { Link color presets are sourced from the `editor-color-palette` [theme support](/docs/how-to-guides/themes/theme-support.md#block-color-palettes). -When the block declares support for `color.link`, the attributes definition is extended to include two new attributes: `linkColor` and `style`: - -- `linkColor`: attribute of `string` type with no default assigned. - - When a user chooses from the list of preset link colors, the preset slug is stored in the `linkColor` attribute. - - The block can apply a default preset text color by specifying its own attribute with a default e.g.: - - ```js - attributes: { - linkColor: { - type: 'string', - default: 'some-preset-link-color-slug', - } - } - ``` +When the block declares support for `color.link`, the attributes definition is extended to include the `style` attribute: - `style`: attribute of `object` type with no default assigned. - When a custom link color is selected (i.e. using the custom color picker), the custom color value is stored in the `style.color.link` attribute. + When a link color is selected, the color value is stored in the `style.elements.link.color.text` attribute. - The block can apply a default custom link color by specifying its own attribute with a default e.g.: + The block can apply a default link color by specifying its own attribute with a default e.g.: ```js attributes: { style: { type: 'object', default: { - color: { - link: '#ff0000', + elements: { + link: { + color: { + text: '#ff0000', + } + } } } } @@ -583,7 +572,7 @@ attributes: { } ``` -A spacing property may define an array of allowable sides – 'top', 'right', 'bottom', 'left' – that can be configured. When such arbitrary sides are defined, only UI controls for those sides are displayed. +A spacing property may define an array of allowable sides – 'top', 'right', 'bottom', 'left' – that can be configured. When such arbitrary sides are defined, only UI controls for those sides are displayed. Axial sides are defined with the `vertical` and `horizontal` terms, and display a single UI control for each axial pair (for example, `vertical` controls both the top and bottom sides). A spacing property may support arbitrary individual sides **or** axial sides, but not a mix of both. diff --git a/schemas/json/block.json b/schemas/json/block.json index f23ef249577bd9..3a3726010d0b67 100644 --- a/schemas/json/block.json +++ b/schemas/json/block.json @@ -272,7 +272,7 @@ }, "link": { "type": "boolean", - "description": "This property adds block controls which allow the user to set link color in a block, link color is disabled by default.\n\nLink color presets are sourced from the editor-color-palette theme support.\n\nWhen the block declares support for color.link, the attributes definition is extended to include two new attributes: linkColor and style", + "description": "This property adds block controls which allow the user to set link color in a block, link color is disabled by default.\n\nLink color presets are sourced from the editor-color-palette theme support.\n\nWhen the block declares support for color.link, the attributes definition is extended to include the style attribute", "default": false }, "text": {