Styled Components

import styled from 'styled-components'

const Header = styled.h1`
    font-size: 1.5em;
    color: deepskyblue;

    &::before {
        content: '# ';
    }

    span {
        color: red;
    }
`

export default function Page() {
    return (
        <Header>Hello world! <span>This text will be red</span></Header>
    )
}
const Button = styled.button`
    background-color: gray;
    color: white;
`

const PrimaryButton = styled(Button)`
    background-color: darkblue;
`
const Link = styled.a`
    /* styles */
`

const Icon = styled.svg`
    fill: black;

    ${Link}:hover & {
        fill: blue;
    }
`
const Button = styled.button`
    background-color: ${props => props.primary ? 'deepskyblue' : 'white'};
`

export default function Popup() {
    return (
        <Button>Cancel</Button>
        <Button primary>OK</Button>
    )
}
const Header = styled.h1`
    color: gray;
`

const SubHeader = styled(Header).attrs(props => ({
    as: 'h2'
}))`
    color: darkgray;
`

export default function Page() {
    return (
        <Header>Heading 1</Header>
        <SubHeader>Heading 2</SubHeader>
        <SubHeader as="h3">Heading 3</SubHeader>
    )
}