Skip to content

Template literals (Backticks) with Tailwinds extractor #83

Description

@eldiegod

purgecss:purgecss: 0.21.0

Hi,
This is probably really simple but I'm not a regex expert and backticks are giving me the headache.

The issue I found happens when the css class is next to a backtick or preceding one with no space in between , examples: /bg-yellow-dark or bg-yellow-dark or bg-yellow-dark
If this happens the class will be removed from the output.

if there are spaces inbetween then it will work as expeced i.e bg-yellow-dark

the regex that the extractor uses is this: /[A-z0-9-:/]+/g
I'm guessing it is incomplete?
what to do?

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