[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-nesting] nesting selector : basic test #38373

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>