Skip to content

Style bindings? CSS as a type system and type checking props #4

@d3dc

Description

@d3dc

Maybe the conventions should more closely mirror that of Typescript declaration files...

Your react components have the same semantic objects as BEM almost exactly. We can add prop-types information to wrapped stylesheets by parsing the unique class identifiers. <block>__<element>--<modifier>-<value>

The library could do this when using css modules and blocks (#2). But this would happen at runtime.

It should be possible to add a webpack plugin or babel macro that "type checks" the props passed to Box and Comp.

I haven't fully thought this through, what else needs to be considered?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededproposalquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions