Skip to content

When using components=true duplicate Classes are created #48

@juliancc

Description

@juliancc

When you parse using --components=true the css file generated works for the most part. The only main problem is that it generates duplicate classes if many elements with the same class exist in the original file.

For example if you have the following:

<div class="alert alert-warning">
some warning alert
</div>
.
some other code
.
<div class="alert alert-danger">
this is a second alert.. but now is danger
</div>
.alert {
	@apply relative px-3 py-3 mb-4 border rounded;
}
.alert-warning {
	@apply bg-orange-200 border-orange-300 text-orange-800;
}

.
.
.

.alert {
	@apply relative px-3 py-3 mb-4 border rounded;
}
.alert-danger {
	@apply bg-red-200 border-red-300 text-red-800;
}

see that .alert is duplicated

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions