Conversation
📝 WalkthroughWalkthroughAdds a Safari-specific CSS rule that, inside an Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Pull request artifacts
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/block-components/image/style.scss (1)
76-80: Consider a more robust Safari-only@supportscompound check.
@supports (font: -apple-system-body)alone can match non-Safari browsers on macOS. While the consequence here is benign (an innocuouswill-changehint applied to Chrome/Edge on macOS), the code comment explicitly states the intent is to target Safari. A more bulletproof approach chains(hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none), which reliably isolates Safari 16+ on macOS and all WebKit-based browsers on iOS without false-positives on Blink-based desktop browsers.♻️ Proposed refinement
-@supports (font: -apple-system-body) { +@supports (hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none) { img.stk-img { will-change: transform; } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/block-components/image/style.scss` around lines 76 - 80, The current `@supports` block that targets img.stk-img uses (font: -apple-system-body) which can match non‑Safari browsers; update the Safari check to a compound `@supports` condition that reliably isolates Safari/WebKit (for example combine (hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none)) and replace the existing `@supports` around the img.stk-img rule; keep or add a brief comment stating the intent to target Safari/WebKit so future editors understand the special-case selector.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/block-components/image/style.scss`:
- Around line 76-80: The current `@supports` block that targets img.stk-img uses
(font: -apple-system-body) which can match non‑Safari browsers; update the
Safari check to a compound `@supports` condition that reliably isolates
Safari/WebKit (for example combine (hanging-punctuation: first) and (font:
-apple-system-body) and (-webkit-appearance: none)) and replace the existing
`@supports` around the img.stk-img rule; keep or add a brief comment stating the
intent to target Safari/WebKit so future editors understand the special-case
selector.
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/block-components/image/style.scss (2)
76-76: Consider a more bulletproof Safari@supportsguard.
@supports (font: -apple-system-body)alone is sufficient today, but chaining it withhanging-punctuation: firstand-webkit-appearance: noneproduces a more bulletproof Safari-only match, as recommended since 2024. A false positive here (e.g., a future non-Safari engine picking up-apple-system-body) would unconditionally enablewill-change: transformon all lazy-loaded images in that browser.♻️ Suggested guard
-@supports (font: -apple-system-body) { +@supports (hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none) {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/block-components/image/style.scss` at line 76, The current `@supports` rule "@supports (font: -apple-system-body)" is too narrow and risks false positives; update the Safari guard around the block that enables "will-change: transform" for lazy-loaded images by chaining additional feature checks such as "hanging-punctuation: first" and "-webkit-appearance: none" (i.e., use a combined `@supports` condition that requires all three) so the rule only matches Safari-like engines; locate the `@supports` block in src/block-components/image/style.scss and replace the single-feature guard with the chained guard to more reliably scope the Safari-only styles.
77-79: Permanentwill-change: transformon all lazy-loaded images may create unnecessary GPU pressure.
will-changeis intended as a temporary hint and should be removed once the rendering issue is resolved. Applying it permanently in CSS to everyimg.stk-img.lazyloadedelement allocates a separate compositor layer per image for the lifetime of the page. On image-heavy pages, this compounds memory usage.If the rendering glitch only occurs during the transition from
lazyloading→lazyloaded, a JS-based approach (addwill-change: transformonlazybeforeunveil, remove it shortly afterlazyloadedfires) would be more precise. If staying in CSS, scoping it further (e.g., by also requiring an ancestor class specific to the Stackable block) would limit the blast radius.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/block-components/image/style.scss` around lines 77 - 79, The rule img.stk-img.lazyloaded keeps will-change: transform permanently and should be made temporary or scoped to avoid persistent GPU layers; update styles/behavior by removing will-change from the global CSS selector and either (A) implement a JS fix that adds will-change: transform when the image enters lazybeforeunveil and removes it shortly after the lazyloaded event (or on a small timeout) using the img.stk-img.lazyloaded node, or (B) if keeping a CSS-only fix, restrict the selector to a much narrower scope (e.g., require a Stackable block ancestor class such as .stk-block img.stk-img.lazyloaded) so only affected blocks get the hint. Ensure the code references the img.stk-img.lazyloaded selector and the lazybeforeunveil / lazyloaded events when implementing the JS approach.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/block-components/image/style.scss`:
- Line 76: The current `@supports` rule "@supports (font: -apple-system-body)" is
too narrow and risks false positives; update the Safari guard around the block
that enables "will-change: transform" for lazy-loaded images by chaining
additional feature checks such as "hanging-punctuation: first" and
"-webkit-appearance: none" (i.e., use a combined `@supports` condition that
requires all three) so the rule only matches Safari-like engines; locate the
`@supports` block in src/block-components/image/style.scss and replace the
single-feature guard with the chained guard to more reliably scope the
Safari-only styles.
- Around line 77-79: The rule img.stk-img.lazyloaded keeps will-change:
transform permanently and should be made temporary or scoped to avoid persistent
GPU layers; update styles/behavior by removing will-change from the global CSS
selector and either (A) implement a JS fix that adds will-change: transform when
the image enters lazybeforeunveil and removes it shortly after the lazyloaded
event (or on a small timeout) using the img.stk-img.lazyloaded node, or (B) if
keeping a CSS-only fix, restrict the selector to a much narrower scope (e.g.,
require a Stackable block ancestor class such as .stk-block
img.stk-img.lazyloaded) so only affected blocks get the hint. Ensure the code
references the img.stk-img.lazyloaded selector and the lazybeforeunveil /
lazyloaded events when implementing the JS approach.
Summary by CodeRabbit