[go: nahoru, domu]

Skip to content

Commit

Permalink
[css-nesting] nesting selector : basic test
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Feb 6, 2023
1 parent b5fd936 commit 716a578
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
22 changes: 22 additions & 0 deletions css/css-nesting/nesting-selector-ref.html
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>
32 changes: 32 additions & 0 deletions css/css-nesting/nesting-selector.html
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>

0 comments on commit 716a578

Please sign in to comment.