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

Create an example for content-visibility #2663

Merged
merged 1 commit into from
Jan 19, 2024
Merged
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
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"
}
}
}