wordpress-develop/tests/phpunit/data/themedir1/block-theme/theme.json
Felix Arntz 2b931da110 Editor: Fix bug where it was not possible to style custom block elements in theme.json.
This changeset resolves a bug where WordPress would only allow HTML elements within core's own blocks to be styled in `theme.json`. Prior to this change, any `theme.json` rules applying to elements in custom blocks were ignored. With this fix it is now possible to style third-party block elements in `theme.json`.

Props flixos90, azaozz, costdev, glendaviesnz, spacedmonkey, oandregal.
Fixes #57868.


git-svn-id: https://develop.svn.wordpress.org/trunk@56254 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-18 00:00:49 +00:00

135 lines
2.2 KiB
JSON

{
"version": 1,
"title": "Block theme",
"settings": {
"color": {
"palette": [
{
"slug": "light",
"name": "Light",
"color": "#f5f7f9"
},
{
"slug": "dark",
"name": "Dark",
"color": "#000"
}
],
"gradients": [
{
"name": "Custom gradient",
"gradient": "linear-gradient(135deg,rgba(0,0,0) 0%,rgb(0,0,0) 100%)",
"slug": "custom-gradient"
}
],
"duotone": [
{
"colors": [ "#333333", "#aaaaaa" ],
"slug": "custom-duotone",
"name": "Custom Duotone"
}
],
"custom": false,
"customGradient": false
},
"typography": {
"fontSizes": [
{
"name": "Custom",
"slug": "custom",
"size": "100px"
}
],
"customFontSize": false,
"customLineHeight": true
},
"spacing": {
"units": ["rem"],
"customPadding": true,
"blockGap": true
},
"blocks": {
"core/paragraph": {
"color": {
"palette": [
{
"slug": "light",
"name": "Light",
"color": "#f5f7f9"
}
]
}
}
}
},
"styles" : {
"blocks" :{
"core/post-featured-image": {
"shadow": "10px 10px 5px 0px rgba(0,0,0,0.66)",
"filter": {
"duotone": "var(--wp--preset--duotone--custom-duotone)"
}
},
"my/third-party-block": {
"color": {
"background": "hotpink"
},
"elements": {
"cite": {
"color": {
"text": "white"
}
}
}
}
},
"elements": {
"button": {
"shadow": "10px 10px 5px 0px rgba(0,0,0,0.66)"
},
"link": {
"typography": {
"textDecoration": "none"
},
"border": {
"bottom": {
"width": "2px",
"color": "currentColor",
"style": "solid"
}
},
":hover": {
"typography": {
"textDecoration": "none"
},
"border": {
"bottom": {
"width": "2px",
"color": "#000",
"style": "dotted"
}
}
}
}
}
},
"customTemplates": [
{
"name": "page-home",
"title": "Homepage template"
},
{
"name": "custom-single-post-template",
"title": "Custom Single Post template",
"postTypes": ["post"]
}
],
"templateParts": [
{
"name": "small-header",
"title": "Small Header",
"area": "header"
}
]
}