Skip to content

[CSS-in-JS] Add css to common props#6118

Merged
thompsongl merged 5 commits intoelastic:mainfrom
thompsongl:common-ts-css
Aug 11, 2022
Merged

[CSS-in-JS] Add css to common props#6118
thompsongl merged 5 commits intoelastic:mainfrom
thompsongl:common-ts-css

Conversation

@thompsongl
Copy link
Copy Markdown
Contributor

@thompsongl thompsongl commented Aug 9, 2022

Summary

Added css prop to CommonProps interface. All components using the CommonProps interface can be styled with Emotion, but the babel plugin does not sufficiently cover cases like componentProps props that are not created with JSX. Extending CommonProps allows for broader support.

Checklist

  • Checked for breaking changes and labeled appropriately
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_6118/

@thompsongl thompsongl marked this pull request as ready for review August 11, 2022 14:25
@thompsongl thompsongl requested a review from cee-chen August 11, 2022 14:25
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_6118/

onClick,
headerZindexLocation = 'above',
maskRef,
css,
Copy link
Copy Markdown
Contributor

@cee-chen cee-chen Aug 11, 2022

Choose a reason for hiding this comment

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

I'm a little confused about this change - shouldn't we accept custom css on the overlay mask?

edit: if this change is just to pass type issues and we're planning on addressing this in the EuiOverlayMask Emotion conversion, no worries, but we should definitely add a // TODO: apply custom CSS-in-JS as a className comment of some kind to this line to ensure css doesn't just get stripped

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I'm working on styling ideas in #6090, and any method that would allow for Emotion styling will come from there. I'll add a comment, because the css prop on EuiOverlayMask wouldn't have any effect currently anyway.

@thompsongl thompsongl requested a review from cee-chen August 11, 2022 18:59
Copy link
Copy Markdown
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

🎉

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_6118/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants