Skip to content

Commit

Permalink
feat(css): create an example for content-visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dkdk225 committed Nov 16, 2023
1 parent d30b1b8 commit ae0e522
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
19 changes: 19 additions & 0 deletions live-examples/css-examples/container/content-visibility.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.container {
width: 140px;
height: 140px;
border: 3px solid rgb(64, 28, 163);
background-color: rgb(135, 136, 184);
display: flex;
align-items: center;
justify-content: center;
}

.child {
border: 3px solid rgb(64, 28, 163);
background-color: wheat;
width: 80%;
height: 80%;
display: flex;
align-items: center;
justify-content: center;
}
25 changes: 25 additions & 0 deletions live-examples/css-examples/container/content-visibility.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<section id="example-choice-list" class="example-choice-list large" data-property="content-visibility">
<div class="example-choice" initial-choice="true">
<pre><code class="language-css">content-visibility: visible;</code></pre>
<button type="button" class="copy hidden" aria-hidden="true">
<span class="visually-hidden">Copy to Clipboard</span>
</button>
</div>

<div class="example-choice">
<pre><code class="language-css">content-visibility: hidden;</code></pre>
<button type="button" class="copy hidden" aria-hidden="true">
<span class="visually-hidden">Copy to Clipboard</span>
</button>
</div>
</section>

<div id="output" class="output large hidden">
<section id="default-example" class="default-example">
<div id="example-element" class="container">
<div class="child">
<span>This is an inner div</span>
</div>
</div>
</section>
</div>
7 changes: 7 additions & 0 deletions live-examples/css-examples/container/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
"fileName": "contain.html",
"title": "CSS Demo: contain",
"type": "css"
},
"content-visibility": {
"cssExampleSrc": "./live-examples/css-examples/container/content-visibility.css",
"exampleCode": "./live-examples/css-examples/container/content-visibility.html",
"fileName": "content-visibility.html",
"title": "CSS Demo: content-visibility",
"type": "css"
}
}
}

0 comments on commit ae0e522

Please sign in to comment.