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: Allow object type on style properties #45897

Merged
merged 13 commits into from
Dec 20, 2022
40 changes: 20 additions & 20 deletions docs/reference-guides/theme-json-reference/theme-json-living.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ Border styles.

| Property | Type | Props |
| --- | --- |--- |
| color | string | |
| color | undefined | |
Copy link
Member Author

Choose a reason for hiding this comment

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

These undefined types are the result of running npm run docs:build. It looks like these changes need to match the result of this script when run on GitHub, so I've pushed these changes for now. However, this should probably be improved, as undefined isn't that helpful.

I'll spin up a follow-up PR if I figure this out!

Copy link
Contributor

Choose a reason for hiding this comment

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

There isn't anything special going on with the docgen—just reading in the json file and formatting a few things as markdown. So it shouldn't be too hard to update the docgen to aggregate the types in the oneOf list which would also fix the radius property.

Eventually it would be nice to generate the schema from a higher-level source that is more suited for docgen. There's a discussion open about that, but I'd like to see the quick fix before tackling the larger problem.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @ajlende, that's super helpful context!

Copy link
Member Author

Choose a reason for hiding this comment

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

Created a PR for this here: #46375

| radius | undefined | |
| style | string | |
| width | string | |
| style | undefined | |
| width | undefined | |
| top | object | color, style, width |
| right | object | color, style, width |
| bottom | object | color, style, width |
Expand All @@ -162,9 +162,9 @@ Color styles.

| Property | Type | Props |
| --- | --- |--- |
| background | string | |
| gradient | string | |
| text | string | |
| background | undefined | |
| gradient | undefined | |
| text | undefined | |

---

Expand All @@ -174,7 +174,7 @@ Spacing styles.

| Property | Type | Props |
| --- | --- |--- |
| blockGap | string | |
| blockGap | undefined | |
| margin | object | bottom, left, right, top |
| padding | object | bottom, left, right, top |

Expand All @@ -186,14 +186,14 @@ Typography styles.

| Property | Type | Props |
| --- | --- |--- |
| fontFamily | string | |
| fontSize | string | |
| fontStyle | string | |
| fontWeight | string | |
| letterSpacing | string | |
| lineHeight | string | |
| textDecoration | string | |
| textTransform | string | |
| fontFamily | undefined | |
| fontSize | undefined | |
| fontStyle | undefined | |
| fontWeight | undefined | |
| letterSpacing | undefined | |
| lineHeight | undefined | |
| textDecoration | undefined | |
| textTransform | undefined | |

---

Expand All @@ -203,7 +203,7 @@ CSS and SVG filter styles.

| Property | Type | Props |
| --- | --- |--- |
| duotone | string | |
| duotone | undefined | |

---

Expand All @@ -220,10 +220,10 @@ Outline styles.

| Property | Type | Props |
| --- | --- |--- |
| color | string | |
| offset | string | |
| style | string | |
| width | string | |
| color | undefined | |
| offset | undefined | |
| style | undefined | |
| width | undefined | |

---

Expand Down
Loading