Skip to content

Customization of generated CSS classname #4577

@jiri-matejka

Description

@jiri-matejka

What is the feature you are proposing?

Currently, when using css template literal helper, the generated CSS class looks cryptic, such as css-2458908649.

My proposal is an option to customize it because of readability and debugging (especially for development phase).

For example, Linaria zero-runtime CSS in JS offers classNameSlug in its configuration.

It can even be a function:

module.exports = {
  classNameSlug: (hash, title, args) => sha1(`${args.name}-${title}`)
};

For me, option to get some kind of css template literal "title" in the class name would be the best one. Be it the variable name, or component name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions