Skip to content

CSS: animation: none !important - important gets renamed #20794

@Knagis

Description

@Knagis

Have you used AI?

None

Bug Description

When using CSS experiments in prod build
animation: none !important gets converted to animation: none !DfLy9m

Link to Minimal Reproduction and step to reproduce

webpack.config.js

export default {
    mode: 'production',
    entry: "./index.css",
    experiments: {
        css: true,
    },
    module: {
        rules: [
            {
                test: /\.css$/i,
                type: "css/module",
            },
        ],
    }
}

index.css:

.foo {
    animation: none !important;
}

the first !important stays as is, the second is changed.

Expected Behavior

!important is not treated as name and is never renamed.

.Fy_rS4 {
    animation: none !important;
}

Actual Behavior

!important gets renamed in animation property.

.Fy_rS4 {
    animation: none !kFtQY8;
}

Environment

webpack 5.106.0

Is this a regression?

None

Last Working Version

No response

Additional Context

No response

Metadata

Metadata

Assignees

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