Skip to content

Add important to all CSS rules during lessc #2901

@Giwayume

Description

@Giwayume

When creating CSS, I never use the important statement. I always use specificity to define which property wins out.

It would be nice if the less compiler could add !important to all of the rules in the compiled CSS, so the poorly written vendor theme styles I have to deal with in our application do not clash with our application styles.

e.g.

.hidden {
  display: none;
  visibility: hidden;
}

Would become

.hidden {
  display: none !important;
  visibility: hidden !important;
}

Can lessc do this or do I need another tool?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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