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

Styling web components #629

Closed
samdenty opened this issue Apr 15, 2018 · 1 comment
Closed

Styling web components #629

samdenty opened this issue Apr 15, 2018 · 1 comment

Comments

@samdenty
Copy link

  • emotion version: 9.1.1
  • react version: 16.3.0

Relevant code.

const WebComponent = styled('web-component')`
  color: red
`

Problem description:

React supports rendering custom DOM elements as long as they have a hyphen in the tag name. React completely ignores props on these components, including the className prop.

As a result, the prop is converted into a literal attribute in the DOM (and className is an invalid attribute).

Suggested solution:

If the passed tagName is a string, and it contains a hyphen - react-emotion should instead pass down a class prop, allowing Web Components to be styled.

@stale
Copy link

stale bot commented Aug 7, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 7, 2018
@stale stale bot closed this as completed Aug 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants