linaria
linaria copied to clipboard
Styling any component
Describe the enhancement
It would be great to be able to style any component, as implemented in styled-components https://styled-components.com/docs/basics#styling-any-component
Motivation
Possible implementations
import { styled } from '@linaria/react';
const Link = ({ className, children }) => (
<a className={className}>
{children}
</a>
);
const StyledLink = styled(Link)`
color: palevioletred;
font-weight: bold;
`;
render(
<div>
<Link>Unstyled, boring Link</Link>
<br />
<StyledLink>Styled, exciting Link</StyledLink>
</div>
);
Related Issues
You can use styled for styling any component that accepts className (and style if you want to use props-based interpolation).