Skip to content

Conversation

@adamwathan
Copy link
Member

Fixes #7226.

Before this PR, if you had a class like:

.one .two {
  background: black
}

...and then used !one in your template, the generated CSS would be this:

.\!one .\!two {
  background: black !important
}

This would cause the styles to not be applied unless you also added ! to the beginning of other classes in the template that are part of this selector.

This PR makes sure that other classes in the selector aren't mistakenly prefixed with !, so that you can add ! to only one of the classes in your template and get the expected result.

Fixes #7226.

Before this PR, if you had a class like:

```css
.one .two {
  background: black
}
```

...and then used `!one` in your template, the generated CSS would be this:

```css
.\!one .\!two {
  background: black !important
}
```

This would cause the styles to not be applied unless you also added `!` to the beginning of other classes in the template that are part of this selector.

This PR makes sure that other classes in the selector aren't mistakenly prefixed with `!`, so that you can add `!` to only one of the classes in your template and get the expected result.
@adamwathan adamwathan force-pushed the import-prefix-multiclass-fix branch from 2422b1d to ab5ff09 Compare February 25, 2022 18:14
@adamwathan adamwathan merged commit f7a9d37 into master Feb 25, 2022
@adamwathan adamwathan deleted the import-prefix-multiclass-fix branch February 25, 2022 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

! important not working as expected with the matchUtilities

2 participants