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

(2/2) Interop 2023: CSS Math Functions - Interactive Examples #2655

Closed
wants to merge 4 commits into from
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
12 changes: 12 additions & 0 deletions live-examples/css-examples/math-functions/function-clamp-01.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#example-container {
background-color: black;
color: white;
padding: 4px;
width: 100%;
height: 48px;
}

#example-element {
background-color: red;
height: 100%;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<section id="example-choice-list" class="example-choice-list large">
<div class="example-choice">
<pre><code class="language-css">width: clamp(10%, 1px, 90%);</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">width: clamp(10%, 9999999px, 90%);</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">width: clamp(25px, 1px, 150px);</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">width: clamp(25px, 999999px, 150px);</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 flex-column">
<p>Change the width of the inner red box using the buttons to the left.</p>
<div id="example-container" class="transition-all">
<div id="example-element" class="transition-all"></div>
</div>
</section>
</div>
12 changes: 12 additions & 0 deletions live-examples/css-examples/math-functions/function-max-01.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#example-container {
background-color: black;
color: white;
padding: 4px;
width: 100%;
height: 48px;
}

#example-element {
background-color: red;
height: 100%;
}
38 changes: 38 additions & 0 deletions live-examples/css-examples/math-functions/function-max-01.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<section id="example-choice-list" class="example-choice-list large">
<div class="example-choice">
<pre><code class="language-css">width: max(50px, 50%);</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">width: max(50px, 100%);</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">width: max(20px, 50px, 90%);</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">width: max(80px, 90%);</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 flex-column">
<p>Change the width of the inner red box using the buttons to the left.</p>
<div id="example-container" class="transition-all">
<div id="example-element" class="transition-all"></div>
</div>
</section>
</div>
12 changes: 12 additions & 0 deletions live-examples/css-examples/math-functions/function-min-01.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#example-container {
background-color: black;
color: white;
padding: 4px;
width: 100%;
height: 48px;
}

#example-element {
background-color: red;
height: 100%;
}
38 changes: 38 additions & 0 deletions live-examples/css-examples/math-functions/function-min-01.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<section id="example-choice-list" class="example-choice-list large">
<div class="example-choice">
<pre><code class="language-css">width: min(99999999px, 50%);</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">width: min(99999999px, 100%);</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">width: min(20px, 50px, 90%);</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">width: min(80px, 90%);</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 flex-column">
<p>Change the width of the inner red box using the buttons to the left.</p>
<div id="example-container" class="transition-all">
<div id="example-element" class="transition-all"></div>
</div>
</section>
</div>
25 changes: 25 additions & 0 deletions live-examples/css-examples/math-functions/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"pages": {
"min": {
"cssExampleSrc": "./live-examples/css-examples/math-functions/function-min-01.css",
"exampleCode": "./live-examples/css-examples/math-functions/function-min-01.html",
"fileName": "function-min-01.html",
"title": "CSS Math Functions: min()",
"type": "css"
},
"max": {
"cssExampleSrc": "./live-examples/css-examples/math-functions/function-max-01.css",
"exampleCode": "./live-examples/css-examples/math-functions/function-max-01.html",
"fileName": "function-max-01.html",
"title": "CSS Math Functions: max()",
"type": "css"
},
"clamp": {
"cssExampleSrc": "./live-examples/css-examples/math-functions/function-clamp-01.css",
"exampleCode": "./live-examples/css-examples/math-functions/function-clamp-01.html",
"fileName": "function-clamp-01.html",
"title": "CSS Math Functions: clamp()",
"type": "css"
}
}
}