Variable styledConst

styled: {
    div: (
        templateStrings: TemplateStringsArray,
        ...args: (string | string[])[],
    ) => string;
} = ...

Very useful for inline styles.

Tip

We just need a styled.div for our dummy literal, and for the Styled extension to pick-up and highlight / format / get insights from inline CSS.

Checkout styled-components.vscode-styled-components on the VS Code marketplace.

VSCode extension: styled-components.vscode-styled-components

const myStyle = styled.div`
font-weight: 700;
font-size: 70px;
color: white;
`;

Type declaration

  • div: (
        templateStrings: TemplateStringsArray,
        ...args: (string | string[])[],
    ) => string