-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See #1001
- Loading branch information
Showing
20 changed files
with
2,022 additions
and
0 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,4 @@ | ||
Simple selector unification generally relies heavily on superselector logic for | ||
determining when one selector can be omitted. Since this logic is already | ||
thoroughly tested in `is-superselector()`, it's not duplicated here, other than | ||
a few test cases to ensure that superselector logic is working at all. |
43 changes: 43 additions & 0 deletions
43
spec/core_functions/selector/unify/chooses_superselector.hrx
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,43 @@ | ||
<===> README.md | ||
These tests verify that, if one selector is a superselector of the other, the | ||
subselector is returned (since it's more specific). | ||
|
||
<===> | ||
================================================================================ | ||
<===> whole_selector/selector1/input.scss | ||
a {b: selector-unify("c", "d c.e")} | ||
|
||
<===> whole_selector/selector1/output.css | ||
a { | ||
b: d c.e; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> whole_selector/selector2/input.scss | ||
a {b: selector-unify("d c.e", "c")} | ||
|
||
<===> whole_selector/selector2/output.css | ||
a { | ||
b: d c.e; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> parent/selector1/input.scss | ||
a {b: selector-unify("c d", "c.e .f")} | ||
|
||
<===> parent/selector1/output.css | ||
a { | ||
b: c.e d.f; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> parent/selector2/input.scss | ||
a {b: selector-unify("c.e .f", "c d")} | ||
|
||
<===> parent/selector2/output.css | ||
a { | ||
b: c.e d.f; | ||
} |
Oops, something went wrong.