Commit de3517e
fix(docs): prevent FOUC on website homepage logo (#4716)
* fix(docs): prevent FOUC on website homepage logo
- Add HeroLogo component with loading states and skeleton placeholder
- Implement image preloading in layout for critical resources
- Add CSS optimizations to prevent flash of unstyled content
- Replace direct img tags with optimized Next.js Image component
- Ensures consistent 170px height during logo loading
Fixes #4606
* style: fix formatting in hero-logo component
* fix: remove unused ReactNode import to resolve lint error
* fix: apply Biome formatting to hero-logo component
- Fixed import order in hero-logo.tsx to comply with project linting rules
- Ran 'pnpm format' to auto-fix formatting issues
* refactor: use size-20 instead of w-20 h-20 for better Tailwind CSS optimization
- Apply code review feedback to minify sizing classes
- Use semantic size-* utility instead of separate width/height classes
* fix(docs): resolve FOUC issue with Zod logo
- Optimize HeroLogo component with smooth fade-in transitions
- Remove skeleton placeholder for cleaner UX experience
- Add loading state management with React useState
- Set priority image loading to prevent flash
- Clean up global CSS by removing unnecessary FOUC styles
- Maintain fixed 170px height to prevent layout shifts
- Increase transition duration to 500ms for smoother effect
* fix(docs): prevent layout shift in aside logo
- Create SidebarLogo component with Next.js Image optimization
- Add proper sizing and loading states to prevent CLS
- Update layout to use optimized component
- Add preload for Zod 3 SVG logo
Fixes layout shift reported in PR feedback for md+ screen sizes
* Update packages/docs/components/sidebar-logo.tsx
Co-authored-by: ByteEVM <[email protected]>
* Update packages/docs/components/sidebar-logo.tsx
Co-authored-by: ByteEVM <[email protected]>
* fix(docs): eliminate CLS on aside logo for md+ screens
- Fix height container with md:h-7 to prevent layout shift
- Use LogoWhite for dark theme instead of Logo
- Remove redundant md:w-8 classes for cleaner code
- Address layout shift issue identified in PR review
* Fix sizing
---------
Co-authored-by: ByteEVM <[email protected]>
Co-authored-by: Colin McDonnell <[email protected]>1 parent 100e9aa commit de3517e
File tree
6 files changed
+88
-10
lines changed- packages/docs
- app
- (doc)
- components
- content
6 files changed
+88
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | | - | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
19 | 29 | | |
20 | 30 | | |
21 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
0 commit comments