Skip to content

Removing unused classes #3

@chrismwilliams

Description

@chrismwilliams

Hi,

After reading your post on this boilerplate I thought I'd share that you can remove unused classes by adding them to Tailwind's components layer in global.css like so:

@import-glob 'compositions/*.css' layer(components);
@import-glob 'utilities/*.css' layer(components);

You can also add files to tailwinds other layers as well, e.g. @import 'global/variables.css' layer(base);, but I'm not sure you gain anything by doing so.

Unfortunately, I can't find any reference to it on tailwinds docs to share, I just stumbled upon it when adding cascade layers.

Thanks for releasing this and hope it's helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions