Styling (CSS)
Next Generation CSS
Linting
sanitize.css
sanitize.cssstyled-components
import * as React from 'react';
import styled from 'styled-components/macro';
// Create a <Title> React component that renders an <h1> which is
// centered, palevioletred and sized at 1.5em
const Title = styled.h1`
font-size: 1.5em;
text-align: center;
color: palevioletred;
`;
// Create a <Wrapper> React component that renders a <section> with
// some padding and a papayawhip background
const Wrapper = styled.section`
padding: 4em;
background: papayawhip;
`;
// Use them like any other React component – except they're styled!
function Button() {
return (
<Wrapper>
<Title>Hello, here is your first styled component!</Title>
...
</Wrapper>
);
}Media queries
Example Usage
Last updated