-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow
@compiled/babel-plugin
's increaseSpecificity
to work with `…
…@compiled/jest` (#1656) * Allow `@compiled/babel-plugin`'s `increaseSpecificity` to work with `@compiled/jest`. tl;dr: if you have `increaseSpecificity: true` set, you get styles such as `._18u0u2gc:not(#\\9){margin-left:var(--ds-space-100,8px)}` which will never match `._18u0u2gc` I could not think of a nice way to sneak a test in for this without trying to overhaul jest config entirely, so I did not…but happy to take any advice there. * chore: consolidate INCREASE_SPECIFICITY_SELECTOR * Update packages/utils/src/increase-specificity.ts comment * Copy and paste `INCREASE_SPECIFICITY_SELECTOR` to avoid circular TS references.
- Loading branch information
1 parent
f0e540a
commit e49b4f0
Showing
7 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@compiled/css': patch | ||
--- | ||
|
||
Use a shared utils version of INCREASE_SPECIFICITY_SELECTOR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@compiled/jest': patch | ||
--- | ||
|
||
Allow `@compiled/babel-plugin`'s `increaseSpecificity` to work with `@compiled/jest`'s `toHaveCompiledCss` jest matcher. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@compiled/utils': minor | ||
--- | ||
|
||
Add INCREASE_SPECIFICITY_SELECTOR to utils to consolidate this selector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* Configuring the babel plugin with `increaseSpecificity: true` will result in this being appended to the end of generated classes. | ||
*/ | ||
export const INCREASE_SPECIFICITY_SELECTOR = ':not(#\\9)'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters