-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[css-nesting] nesting selector : basic test
- Loading branch information
1 parent
b5fd936
commit 716a578
Showing
2 changed files
with
54 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,22 @@ | ||
<!DOCTYPE html> | ||
<title>Nesting selector</title> | ||
<link rel="author" title="Romain Menke" href="mailto:romainmenke@gmail.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-nesting-1/#selectordef-"> | ||
<style> | ||
.test { | ||
background-color: green; | ||
width: 100px; | ||
height: 100px; | ||
display: grid; | ||
} | ||
|
||
body *+* { | ||
margin-top: 8px; | ||
} | ||
|
||
</style> | ||
|
||
<body> | ||
<p>Tests pass if <strong>block is green</strong></p> | ||
<div class="test"></div> | ||
</body> |
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,32 @@ | ||
<!DOCTYPE html> | ||
<title>Nesting selector</title> | ||
<link rel="author" title="Romain Menke" href="mailto:romainmenke@gmail.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-nesting-1/#selectordef-"> | ||
<link rel="match" href="nesting-selector-ref.html"> | ||
<style> | ||
.test { | ||
background-color: red; | ||
width: 100px; | ||
height: 100px; | ||
display: grid; | ||
} | ||
|
||
& .test1 { | ||
background-color: green; | ||
} | ||
|
||
body .test1 { | ||
/* ":scope" has higher specificity than "body" */ | ||
background-color: red; | ||
} | ||
|
||
body *+* { | ||
margin-top: 8px; | ||
} | ||
|
||
</style> | ||
|
||
<body> | ||
<p>Tests pass if <strong>block is green</strong></p> | ||
<div class="test test1"></div> | ||
</body> |