Skip to content

Commit

Permalink
fix mobile css
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Jun 9, 2024
1 parent 9aabe89 commit 73979be
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions webgpu/lessons/resources/lesson.css
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,26 @@ pre.prettyprint.lighttheme .fun { color: #900; } /* function name */
}
}

/* fixed size text */
.fixed-size-text {
padding: 1em;
line-height: 1.2;
overflow: auto;
container-type: layout size;
container-name: fixed-size-text;
}
/*@container fixed-size-text (width < 570px) {*/
@media (max-width: 570px) {
.fixed-size-text {
font-size: small;
}
}
@media (max-width: 425px) {
.fixed-size-text {
font-size: x-small;
}
}

/* ---- data table ---- */

.data-table {
Expand Down
4 changes: 2 additions & 2 deletions webgpu/lessons/webgpu-resizing-the-canvas.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ with 3 children, each set be the 33% the width of their parent
On one of my machines, with a default (un-zoomed) browser window, I get these
results
<pre style="padding: 1em">
<pre class="fixed-size-text">
devicePixelRatio: 2
--------------- #left ---------------
inlineSize: 99.65625
Expand Down Expand Up @@ -333,7 +333,7 @@ If we add that measurement to our example it gives us the actual answer
On the machine I used for the results above I get these results
<pre style="padding: 1em">
<pre class="fixed-size-text">
devicePixelRatio: 2
--------------- #left ---------------
inlineSize: 99.65625
Expand Down

0 comments on commit 73979be

Please sign in to comment.