From 04ff8d2d8654b421c9800cdc4c38042303a04dac Mon Sep 17 00:00:00 2001 From: Marjan Kalanaki Date: Wed, 25 Jun 2025 17:45:25 +0100 Subject: [PATCH 1/4] Add gallery sub meta Co-authored-by: Jamie B <53781962+JamieB-gu@users.noreply.github.com> --- dotcom-rendering/src/components/SubMeta.tsx | 34 ++++++++++++------- .../src/layouts/GalleryLayout.tsx | 14 +++++++- dotcom-rendering/src/paletteDeclarations.ts | 14 +++++--- 3 files changed, 45 insertions(+), 17 deletions(-) diff --git a/dotcom-rendering/src/components/SubMeta.tsx b/dotcom-rendering/src/components/SubMeta.tsx index aa1ac68b959..af29616b8c2 100644 --- a/dotcom-rendering/src/components/SubMeta.tsx +++ b/dotcom-rendering/src/components/SubMeta.tsx @@ -1,4 +1,4 @@ -import { css } from '@emotion/react'; +import { css, type SerializedStyles } from '@emotion/react'; import { from, space, @@ -7,13 +7,15 @@ import { until, } from '@guardian/source/foundations'; import { LinkButton } from '@guardian/source/react-components'; +import { grid } from '../grid'; import { ArticleDesign, type ArticleFormat } from '../lib/articleFormat'; import type { BaseLinkType } from '../model/extract-nav'; import { palette } from '../palette'; import { Island } from './Island'; import { ShareButton } from './ShareButton.importable'; -const labelStyles = css` +const labelStyles = (design: ArticleDesign): SerializedStyles => css` + ${design === ArticleDesign.Gallery ? grid.column.centre : undefined}; ${textSans12}; display: block; color: ${palette('--sub-meta-label-text')}; @@ -46,7 +48,7 @@ const setMetaWidth = css` } `; -const listStyleNone = css` +const listStyles = css` list-style: none; /* https://developer.mozilla.org/en-US/docs/Web/CSS/list-style#accessibility_concerns */ /* Needs double escape char: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#es2018_revision_of_illegal_escape_sequences */ @@ -79,7 +81,8 @@ const listStyleNone = css` background-repeat: no-repeat; `; -const listWrapper = css` +const listWrapper = (design: ArticleDesign): SerializedStyles => css` + ${design === ArticleDesign.Gallery ? grid.column.centre : undefined}; padding-bottom: 0.75rem; margin-bottom: 6px; border-bottom: 1px solid ${palette('--article-border')}; @@ -146,17 +149,23 @@ export const SubMeta = ({ return (
{hasLinks && ( <> - Explore more on these topics -
-