Variable styledConst

styled: {
    div: ((templateStrings, ...args) => 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, ...args) => string)
      • (templateStrings, ...args): string
      • Useful for tricking various languages IDE extensions.

        For syntax highlighting, formatting with Prettier, static analysis…

        This will just do string concatenation, plus auto-joining if a string array is provided inside a template interpolation.

        Parameters

        • templateStrings: TemplateStringsArray

          Type

        • Rest ...args: (string | string[])[]

          Type

        Returns string

        Title

        Dummy literals

Generated using TypeDoc