Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new Titlepiece component 🎡 #11368

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

frederickobrien
Copy link
Contributor

@frederickobrien frederickobrien commented May 3, 2024

What does this change?

The first step towards adding a fully fledged Titlepiece component for the new-look site masthead. This PR creates a new component and focuses on the design, with the appearance adjusting as desired across multiple breakpoints.

Implementation build on a CSS Grid approach modelled by @mxdvl during the Basecamp project (for reference), with different parts of the titlepiece positioned on a shifting grid.

Companion to #11190. The contents of this component will be kept out of public view by the same 0% test that the masthead as a whole is sitting behind.

Not covered in this PR but will need to be done in follow-ups:

  • Veggie burger menu on mobile
  • Tracking on the edition switcher
  • Pillars nav dropdown on click
  • Generating the pillar and subnav links using the nav prop (this should also capture highlighting section colours depending on where the reader is)
  • Side/carousel scrolling for the subnav on smaller devices

Plus a bunch of silly mistakes/omissions I've no doubt made.

Why?

As part of the ongoing 'Fairground' project to revamp the homepage, we're taking an incremental approach to the new-look masthead. This PR should lay a base on which we can add further functionality and best practice.

Screenshots

Screen width
mobile image
tablet image
wide image

Copy link

github-actions bot commented May 3, 2024

Size Change: +28.8 kB (+3.62%)

Total Size: 823 kB

Filename Size Change
dotcom-rendering/dist/1006.client.web.********************.js 3.46 kB +270 B (+8.48%) 🔍
dotcom-rendering/dist/1692.client.web.********************.js 0 B -3.04 kB (removed) 🏆
dotcom-rendering/dist/1810.client.web.********************.js 0 B -3.59 kB (removed) 🏆
dotcom-rendering/dist/2062.client.web.********************.js 0 B -2.9 kB (removed) 🏆
dotcom-rendering/dist/2284.client.web.********************.js 0 B -3.13 kB (removed) 🏆
dotcom-rendering/dist/3149.client.web.********************.js 0 B -2.01 kB (removed) 🏆
dotcom-rendering/dist/3257.client.web.********************.js 0 B -3.6 kB (removed) 🏆
dotcom-rendering/dist/3399.client.web.********************.js 0 B -4.63 kB (removed) 🏆
dotcom-rendering/dist/3463.client.web.********************.js 0 B -2.8 kB (removed) 🏆
dotcom-rendering/dist/3787.client.web.********************.js 0 B -5.51 kB (removed) 🏆
dotcom-rendering/dist/3849.client.web.********************.js 0 B -2.41 kB (removed) 🏆
dotcom-rendering/dist/3982.client.web.********************.js 0 B -4.77 kB (removed) 🏆
dotcom-rendering/dist/4463.client.web.********************.js 0 B -3.06 kB (removed) 🏆
dotcom-rendering/dist/499.client.web.********************.js 0 B -2.82 kB (removed) 🏆
dotcom-rendering/dist/523.client.web.********************.js 0 B -17.9 kB (removed) 🏆
dotcom-rendering/dist/5530.client.web.********************.js 0 B -2.01 kB (removed) 🏆
dotcom-rendering/dist/6239.client.web.********************.js 0 B -3.42 kB (removed) 🏆
dotcom-rendering/dist/6241.client.web.********************.js 0 B -3.33 kB (removed) 🏆
dotcom-rendering/dist/6257.client.web.********************.js 0 B -3.87 kB (removed) 🏆
dotcom-rendering/dist/648.client.web.********************.js 0 B -5.89 kB (removed) 🏆
dotcom-rendering/dist/6870.client.web.********************.js 0 B -959 B (removed) 🏆
dotcom-rendering/dist/7085.client.web.********************.js 0 B -8.23 kB (removed) 🏆
dotcom-rendering/dist/7110.client.web.********************.js 0 B -3 kB (removed) 🏆
dotcom-rendering/dist/7703.client.web.********************.js 0 B -2.66 kB (removed) 🏆
dotcom-rendering/dist/7859.client.web.********************.js 0 B -3.8 kB (removed) 🏆
dotcom-rendering/dist/8082.client.web.********************.js 0 B -3.48 kB (removed) 🏆
dotcom-rendering/dist/8182.client.web.********************.js 0 B -3.85 kB (removed) 🏆
dotcom-rendering/dist/8346.client.web.********************.js 0 B -4.46 kB (removed) 🏆
dotcom-rendering/dist/8851.client.web.********************.js 0 B -2.93 kB (removed) 🏆
dotcom-rendering/dist/9448.client.web.********************.js 0 B -2.98 kB (removed) 🏆
dotcom-rendering/dist/9455.client.web.********************.js 0 B -6.41 kB (removed) 🏆
dotcom-rendering/dist/9535.client.web.********************.js 0 B -2.67 kB (removed) 🏆
dotcom-rendering/dist/9655.client.web.********************.js 0 B -3.58 kB (removed) 🏆
dotcom-rendering/dist/9804.client.web.********************.js 0 B -2.94 kB (removed) 🏆
dotcom-rendering/dist/CardCommentCount-importable.client.web.********************.js 6.39 kB +1.57 kB (+32.48%) 🚨
dotcom-rendering/dist/Carousel-importable.client.web.********************.js 5.7 kB -1.1 kB (-16.15%) 👏
dotcom-rendering/dist/CarouselForNewsletters-importable.client.web.********************.js 6.26 kB +622 B (+11.03%) ⚠️
dotcom-rendering/dist/FilterKeyEventsToggle-importable.client.web.********************.js 5.23 kB +1.44 kB (+38.03%) 🚨
dotcom-rendering/dist/GetCricketScoreboard-importable.client.web.********************.js 3.65 kB -829 B (-18.51%) 👏
dotcom-rendering/dist/guardian-braze-components-banner.client.web.********************.js 13.7 kB -1.4 kB (-9.24%)
dotcom-rendering/dist/guardian-braze-components-end-of-article.client.web.********************.js 8.55 kB -1.08 kB (-11.19%) 👏
dotcom-rendering/dist/GuideAtomWrapper-importable.client.web.********************.js 3.01 kB +2.23 kB (+285.66%) 🆘
dotcom-rendering/dist/index.client.web.********************.js 46.8 kB -481 B (-1.02%)
dotcom-rendering/dist/InteractiveBlockComponent-importable.client.web.********************.js 7.13 kB +963 B (+15.62%) ⚠️
dotcom-rendering/dist/KeyEventsCarousel-importable.client.web.********************.js 5.51 kB +777 B (+16.4%) ⚠️
dotcom-rendering/dist/LatestLinks-importable.client.web.********************.js 4.51 kB +1.75 kB (+63.41%) 🆘
dotcom-rendering/dist/ManyNewsletterSignUp-importable.client.web.********************.js 5.67 kB -1.04 kB (-15.47%) 👏
dotcom-rendering/dist/MapEmbedBlockComponent-importable.client.web.********************.js 4.47 kB -1.16 kB (-20.53%) 🎉
dotcom-rendering/dist/MostViewedFooter-importable.client.web.********************.js 4.03 kB -1.72 kB (-29.89%) 🎉
dotcom-rendering/dist/MostViewedFooterData-importable.client.web.********************.js 6.73 kB -1.59 kB (-19.13%) 👏
dotcom-rendering/dist/MostViewedRightWrapper-importable.client.web.********************.js 4.88 kB +862 B (+21.48%) 🚨
dotcom-rendering/dist/ProfileAtom-importable.client.web.********************.js 2.79 kB +2.25 kB (+415.68%) 🆘
dotcom-rendering/dist/ProfileAtomWrapper-importable.client.web.********************.js 3.03 kB +2.23 kB (+279%) 🆘
dotcom-rendering/dist/QandaAtom-importable.client.web.********************.js 2.79 kB +2.25 kB (+418.96%) 🆘
dotcom-rendering/dist/ReaderRevenueLinks-importable.client.web.********************.js 4.23 kB -419 B (-9.02%)
dotcom-rendering/dist/RichLinkComponent-importable.client.web.********************.js 4.62 kB -2.14 kB (-31.69%) 🎉
dotcom-rendering/dist/SecureSignup-importable.client.web.********************.js 4.46 kB +837 B (+23.08%) 🚨
dotcom-rendering/dist/ShowMore-importable.client.web.********************.js 5.73 kB -1.25 kB (-17.91%) 👏
dotcom-rendering/dist/SignInGateCustomizableText.client.web.********************.js 3.66 kB +2.71 kB (+282.95%) 🆘
dotcom-rendering/dist/SignInGateMain.client.web.********************.js 3.9 kB +2.7 kB (+226.57%) 🆘
dotcom-rendering/dist/SignInGateMainCheckoutComplete.client.web.********************.js 3.95 kB +1.26 kB (+46.91%) 🚨
dotcom-rendering/dist/SignInGateSelector-importable.client.web.********************.js 3.53 kB -278 B (-7.3%)
dotcom-rendering/dist/SlotBodyEnd-importable.client.web.********************.js 4.46 kB +316 B (+7.63%) 🔍
dotcom-rendering/dist/SpotifyBlockComponent-importable.client.web.********************.js 4.32 kB -1.16 kB (-21.13%) 🎉
dotcom-rendering/dist/SupportTheG-importable.client.web.********************.js 4.36 kB -408 B (-8.56%)
dotcom-rendering/dist/TableOfContents-importable.client.web.********************.js 1.44 kB -1.75 kB (-54.84%) 🏆
dotcom-rendering/dist/TimelineAtom-importable.client.web.********************.js 3.23 kB +1.99 kB (+160.24%) 🆘
dotcom-rendering/dist/VideoFacebookBlockComponent-importable.client.web.********************.js 4.49 kB -1.16 kB (-20.49%) 🎉
dotcom-rendering/dist/YoutubeBlockComponent-importable.client.web.********************.js 3.5 kB -1.16 kB (-24.87%) 🎉
dotcom-rendering/dist/1199.client.web.********************.js 3.87 kB +3.87 kB (new file) 🆕
dotcom-rendering/dist/131.client.web.********************.js 3.46 kB +3.46 kB (new file) 🆕
dotcom-rendering/dist/1374.client.web.********************.js 3.04 kB +3.04 kB (new file) 🆕
dotcom-rendering/dist/1568.client.web.********************.js 18 kB +18 kB (new file) 🆕
dotcom-rendering/dist/1821.client.web.********************.js 3.83 kB +3.83 kB (new file) 🆕
dotcom-rendering/dist/1976.client.web.********************.js 3.03 kB +3.03 kB (new file) 🆕
dotcom-rendering/dist/2193.client.web.********************.js 3.88 kB +3.88 kB (new file) 🆕
dotcom-rendering/dist/2302.client.web.********************.js 3.39 kB +3.39 kB (new file) 🆕
dotcom-rendering/dist/2792.client.web.********************.js 6.39 kB +6.39 kB (new file) 🆕
dotcom-rendering/dist/3099.client.web.********************.js 3.78 kB +3.78 kB (new file) 🆕
dotcom-rendering/dist/32.client.web.********************.js 3.61 kB +3.61 kB (new file) 🆕
dotcom-rendering/dist/3413.client.web.********************.js 3.56 kB +3.56 kB (new file) 🆕
dotcom-rendering/dist/3925.client.web.********************.js 4.78 kB +4.78 kB (new file) 🆕
dotcom-rendering/dist/4021.client.web.********************.js 4.28 kB +4.28 kB (new file) 🆕
dotcom-rendering/dist/42.client.web.********************.js 2.92 kB +2.92 kB (new file) 🆕
dotcom-rendering/dist/4200.client.web.********************.js 3.57 kB +3.57 kB (new file) 🆕
dotcom-rendering/dist/4464.client.web.********************.js 8.23 kB +8.23 kB (new file) 🆕
dotcom-rendering/dist/4597.client.web.********************.js 2.98 kB +2.98 kB (new file) 🆕
dotcom-rendering/dist/4935.client.web.********************.js 3.5 kB +3.5 kB (new file) 🆕
dotcom-rendering/dist/5055.client.web.********************.js 2.65 kB +2.65 kB (new file) 🆕
dotcom-rendering/dist/5339.client.web.********************.js 3.53 kB +3.53 kB (new file) 🆕
dotcom-rendering/dist/585.client.web.********************.js 3.01 kB +3.01 kB (new file) 🆕
dotcom-rendering/dist/6106.client.web.********************.js 2.47 kB +2.47 kB (new file) 🆕
dotcom-rendering/dist/7727.client.web.********************.js 3.34 kB +3.34 kB (new file) 🆕
dotcom-rendering/dist/7740.client.web.********************.js 4.42 kB +4.42 kB (new file) 🆕
dotcom-rendering/dist/8239.client.web.********************.js 3 kB +3 kB (new file) 🆕
dotcom-rendering/dist/8253.client.web.********************.js 5.87 kB +5.87 kB (new file) 🆕
dotcom-rendering/dist/8464.client.web.********************.js 3.75 kB +3.75 kB (new file) 🆕
dotcom-rendering/dist/859.client.web.********************.js 2.54 kB +2.54 kB (new file) 🆕
dotcom-rendering/dist/8677.client.web.********************.js 2.81 kB +2.81 kB (new file) 🆕
dotcom-rendering/dist/8953.client.web.********************.js 8.47 kB +8.47 kB (new file) 🆕
dotcom-rendering/dist/9211.client.web.********************.js 3.83 kB +3.83 kB (new file) 🆕
dotcom-rendering/dist/9425.client.web.********************.js 3.17 kB +3.17 kB (new file) 🆕
dotcom-rendering/dist/9527.client.web.********************.js 4.11 kB +4.11 kB (new file) 🆕
dotcom-rendering/dist/9551.client.web.********************.js 4.3 kB +4.3 kB (new file) 🆕
dotcom-rendering/dist/9732.client.web.********************.js 2.91 kB +2.91 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
dotcom-rendering/dist/1045.client.web.********************.js 12.4 kB +7 B (+0.06%)
dotcom-rendering/dist/1094.client.web.********************.js 5.93 kB -1 B (-0.02%)
dotcom-rendering/dist/110.client.web.********************.js 8.65 kB -5 B (-0.06%)
dotcom-rendering/dist/1225.client.web.********************.js 781 B 0 B
dotcom-rendering/dist/1299.client.web.********************.js 926 B 0 B
dotcom-rendering/dist/1640.client.web.********************.js 4.83 kB -3 B (-0.06%)
dotcom-rendering/dist/1889.client.web.********************.js 3.61 kB 0 B
dotcom-rendering/dist/2170.client.web.********************.js 6.75 kB +5 B (+0.07%)
dotcom-rendering/dist/226.client.web.********************.js 3.8 kB +4 B (+0.11%)
dotcom-rendering/dist/2342.client.web.********************.js 1 kB 0 B
dotcom-rendering/dist/2344.client.web.********************.js 3.35 kB +2 B (+0.06%)
dotcom-rendering/dist/2373.client.web.********************.js 10.3 kB +9 B (+0.09%)
dotcom-rendering/dist/2471.client.web.********************.js 715 B 0 B
dotcom-rendering/dist/2778.client.web.********************.js 853 B 0 B
dotcom-rendering/dist/2784.client.web.********************.js 5.86 kB +3 B (+0.05%)
dotcom-rendering/dist/2920.client.web.********************.js 526 B 0 B
dotcom-rendering/dist/3000.client.web.********************.js 887 B 0 B
dotcom-rendering/dist/3114.client.web.********************.js 651 B 0 B
dotcom-rendering/dist/3118.client.web.********************.js 496 B 0 B
dotcom-rendering/dist/3255.client.web.********************.js 803 B 0 B
dotcom-rendering/dist/3336.client.web.********************.js 781 B 0 B
dotcom-rendering/dist/3428.client.web.********************.js 3.85 kB 0 B
dotcom-rendering/dist/3494.client.web.********************.js 823 B 0 B
dotcom-rendering/dist/3642.client.web.********************.js 787 B 0 B
dotcom-rendering/dist/3922.client.web.********************.js 724 B 0 B
dotcom-rendering/dist/3932.client.web.********************.js 789 B 0 B
dotcom-rendering/dist/4103.client.web.********************.js 22.4 kB +7 B (+0.03%)
dotcom-rendering/dist/424.client.web.********************.js 749 B 0 B
dotcom-rendering/dist/4442.client.web.********************.js 823 B 0 B
dotcom-rendering/dist/4666.client.web.********************.js 9.15 kB +67 B (+0.74%)
dotcom-rendering/dist/4673.client.web.********************.js 723 B 0 B
dotcom-rendering/dist/4811.client.web.********************.js 994 B 0 B
dotcom-rendering/dist/5044.client.web.********************.js 804 B 0 B
dotcom-rendering/dist/5077.client.web.********************.js 441 B 0 B
dotcom-rendering/dist/5084.client.web.********************.js 751 B 0 B
dotcom-rendering/dist/5247.client.web.********************.js 2.94 kB -2 B (-0.07%)
dotcom-rendering/dist/5308.client.web.********************.js 2.7 kB 0 B
dotcom-rendering/dist/565.client.web.********************.js 669 B 0 B
dotcom-rendering/dist/5817.client.web.********************.js 915 B 0 B
dotcom-rendering/dist/6093.client.web.********************.js 749 B 0 B
dotcom-rendering/dist/6167.client.web.********************.js 640 B 0 B
dotcom-rendering/dist/6351.client.web.********************.js 5.9 kB -2 B (-0.03%)
dotcom-rendering/dist/6640.client.web.********************.js 906 B 0 B
dotcom-rendering/dist/7116.client.web.********************.js 23 kB 0 B
dotcom-rendering/dist/7196.client.web.********************.js 889 B 0 B
dotcom-rendering/dist/72.client.web.********************.js 961 B 0 B
dotcom-rendering/dist/7270.client.web.********************.js 155 B 0 B
dotcom-rendering/dist/7387.client.web.********************.js 955 B 0 B
dotcom-rendering/dist/7660.client.web.********************.js 3.65 kB -3 B (-0.08%)
dotcom-rendering/dist/7697.client.web.********************.js 619 B 0 B
dotcom-rendering/dist/7723.client.web.********************.js 921 B 0 B
dotcom-rendering/dist/8134.client.web.********************.js 595 B 0 B
dotcom-rendering/dist/8179.client.web.********************.js 825 B 0 B
dotcom-rendering/dist/8279.client.web.********************.js 42.9 kB 0 B
dotcom-rendering/dist/8565.client.web.********************.js 642 B 0 B
dotcom-rendering/dist/8768.client.web.********************.js 1.54 kB 0 B
dotcom-rendering/dist/8791.client.web.********************.js 1 kB 0 B
dotcom-rendering/dist/889.client.web.********************.js 854 B 0 B
dotcom-rendering/dist/8907.client.web.********************.js 789 B 0 B
dotcom-rendering/dist/9060.client.web.********************.js 877 B 0 B
dotcom-rendering/dist/9225.client.web.********************.js 582 B 0 B
dotcom-rendering/dist/9396.client.web.********************.js 680 B 0 B
dotcom-rendering/dist/9430.client.web.********************.js 508 B 0 B
dotcom-rendering/dist/9604.client.web.********************.js 530 B 0 B
dotcom-rendering/dist/9789.client.web.********************.js 922 B 0 B
dotcom-rendering/dist/9936.client.web.********************.js 1.85 kB 0 B
dotcom-rendering/dist/AdBlockAsk-importable.client.web.********************.js 2.85 kB 0 B
dotcom-rendering/dist/AdPortals-importable.client.web.********************.js 3.76 kB -2 B (-0.05%)
dotcom-rendering/dist/AlreadyVisited-importable.client.web.********************.js 422 B 0 B
dotcom-rendering/dist/AppsEpic-importable.client.web.********************.js 3.53 kB -5 B (-0.14%)
dotcom-rendering/dist/AppsFooter-importable.client.web.********************.js 3.62 kB -4 B (-0.11%)
dotcom-rendering/dist/AppsLightboxImage-importable.client.web.********************.js 3.02 kB -1 B (-0.03%)
dotcom-rendering/dist/AppsLightboxImageStore-importable.client.web.********************.js 2.46 kB 0 B
dotcom-rendering/dist/AudioAtomWrapper-importable.client.web.********************.js 3.57 kB -1 B (-0.03%)
dotcom-rendering/dist/AustralianTerritorySwitcher-importable.client.web.********************.js 2.01 kB +3 B (+0.15%)
dotcom-rendering/dist/Branding-importable.client.web.********************.js 3.08 kB +6 B (+0.2%)
dotcom-rendering/dist/braze-web-sdk-core.client.web.********************.js 36.9 kB 0 B
dotcom-rendering/dist/BrazeMessaging-importable.client.web.********************.js 1.91 kB 0 B
dotcom-rendering/dist/CalloutBlockComponent-importable.client.web.********************.js 6.74 kB +6 B (+0.09%)
dotcom-rendering/dist/CalloutEmbedBlockComponent-importable.client.web.********************.js 5.75 kB +2 B (+0.03%)
dotcom-rendering/dist/ChartAtom-importable.client.web.********************.js 537 B +1 B (+0.19%)
dotcom-rendering/dist/CommentCount-importable.client.web.********************.js 3.27 kB +4 B (+0.12%)
dotcom-rendering/dist/DiscussionApps-importable.client.web.********************.js 1.81 kB 0 B
dotcom-rendering/dist/DiscussionMeta-importable.client.web.********************.js 3.08 kB +2 B (+0.06%)
dotcom-rendering/dist/DiscussionWeb-importable.client.web.********************.js 1.67 kB +2 B (+0.12%)
dotcom-rendering/dist/DocumentBlockComponent-importable.client.web.********************.js 3.55 kB -14 B (-0.39%)
dotcom-rendering/dist/EmbedBlockComponent-importable.client.web.********************.js 4.1 kB -13 B (-0.32%)
dotcom-rendering/dist/EnhancePinnedPost-importable.client.web.********************.js 2.01 kB 0 B
dotcom-rendering/dist/FetchOnwardsData-importable.client.web.********************.js 2.44 kB +2 B (+0.08%)
dotcom-rendering/dist/FocusStyles-importable.client.web.********************.js 623 B +13 B (+2.13%)
dotcom-rendering/dist/FollowWrapper-importable.client.web.********************.js 842 B -1 B (-0.12%)
dotcom-rendering/dist/FooterLabel-importable.client.web.********************.js 342 B 0 B
dotcom-rendering/dist/frameworks.client.web.********************.js 20.7 kB 0 B
dotcom-rendering/dist/GetMatchNav-importable.client.web.********************.js 10.9 kB 0 B
dotcom-rendering/dist/GetMatchStats-importable.client.web.********************.js 2.19 kB +1 B (+0.05%)
dotcom-rendering/dist/GetMatchTabs-importable.client.web.********************.js 2.64 kB 0 B
dotcom-rendering/dist/HeaderTopBar-importable.client.web.********************.js 7.05 kB +9 B (+0.13%)
dotcom-rendering/dist/InstagramBlockComponent-importable.client.web.********************.js 3.65 kB -5 B (-0.14%)
dotcom-rendering/dist/InteractiveAtomMessenger-importable.client.web.********************.js 854 B 0 B
dotcom-rendering/dist/InteractiveContentsBlockComponent-importable.client.web.********************.js 4.66 kB +5 B (+0.11%)
dotcom-rendering/dist/InteractiveSupportButton-importable.client.web.********************.js 3.45 kB -24 B (-0.69%)
dotcom-rendering/dist/KnowledgeQuizAtom-importable.client.web.********************.js 3.5 kB +6 B (+0.17%)
dotcom-rendering/dist/LightboxHash-importable.client.web.********************.js 434 B 0 B
dotcom-rendering/dist/LightboxLayout-importable.client.web.********************.js 6.44 kB +2 B (+0.03%)
dotcom-rendering/dist/LiveBlogEpic-importable.client.web.********************.js 3.68 kB -6 B (-0.16%)
dotcom-rendering/dist/Liveness-importable.client.web.********************.js 4.93 kB +1 B (+0.02%)
dotcom-rendering/dist/Metrics-importable.client.web.********************.js 2.97 kB 0 B
dotcom-rendering/dist/OnwardsUpper-importable.client.web.********************.js 4.08 kB +2 B (+0.05%)
dotcom-rendering/dist/PersonalityQuizAtom-importable.client.web.********************.js 3.63 kB +2 B (+0.06%)
dotcom-rendering/dist/PulsingDot-importable.client.web.********************.js 750 B 0 B
dotcom-rendering/dist/ReaderRevenueDev-importable.client.web.********************.js 469 B 0 B
dotcom-rendering/dist/readerRevenueDevUtils.client.web.********************.js 1.89 kB 0 B
dotcom-rendering/dist/RelativeTime-importable.client.web.********************.js 1.99 kB 0 B
dotcom-rendering/dist/SendAMessage-importable.client.web.********************.js 4.43 kB +15 B (+0.34%)
dotcom-rendering/dist/SendTargetingParams-importable.client.web.********************.js 2.14 kB 0 B
dotcom-rendering/dist/sentry.client.web.********************.js 765 B 0 B
dotcom-rendering/dist/SetABTests-importable.client.web.********************.js 3.77 kB 0 B
dotcom-rendering/dist/SetAdTargeting-importable.client.web.********************.js 484 B 0 B
dotcom-rendering/dist/ShareButton-importable.client.web.********************.js 1.52 kB 0 B
dotcom-rendering/dist/shimport.client.web.********************.js 2.79 kB 0 B
dotcom-rendering/dist/ShowHideContainers-importable.client.web.********************.js 648 B 0 B
dotcom-rendering/dist/StickyBottomBanner-importable.client.web.********************.js 3.94 kB +87 B (+2.26%)
dotcom-rendering/dist/SubNav-importable.client.web.********************.js 3.24 kB +10 B (+0.31%)
dotcom-rendering/dist/TopBar-importable.client.web.********************.js 3.08 kB -1 B (-0.03%)
dotcom-rendering/dist/TweetBlockComponent-importable.client.web.********************.js 1.01 kB +1 B (+0.1%)
dotcom-rendering/dist/UnsafeEmbedBlockComponent-importable.client.web.********************.js 3.66 kB -5 B (-0.14%)
dotcom-rendering/dist/VineBlockComponent-importable.client.web.********************.js 3.49 kB -10 B (-0.29%)
dotcom-rendering/dist/WeatherWrapper-importable.client.web.********************.js 5.52 kB +8 B (+0.15%)

compressed-size-action

@frederickobrien frederickobrien marked this pull request as ready for review May 21, 2024 15:43
@frederickobrien frederickobrien requested a review from a team as a code owner May 21, 2024 15:43
Copy link

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@media (min-width: 375px) and (max-width: 479px) {
height: 34px;
}
@media (min-width: 480px) and (max-width: 739px) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm interested as to why we're not using Source breakpoints here? Would you care to elaborate? Along the benefits of standardisation, there are also some very narrow edge cases that are covered by the API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch, thank you @mxdvl. Is this the kid of implementation you had in mind: 76b4ce6?

A lot of the design break points are at widths not covered in Source (or are a mix, e.g. a Source-friendly 'from' but a bespoke 'until'). Is there a way to mix the two so we're getting as much standardisation as possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, we've clarified that the breakpoints in Figma weren't prescriptive, more 'this is what it would look like at this size'. The design pixel headings have been updated to align with Source and all breakpoints in the PR now use it (7a05dfe)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be easier to not include changes to this file in this PR, so that we are purely developing in Storybook until ready to include in the main Masthead component. This should prevent the linting errors you've got here showing up

* Create a CSS grid container.
* Use jointly with Content, LeftCol & RightCol.
*
* @see https://theguardian.design/2a1e5182b/p/41be19-grids
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👨‍🍳🤌 ✨

Comment on lines 104 to 112
@media (min-width: 480px) and (max-width: 1023px) {
margin-bottom: 10px;
}
@media (min-width: 1024px) and (max-width: 1279px) {
margin-bottom: ${space[3]};
}
@media (min-width: 1280px) {
margin-bottom: 14px;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned elsewhere, we should be using source breakpoints for these media queries really.

Another tip is that it is often easier to think of media queries as:

  • define default (mobile first is best usually)
  • define first breakpoint that changes the default, starting from the lowest viewport size (ie. from.tablet). We don't need to say between usually as this is inferred.
  • define following breakpoints increasing from the previous (i.e. from.desktop)...

*
* @see https://theguardian.design/2a1e5182b/p/41be19-grids
*/
export const TitlepieceGrid = ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component seems very generic so might be worth considering, possibly in another PR, whether we want to call this "TitlepieceGrid" or some sort or more common "Grid" name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting on this for other reviewers, that this file is largely copied from the HeaderTopBarEditionDropdown component

url: edition.url,
title: edition.longTitle,
dataLinkName: nestedOphanComponents(
'nav4',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're removing "nav4" in favour of "header" which is consistent across web and apps

Suggested change
'nav4',
'header',

title: edition.longTitle,
dataLinkName: nestedOphanComponents(
'nav4',
'topbar',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'topbar',
'titlepiece',

Comment on lines 58 to 60
label={
isTabletOrSmaller ? activeEdition.id : activeEdition.title
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably shouldn't have to infer the viewport size via props. I think we could either name the prop something like "hasShortLabel" or we could do something like the following which determines the viewport size within this component rather than passing around a prop with this information.

This is how we might do it using the Hide component

{/* Version of Dropdown component below tablet size */}
<Hide from="tablet">
  <Dropdown ... />
</Hide> 

{/* Version of Dropdown component above tablet size */}
<Hide until="tablet">
  <Dropdown ... />
</Hide> 

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense though just to flag, the viewpoint size is also being used in Titlepiece to check whether the final pillar link has a line after it or not:

image

Both use the same windowWidth value for reference at the moment. Do you reckon it's cleaner to implement them independently using Hide as above?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, let me comment on that scenario separately

const pillarLinkWidth1280 = 125;
const pillarLinkWidth1440 = 136;

const editionsMenuStyles = css`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const editionsMenuStyles = css`
const editionSwitcherMenuStyles = css`

this is a really nitpicky terminology thing but "editions" is a term we largely reserve for the "Editions app" to distinguish from any other time we talk about the "edition" of the site or paper

Comment on lines +297 to +301
css={css`
position: relative;
${index > 0 &&
`padding-left: ${space[1]}px;`}
`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's much easier to read this css when it's extracted into its own appropriately named const due to the nesting levels

/>
{(index !== pillars.length - 1 ||
(index === pillars.length - 1 &&
windowWidth > 1023)) && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd advise against accessing the window object unless you really need to.

In this scenario, we can use CSS media queries directly, instead of using windowWidth. This is also preferred because it's a no JS solution.
See https://github.com/guardian/dotcom-rendering/blob/main/dotcom-rendering/docs/architecture/021-NoJS-navigation-and-accessibility.md

Comment on lines +269 to +275
<div css={guardianLogoStyles}>
<a href="https://theguardian.com">
<SvgGuardianLogo
textColor={themePalette('--masthead-nav-link-text')}
/>
</a>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be using Logo component here since that takes care of the editionalised versions

Comment on lines +247 to +256
const [windowWidth, setWindowWidth] = useState(getWindowWidth());
useEffect(() => {
const handleResize = () => {
setWindowWidth(getWindowWidth());
};
window.addEventListener('resize', handleResize);
return () => {
window.removeEventListener('resize', handleResize);
};
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CSS media queries should handle this sufficiently without using React state and effect and resize handlers etc

<div css={editionSwitcherMenuStyles}>
<TitlepieceEditionDropdown
editionId={editionId}
dataLinkName={''}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/** TODO */

Standardisation, solidarity, liberty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants