Skip to content

Commit 5000f18

Browse files
authored
Linting fixes (#4310)
1 parent 4deb219 commit 5000f18

File tree

4 files changed

+103
-21
lines changed

4 files changed

+103
-21
lines changed

sql/2024/media/video_adoption.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#standardSQL
22
# How many pages use <video>?
33
# video_adoption.sql
4-
# â\x9d• Updated in 2024
4+
# Updated in 2024
55

66
SELECT
77
client,

src/content/en/2021/media.md

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -433,19 +433,59 @@ When browsers pick a resource to load out of a `srcset`, they first assign every
433433

434434
On a 500-CSS-`px`-wide viewport, these resources will be assigned the following densities:
435435

436-
| Resource | Density |
437-
|---|---|
438-
| `large.jpg` | `1000w` ÷ `500px` = 2x |
439-
| `medium.jpg` | `750w` ÷ `500px` = 1.5x |
440-
| `small.jpg` | `500w` ÷ `500px` = 1x |
436+
<figure>
437+
<table>
438+
<thead>
439+
<tr>
440+
<th>Resource</th>
441+
<th>Density</th>
442+
</tr>
443+
</thead>
444+
<tbody>
445+
<tr>
446+
<td><code>large.jpg</code></td>
447+
<td><code>1000w</code> ÷ <code>500px</code> = 2x</td>
448+
</tr>
449+
<tr>
450+
<td><code>medium.jpg</code></td>
451+
<td><code>750w</code> ÷ <code>500px</code> = 1.5x</td>
452+
</tr>
453+
<tr>
454+
<td><code>small.jpg</code></td>
455+
<td><code>500w</code> ÷ <code>500px</code> = 1x</td>
456+
</tr>
457+
</tbody>
458+
</table>
459+
<figcaption>{{ figure_link(caption="500px densities") }}</figcaption>
460+
</figure>
441461

442462
However, on a 1000-CSS-`px`-wide viewport, these same resources, marked up with the same `srcset` and `sizes` values, will have different densities:
443463

444-
| Resource | Density |
445-
|---|---|
446-
| `large.jpg` | `1000w` ÷ `1000px` = 1x |
447-
| `medium.jpg` | `750w` ÷ `1000px` = 0.75x |
448-
| `small.jpg` | `500w` ÷ `1000px` = 0.5x |
464+
<figure>
465+
<table>
466+
<thead>
467+
<tr>
468+
<th>Resource</th>
469+
<th>Density</th>
470+
</tr>
471+
</thead>
472+
<tbody>
473+
<tr>
474+
<td><code>large.jpg</code></td>
475+
<td><code>1000w</code> ÷ <code>1000px</code> = 1x</td>
476+
</tr>
477+
<tr>
478+
<td><code>medium.jpg</code></td>
479+
<td><code>750w</code> ÷ <code>1000px</code> = 0.75x</td>
480+
</tr>
481+
<tr>
482+
<td><code>small.jpg</code></td>
483+
<td><code>500w</code> ÷ <code>1000px</code> = 0.5x</td>
484+
</tr>
485+
</tbody>
486+
</table>
487+
<figcaption>{{ figure_link(caption="1000px densities") }}</figcaption>
488+
</figure>
449489

450490
After these densities are calculated, browsers pick the resource with the density that's the best match for the current browsing context. It's safe to say that in this example, the `srcset` did not contain a wide-enough range of resources. Viewports measuring more than 1,000 CSS `px` across, with higher than `1x` densities, are not uncommon; if you're reading this on a laptop, you're probably browsing in such a context, right now. And in these contexts, the best browsers can do is pick `large.jpg`, whose 1x density will still appear blurry on the high-density display.
451491

src/content/ja/2021/media.md

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -433,19 +433,59 @@ WebPとAVIFの採用が時間とともにどのように変化したか(およ
433433

434434
500-CSS-`px` 幅のビューポートでは、これらのリソースは以下の密度で割り当てられます。
435435

436-
| リソース | 密度 |
437-
|---|---|
438-
| `large.jpg` | `1000w` ÷ `500px` = 2x |
439-
| `medium.jpg` | `750w` ÷ `500px` = 1.5x |
440-
| `small.jpg` | `500w` ÷ `500px` = 1x |
436+
<figure>
437+
<table>
438+
<thead>
439+
<tr>
440+
<th>リソース</th>
441+
<th>密度</th>
442+
</tr>
443+
</thead>
444+
<tbody>
445+
<tr>
446+
<td><code>large.jpg</code></td>
447+
<td><code>1000w</code> ÷ <code>500px</code> = 2x</td>
448+
</tr>
449+
<tr>
450+
<td><code>medium.jpg</code></td>
451+
<td><code>750w</code> ÷ <code>500px</code> = 1.5x</td>
452+
</tr>
453+
<tr>
454+
<td><code>small.jpg</code></td>
455+
<td><code>500w</code> ÷ <code>500px</code> = 1x</td>
456+
</tr>
457+
</tbody>
458+
</table>
459+
<figcaption>{{ figure_link(caption="500px 密度") }}</figcaption>
460+
</figure>
441461

442462
しかし、1000-CSS-`px`幅のビューポートでは、同じリソースが同じ `srcset``sizes` 値でマークアップされ、異なる密度を持つことになります。
443463

444-
| リソース | 密度 |
445-
|---|---|
446-
| `large.jpg` | `1000w` ÷ `1000px` = 1x |
447-
| `medium.jpg` | `750w` ÷ `1000px` = 0.75x |
448-
| `small.jpg` | `500w` ÷ `1000px` = 0.5x |
464+
<figure>
465+
<table>
466+
<thead>
467+
<tr>
468+
<th>リソース</th>
469+
<th>密度</th>
470+
</tr>
471+
</thead>
472+
<tbody>
473+
<tr>
474+
<td><code>large.jpg</code></td>
475+
<td><code>1000w</code> ÷ <code>1000px</code> = 1x</td>
476+
</tr>
477+
<tr>
478+
<td><code>medium.jpg</code></td>
479+
<td><code>750w</code> ÷ <code>1000px</code> = 0.75x</td>
480+
</tr>
481+
<tr>
482+
<td><code>small.jpg</code></td>
483+
<td><code>500w</code> ÷ <code>1000px</code> = 0.5x</td>
484+
</tr>
485+
</tbody>
486+
</table>
487+
<figcaption>{{ figure_link(caption="1000px 密度") }}</figcaption>
488+
</figure>
449489

450490
これらの密度が計算された後、ブラウザは現在の閲覧状況にもっともマッチする密度のリソースを選択します。この例では、`srcset`に十分な広さのリソースが含まれていなかったと言ってよいでしょう。CSSのビューポートは1,000pxを超えるものもあり、1xを超える密度も珍しくはない。ノートパソコンでこれを読んでいる人は、今まさに、そんな状況で閲覧していることでしょう。そして、このような状況でブラウザができる最善のことは、`large.jpg`を選ぶことです。その1倍の密度は、高密度のディスプレイではまだぼやけて見えるでしょう。
451491

src/static/css/ebook.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ section.chapter {
381381
}
382382

383383
section h1 {
384+
/* stylelint-disable-next-line declaration-property-value-no-unknown */
384385
string-set: chapter-title content();
385386
}
386387

@@ -389,6 +390,7 @@ section.chapter {
389390
}
390391

391392
section.chapter div.subtitle {
393+
/* stylelint-disable-next-line declaration-property-value-no-unknown */
392394
string-set: chapter-subtitle content() " : ";
393395
}
394396

0 commit comments

Comments
 (0)