Skip to content

:uno: doesn't compress the classes if you add a line break (@unocss/transformer-compile-class) #5082

@svmrw

Description

@svmrw

UnoCSS version

66.6.0

Describe the bug

If the classes are arranged in a single row, there is no problem:

<template>
    <button
        class=":uno: w-18 cursor-pointer transition-all outline-none shrink-0 hover:bg-red/3 active:inset-shadow-sm inset-shadow-black/30"
    >
        <LogIn class="text-red w-full h-full p-4" />
    </button>
</template>

Result: <button class="uno-ij6qp4">

However, if you add line breaks for readability, the classes are not transformed:

<template>
    <button
        class=":uno:
            w-18 cursor-pointer transition-all
            outline-none shrink-0 hover:bg-red/3
            active:inset-shadow-sm inset-shadow-black/30
        "
    >
        <LogIn class="text-red w-full h-full p-4" />
    </button>
</template>

Result: <button class=":uno: w-18 cursor-pointer transition-all outline-none shrink-0 hover:bg-red/3 active:inset-shadow-sm inset-shadow-black/30">

However, classes are processed correctly by the interpreter. They simply aren't compressed.

Reproduction

https://stackblitz.com/edit/unocss-unocss-9njudbcb?file=src%2FApp.vue

Image

System Info

No response

Validations

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions