forked from tailwindlabs/tailwindcss
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate focus variants as separate declarations
- Loading branch information
1 parent
7746f64
commit 37b06c8
Showing
4 changed files
with
36 additions
and
8 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
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,22 @@ | ||
expect.extend({ | ||
// Compare two CSS strings with all whitespace removed | ||
// This is probably naive but it's fast and works well enough. | ||
toMatchCss(received, argument) { | ||
function stripped(str) { | ||
return str.replace(/\s/g, '') | ||
} | ||
|
||
if (stripped(received) == stripped(argument)) { | ||
return { | ||
message: () => | ||
`expected ${received} not to match CSS ${argument}`, | ||
pass: true, | ||
}; | ||
} else { | ||
return { | ||
message: () => `expected ${received} to match CSS ${argument}`, | ||
pass: false, | ||
}; | ||
} | ||
} | ||
}) |
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