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

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

Merged
merged 5 commits into from
Aug 11, 2022
Merged

Conversation

thompsongl
Copy link
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

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

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

@@ -58,6 +58,7 @@ export const EuiOverlayMask: FunctionComponent<EuiOverlayMaskProps> = ({
onClick,
headerZindexLocation = 'above',
maskRef,
css,
Copy link
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
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
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

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