Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only add ! to selector class matching template candidate #7664

Merged
merged 2 commits into from
Feb 25, 2022

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
1 participant