Repository navigation
Serve the site's fixed logos through NgOptimizedImage - #420
Merged
Merged
Conversation
The first part of #338: the navigation-bar logo (light and dark), the home-page logo, and the sponsor and related-project logos use ngSrc with their intrinsic width and height. The header logo, the likely LCP element on every page, is marked priority; the home page's logos below the fold load lazily, which is the directive's default. The sponsor logos were sized by max-width and max-height alone; with the width and height attributes that ngSrc needs, the browser stretched every one to 80x50. They now also say width: auto and height: auto, so the attributes only give the browser their shape early. Measured on beta and on this branch, every logo's rendered box at 1400px and 390px, light and dark: 36 of 36 identical, all loaded. Without the sponsor CSS, 16 differ. Part of #338. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #338: the "static logos" step its plan starts with.
ngSrcwith intrinsicwidth/heighton the navigation-bar logo (light and dark), the home-page logo, the four sponsor logos and the three related-project logos. The sizes were read from the files.priority: it's the likely LCP element on every page, so it gets fetched eagerly with high priority. Both variants are marked, because which one shows depends on the theme.A layout trap, measured
The sponsor logos were sized by
max-width: 80px; max-height: 50pxalone. With thewidth/heightattributes thatngSrcrequires, the browser stretched every one to 80×50..sponsor-logonow also setswidth: auto; height: auto, so the attributes only give the browser each logo's shape early.How it was checked: every logo's rendered box was recorded on beta (main) and on this branch, served locally, at 1400px and 390px wide in light and dark:
Review notes
priority, so the hidden theme's copy (about 37KB) is fetched at high priority. It was always fetched, eagerly, before; which copy shows isn't known until the theme is.priorityadds no<link rel=preload>. The default loader leavessrcas the same relativeassets/…path, so nothing changes under/curatorgraph/either.Left for the rest of #338
The images whose size isn't known in advance (pathway figures, the diagram thumbnail, EHLD legend items, partner logos, article images, icons) need the per-image
fill-in-a-sized-container decision #338 describes.prefer-ngsrcstays off until then.Tests
npm run buildandcheck:typespass.check:lintandcheck:deadunchanged at their baselines.🤖 Generated with Claude Code