3 ms·
I completely agree with the maker's point that class names are the bane of CSS design. However, styled components have been amazing in this regard. I've tried a
by mattwad 6y ago
I completely agree with the maker's point that class names are the bane of CSS design. However, styled components have been amazing in this regard. I've tried a lot of solutions over the past 8 years and this is my favorite by far. No extra crap, but you still get reusability and the syntax is like plain CSS. I tried JSS but I can't get over defining styles as JS objects, not to mention made Typescript slow to a crawl.
React example:
```
import styled from 'styled-components';
const Button = styled.button`
padding: 4px;
font-weight: bold;
`;
const PrimaryButton = styled(button)`
background: ${primaryColor};
color: white;
`;
```
- mushishi 6y agoAgreed, I also had a pleasant experience with Styled components, a small boon is that Jetbrains has a plugin for Intellij IDEA.