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

theme.json schema: Don't allow css property except at the root and block level #53156

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,6 @@ Outline styles.
| style | string, object | |
| width | string, object | |

---

### css

Sets custom CSS to apply styling not covered by other theme.json properties.


Comment on lines -319 to -325
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the schema is strictly defined, the css property will unfortunately be removed from the document. It may be possible to revive this description by slightly forcing the docs:theme-ref logic to be adjusted.

However, now that css properties are only allowed in certain hierarchies, I personally think it is acceptable. If in the future, css properties will be available everywhere related to style, I think it would be fine to add them at that time.

---
## customTemplates

Expand Down
18 changes: 9 additions & 9 deletions schemas/json/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -1811,10 +1811,6 @@
}
},
"additionalProperties": false
},
"css": {
"description": "Sets custom CSS to apply styling not covered by other theme.json properties.",
"type": "string"
}
}
},
Expand All @@ -1833,8 +1829,7 @@
"typography": {},
"filter": {},
"shadow": {},
"outline": {},
"css": {}
"outline": {}
},
"additionalProperties": false
}
Expand All @@ -1858,7 +1853,6 @@
"outline": {},
"spacing": {},
"typography": {},
"css": {},
":hover": {
"$ref": "#/definitions/stylesPropertiesComplete"
},
Expand Down Expand Up @@ -2268,7 +2262,10 @@
"filter": {},
"shadow": {},
"outline": {},
"css": {},
"css": {
"description": "Sets custom CSS to apply styling not covered by other theme.json properties.",
"type": "string"
},
"elements": {
"$ref": "#/definitions/stylesElementsPropertiesComplete"
},
Expand Down Expand Up @@ -2357,7 +2354,10 @@
"filter": {},
"shadow": {},
"outline": {},
"css": {},
"css": {
"description": "Sets custom CSS to apply styling not covered by other theme.json properties.",
"type": "string"
},
"elements": {
"description": "Styles defined on a per-element basis using the element's selector.",
"$ref": "#/definitions/stylesElementsPropertiesComplete"
Expand Down
Loading