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

[Grid] Migrate to emotion #24395

Merged
merged 24 commits into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion docs/pages/api-docs/grid.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,5 @@
"filename": "/packages/material-ui/src/Grid/Grid.js",
"inheritance": null,
"demos": "<ul><li><a href=\"/components/grid/\">Grid</a></li></ul>",
"styledComponent": false
"styledComponent": true
}
9 changes: 8 additions & 1 deletion docs/scripts/buildApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,15 @@ async function updateStylesDefinition(context: {
if (members) {
styles.descriptions = styles.descriptions || {};
members.forEach((member) => {
const className = ((member as babel.types.TSPropertySignature)
let className = ((member as babel.types.TSPropertySignature)
.key as babel.types.Identifier).name;

if(!className) {
Copy link
Member Author

Choose a reason for hiding this comment

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

We need this change in order to support classess that are in kebab-case like grid-xs-auto for example

// Necessary for classes defined as kebab case
className = ((member as babel.types.TSPropertySignature)
.key as babel.types.StringLiteral).value;
}

styles.classes.push(className);
if (member.leadingComments) {
styles.descriptions[className] = trimComment(member.leadingComments[0].value);
Expand Down
Loading