Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Clarify Documentation #746

Closed
wants to merge 3 commits into from
Closed
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
5 changes: 3 additions & 2 deletions docs/checks/img_width_and_height.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ImgWidthAndHeight:

There are some cases where you can avoid content-layout shift without needing the width and height attributes:

- When the aspect-ratio of the displayed image should be independent of the uploaded image. In those cases, the solution is still the padding-top hack with an `overflow: hidden container`.
- When the aspect-ratio of the displayed image should be independent of the uploaded image. In those cases, the solution is still the [padding-top hack][csstricks-ratio] with an `overflow: hidden` container.
- When you are happy with the padding-top hack.

In those cases, it is fine to disable this check with the comment.
Expand All @@ -68,12 +68,13 @@ This check has been introduced in Theme Check 0.6.0.
- [Cumulative Layout Shift Reference][cls]
- [Codepen illustrating the impact of width and height on layout shift][codepenshift]
- [Codepen illustrating the impact of width and height on lazy loading][codepenlazy]
- [Article detailing how padding can be used to "hack" aspect ratios][csstricks-ratio]
- [Rule Source][codesource]
- [Documentation Source][docsource]

[cls]: https://web.dev/cls/
[codepenshift]: https://codepen.io/charlespwd/pen/YzpxPEp?editors=1100
[codepenlazy]: https://codepen.io/charlespwd/pen/abZmqXJ?editors=0111
[aspect-ratio]: https://caniuse.com/mdn-css_properties_aspect-ratio
[csstricks-ratio]: https://css-tricks.com/aspect-ratio-boxes/
[codesource]: /lib/theme_check/checks/img_aspect_ratio.rb
[docsource]: /docs/checks/img_aspect_ratio.md