-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathempty-children.astro
More file actions
40 lines (39 loc) · 926 Bytes
/
empty-children.astro
File metadata and controls
40 lines (39 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
import ThemedCode from "../components/ThemedCode.astro";
import BaseLayout from "../layouts/BaseLayout.astro";
---
<style is:global>
.posts {
min-width: 400px;
}
.post {
width: 100%;
padding: 1rem;
margin: 1rem;
}
.post:has(> *:empty) {
height: 10px;
border: 1px dotted #FF474E;
}
</style>
<BaseLayout title="Empty Children">
<div class="description">
<p>Select an element if all of it's children are empty.</p>
<p>This is useful for skeleton loaders or to flag an element as empty when debugging a page.</p>
</div>
<ThemedCode lang="css" code=`.post:has(> *:empty) {
height: 10px;
border: 1px dotted #FF474E;
}` />
<section class="posts">
<article class="post">
<h2>Hello World</h2>
</article>
<article class="post">
<h2></h2>
</article>
<article class="post">
<h2>Goodbye World</h2>
</article>
</section>
</BaseLayout>