Skip to content

Support for styled-components syntax #6

@ukch

Description

@ukch

I assume you are familiar with the styled-components library? It uses a syntax similar to the following:

const StyledH1 = styled.h1`
    /* CSS syntax goes here */
`;

Or the equivalent with a React component:

import { SomeReactComponent } from "some-react-library";

const StyledReactComponent = styled(SomeReactComponent)`
    /* CSS syntax goes here */
`;

In my understanding of this plugin, we can make it work by doing something like the following:

const css = styled.h1;
const StyledH1 = css`
    /* CSS syntax goes here */
`;

however, that seems like a pretty non-standard way of doing things. Would you consider adding a way to do something more generic (e.g. "styled*": "css") in the syntax map?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions