Skip to content

Allow colons in class names #38

@hakoerber

Description

@hakoerber

When using class names that contain colons (:), I get the following error:

thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: "class name can only contain alphanumerics, dash, dot and underscore"'

This is coming from this check.

Now, I did not find anything in the HTML spec that actually forbids colons (actually, it allows everything but whitespace). At least colons are quite frequently used for pseudo classes in tailwind (e.g. hover:bg-purple-100).

So I propose to allow colons for classes (and also ids for good measure, it uses the same check). If you agree, I'll open a pull request, should be easy to change.

UPDATE: I changed it in my fork, works like a charm. I'll open a PR if you want.

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