Skip to content

Commit

Permalink
Move fontSize and lineHeight properties to typography object (#1898)
Browse files Browse the repository at this point in the history
* Move lineHeight and fontSize into typography object as per changes in WordPress 5.8.

* Add back original placement and add deprecated notice to the descriptions.

* Add block.json entry to schema-validation.json

* Fix posiition and remove schema-validation. json entry.
  • Loading branch information
ryanwelcher authored Oct 28, 2021
1 parent 577039b commit af6ff36
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/schemas/json/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
},
"fontSize": {
"type": "boolean",
"description": "This value signals that a block supports the font-size CSS style property. When it does, the block editor will show an UI control for the user to set its value.\n\nThe values shown in this control are the ones declared by the theme via the editor-font-sizes theme support, or the default ones if none is provided.\n\nWhen the block declares support for fontSize, the attributes definition is extended to include two new attributes: fontSize and style",
"description": "Deprecated. As of WordPress 5.8, fontSize should appear in the supports.typography object.",
"default": false
},
"html": {
Expand All @@ -259,7 +259,7 @@
},
"lineHeight": {
"type": "boolean",
"description": "This value signals that a block supports the line-height CSS style property. When it does, the block editor will show an UI control for the user to set its value if the theme declares support.\n\nWhen the block declares support for lineHeight, the attributes definition is extended to include a new attribute style of object type with no default assigned. It stores the custom value set by the user. The block can apply a default style by specifying its own style attribute with a default",
"description": "Deprecated. As of WordPress 5.8, lineHeight should appear in the supports.typography object.",
"default": false
},
"multiple": {
Expand Down Expand Up @@ -335,6 +335,22 @@
]
}
}
},
"typography":{
"type":"object",
"description": "This value signals that a block supports some of the CSS style properties related to typography. When it does, the block editor will show UI controls for the user to set their values",
"properties": {
"fontSize": {
"type": "boolean",
"description": "This value signals that a block supports the font-size CSS style property. When it does, the block editor will show an UI control for the user to set its value.\n\nThe values shown in this control are the ones declared by the theme via the editor-font-sizes theme support, or the default ones if none is provided.\n\nWhen the block declares support for fontSize, the attributes definition is extended to include two new attributes: fontSize and style",
"default": false
},
"lineHeight": {
"type": "boolean",
"description": "This value signals that a block supports the line-height CSS style property. When it does, the block editor will show an UI control for the user to set its value if the theme declares support.\n\nWhen the block declares support for lineHeight, the attributes definition is extended to include a new attribute style of object type with no default assigned. It stores the custom value set by the user. The block can apply a default style by specifying its own style attribute with a default",
"default": false
}
}
}
},
"additionalProperties": true
Expand Down

0 comments on commit af6ff36

Please sign in to comment.