jsx-parser: Auto tag bind for styled-components styled CSS in JS
See original GitHub issuerelated: https://github.com/markuplint/markuplint/issues/468
CSS in JS, such as styled-components, emotion, and linaria, can map JSX tags to HTML tags through clever parsing.
const Button = styled.button`
padding: 32px;
background-color: hotpink;
font-size: 24px;
border-radius: 4px;
color: black;
font-weight: bold;
&:hover {
color: white;
}
`;
export function CustomButton() {
return <Button>This my button component.</Button>;
}
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Basics - styled-components
Automatic critical CSS: styled-components keeps track of which components are ... Create a Title component that'll render an <h1> tag with some styles....
Read more >React Styled Components: Inline Styles + 3 Other CSS Styling ...
There's no one right way to style your React components. ... Inline styles are the most basic example of a CSS in JS...
Read more >Complete Guide On How To Use Styled-components In React
Let's now take a quick look at what styled-components is, and how it works which will get us acquainted with the styled-components syntax....
Read more >Using styled-components in TypeScript: A tutorial with examples
Styled-components is a CSS-in-JS library that enables you to write regular CSS and attach it to JavaScript components.
Read more >How To Use React Styled Components Efficiently - Copycat
Using styled-components makes it simple to use actual CSS to style components by writing JavaScript code. These components are known as “styled ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@petamoriken
Thank you for your information. I think may take a while but I will try it after I implement the
pretenders
option.Probably some kind of JSX(TSX) parser will have to be used.
Linaria and Compiled use Babel to parse and convert JSX(TSX) files to achieve Zero-runtime CSS in JS. This may be helpful for implementation. https://github.com/callstack/linaria/tree/master/packages/babel https://github.com/atlassian-labs/compiled/tree/master/packages/babel-plugin