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

Avoid nested classes #11

Merged

Conversation

miukimiu
Copy link

Summary

This PR tries to avoid nested classes like the following one in favor of a more JS approach.

euiTab: css`
  .euiTab__content {
    color: ${euiTheme.colors.text};

    &:hover {
      text-decoration: underline;
    }
  }

Comment on lines +89 to +98
const tabItems = React.Children.map(children, (child) => {
if (React.isValidElement(child)) {
return cloneElementWithCss(child, {
// we're passing the parent `size` and `expand` down to the children
size: size,
expand: expand,
...child.props,
});
}
});
Copy link
Author

Choose a reason for hiding this comment

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

Basically, I'm copying some props from the parent to the children because it makes it easier to apply the styles.

@miukimiu miukimiu mentioned this pull request Oct 19, 2022
38 tasks
@daveyholler daveyholler merged commit 18914f8 into daveyholler:emotional-tabs Oct 19, 2022
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.

2 participants