Skip to content

fix(site): give inline SVG icons and brand images an intrinsic size - #81

Merged
devin-ai-integration[bot] merged 1 commit into
mainfrom
devin/1791192539-site-svg-intrinsic-size
Oct 5, 2026
Merged

devin-ai-integration[bot] merged 1 commit into
mainfrom
devin/1791192539-site-svg-intrinsic-size

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

On Firefox the landing briefly flashed a page-wide logo before the page appeared. LogoMark (and the icons in icons.tsx) render <svg viewBox> with no width/height, so their size comes only from Tailwind classes (size-6, …). In any paint that happens before the stylesheet applies, an inline SVG with only a viewBox stretches to the full container width, and the navbar logo fills the viewport.

Fix: add presentation attributes as an unstyled fallback. CSS (size-*) still overrides them once loaded, so the styled layout is unchanged (checked: navbar logo 24×24, icons 12–16 px, same as production).

- <svg viewBox="0 0 1254 1254" className={className}>        // LogoMark
+ <svg viewBox="0 0 1254 1254" width="24" height="24" className={className}>
- <svg viewBox="0 0 24 24" className={className} …>          // GitHub/Windows/Apple/Linux icons
+ <svg viewBox="0 0 24 24" width="16" height="16" className={className} …>
- <img src={brand.icon} alt="" className=…>                  // BrandIcon (some SVGs have no intrinsic size → 300×150)
+ <img src={brand.icon} alt="" width="20" height="20" className=…>

I couldn't reproduce the flash itself in Firefox 157 on Linux, including with the CSS delayed by 700 ms, because the stylesheet blocked rendering correctly there. To check the fix, I rendered the prerendered page in Firefox with CSS/JS blocked:

Before After
before after

npm run lint and npm run build (prerender + SEO checks) pass.

Link to Devin session: https://app.devin.ai/sessions/3c4175a872684c4bb1e8fb5003e997af
Open in Devin Desktop: https://app.devin.ai/desktop/session/3c4175a872684c4bb1e8fb5003e997af?variant=devin
Requested by: @Villoh

Without width/height attributes an inline <svg viewBox> stretches to the
full container width, so any paint before the stylesheet applies (seen in
Firefox) flashed a page-wide logo. Tailwind size classes still override
the attributes once CSS loads.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Firefox runtime test of bfee08e: headed stable Firefox 157 on Linux, plus geometry checks and production comparisons in Playwright Firefox 131.

Fallback (CSS blocked, with JS on and off): the production navbar logo measured 1264px wide. With the fix it stays 24×24, shared icons 16×16 and brand images 20×20, on / and /es/.

Before: production, CSS/JS blocked After: fix, CSS/JS blocked
before after

Fresh loads, reloads, hard reloads and loads with CSS delayed 700 ms showed no oversized logo. The navbar logo stayed 24×24 in all 376 requestAnimationFrame samples.

Styled pages: EN/ES in light and dark, plus the Quick start docs page, keep production's icon sizes and colors (navbar/footer 24px, AppWindow sidebar 20px, GitHub 16px, OS icons 14px, marquee 20px, agent cards 32px).

Production, dark Fix, dark
prod dark local dark

Caveat: the transient flash the user saw was not reproduced on Linux. What was reproduced and fixed is the oversized rendering when CSS hasn't applied.

Written by Devin

@devin-ai-integration
devin-ai-integration Bot merged commit 4bb862a into main Oct 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant