File tree Expand file tree Collapse file tree 1 file changed +10
-18
lines changed
Expand file tree Collapse file tree 1 file changed +10
-18
lines changed Original file line number Diff line number Diff line change 3131 } ) ;
3232 </ script >
3333
34- < script >
34+ < style >
35+
3536 /**
3637 * The site nav has been explicitly ‘turned off’ with `content-visibility:
3738 * hidden;` in its component (S)CSS file. This means we don’t need to bother
3839 * rendering it at all on the first pass: it’s off-screen anyway. Once we’re
39- * approaching `domInteractive` (that’s now), we turn it ‘back on’. It’s
40- * wrapped in a rAF to make it asynchronous, which is probably a bit of
41- * a micro-optimisation .
40+ * approaching `domInteractive` (that’s now), we turn it ‘back on’. This
41+ * prioritises the painting of on-screen or above-the-fold content ahead of
42+ * an off-screen nav drawer .
4243 */
43- requestAnimationFrame ( ( ) => {
44- const siteNavList = document . getElementById ( 'jsSiteNavList' ) ;
45- siteNavList . style . contentVisibility = 'visible' ;
46- } ) ;
4744
48- const navReady = performance . mark ( 'navReady' ) ;
45+ .site-nav__list {
46+ content-visibility : visible;
47+ }
4948
50- //# sourceURL=nav-visibility.inline.js
51- </ script >
49+ /*# sourceURL=nav-visibility.inline.css */
5250
53- < noscript >
54- <!--
55- - In the highly unlikely event that someone has disabled JS, turn the nav
56- - ‘back on’ synchronously.
57- -->
58- < style > .site-nav__list { content-visibility : visible; } </ style >
59- </ noscript >
51+ </ style >
6052
6153 < script type =speculationrules >
6254 {
You can’t perform that action at this time.
0 commit comments