Skip to content

Commit

Permalink
add layer examples
Browse files Browse the repository at this point in the history
  • Loading branch information
myakura committed Apr 16, 2024
1 parent 7c44f0d commit dcca521
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
51 changes: 51 additions & 0 deletions layer1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!doctype html>

<head>
<meta charset="utf-8">

<title>@layer</title>

<style>
@layer base, theme;

@layer base {
body {
font-family: sans-serif;
padding: 0.5em;
}

p {
margin: 0;

&+& {
margin-top: 1em;
}
}
}

@layer base {
.alert {
padding: 10px;
border: 1px solid;
}
}

@layer theme {
.alert {
color: #660000;
background-color: #ffdddd;
border-color: #993333;
}
}
</style>
</head>

<body>

<div class="alert">
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit.
</p>
</div>

</body>
49 changes: 49 additions & 0 deletions layer2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!doctype html>

<head>
<meta charset="utf-8">

<title>@layer (nested)</title>

<style>
@layer base, theme;

@layer base {
body {
font-family: sans-serif;
padding: 0.5em;
}

p {
margin: 0;

&+& {
margin-top: 1em;
}
}
}

.alert {
@layer base {
padding: 10px;
border: 1px solid;
}

@layer theme {
color: #660000;
background-color: #ffdddd;
border-color: #993333;
}
}
</style>
</head>

<body>

<div class="alert">
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit.
</p>
</div>

</body>

0 comments on commit dcca521

Please sign in to comment.