Skip to content

Commit

Permalink
Merge branch 'main' into lp-update-aus-ticker-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
LAKSHMIRPILLAI authored Nov 22, 2024
2 parents ef3e657 + 9caa909 commit 5201605
Show file tree
Hide file tree
Showing 38 changed files with 230 additions and 131 deletions.
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/AdSlot.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ const mobileStickyAdStyles = css`
margin: 0 auto;
right: 0;
left: 0;
${getZIndex('mobileSticky')}
z-index: ${getZIndex('mobileSticky')};
${from.phablet} {
display: none;
}
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/ArticleHeadline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ const immersiveWrapper = css`
This z-index is what ensures the headline text shows above the pseudo black
box that extends the black background to the right
*/
${getZIndex('articleHeadline')}
z-index: ${getZIndex('articleHeadline')};
${until.mobileLandscape} {
margin-right: 40px;
}
Expand Down
12 changes: 8 additions & 4 deletions dotcom-rendering/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,9 @@ export const Card = ({
href={`${linkTo}#comments`}
cssOverrides={css`
/* See: https://css-tricks.com/nested-links/ */
${getZIndex('card-nested-link')}
z-index: ${getZIndex('card-nested-link')};
/* The following styles turn off those provided by Link */
color: inherit;
color: inherit;
/* stylelint-disable-next-line property-disallowed-list */
font-family: inherit;
font-size: inherit;
Expand Down Expand Up @@ -614,7 +614,9 @@ export const Card = ({
<div
css={css`
position: relative;
${getZIndex('card-nested-link')}
z-index: ${getZIndex(
'card-nested-link',
)};
`}
>
<Island
Expand Down Expand Up @@ -654,7 +656,9 @@ export const Card = ({
css={css`
display: block;
position: relative;
${getZIndex('card-nested-link')}
z-index: ${getZIndex(
'card-nested-link',
)};
`}
>
<Island
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const brandingWrapperStyle = css`
text-align: right;
flex: auto;
/* See: https://css-tricks.com/nested-links/ */
${getZIndex('card-nested-link')}
z-index: ${getZIndex('card-nested-link')};
position: relative;
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getZIndex } from '../../../lib/getZIndex';

const fauxLinkStyles = css`
position: absolute;
${getZIndex('card-link')};
z-index: ${getZIndex('card-link')};
top: 0;
right: 0;
bottom: 0;
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/CardHeadline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const getFontSize = (
const sublinkStyles = css`
display: block;
/* See: https://css-tricks.com/nested-links/ */
${getZIndex('card-nested-link')}
z-index: ${getZIndex('card-nested-link')};
/* The following styles turn off those provided by Link */
color: inherit;
text-decoration: none;
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/Carousel.importable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ const buttonContainerStyle = css`
flex-direction: column;
justify-content: center;
position: absolute;
${getZIndex('onwardsCarousel')}
z-index: ${getZIndex('onwardsCarousel')};
height: 100%;
padding-bottom: 36px; /* Align buttons centrally with cards */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const buttonContainerStyle = css`
flex-direction: column;
justify-content: center;
position: absolute;
${getZIndex('onwardsCarousel')}
z-index: ${getZIndex('onwardsCarousel')};
height: 100%;
padding-bottom: 36px; /* Align buttons centrally with cards */
Expand Down
30 changes: 30 additions & 0 deletions dotcom-rendering/src/components/ContainerOverrides.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,28 @@ const carouselChevronBorderDisabledDark: ContainerFunction = (
containerPalette,
) => transparentColour(cardHeadlineDark(containerPalette), 0.4);

const slideshowPaginationDotLight: ContainerFunction = (containerPalette) => {
switch (containerPalette) {
case 'BreakingPalette':
case 'InvestigationPalette':
case 'SombrePalette':
case 'SombreAltPalette':
return transparentColour(cardHeadlineLight(containerPalette), 0.4);
default:
return transparentColour(cardHeadlineLight(containerPalette), 0.2);
}
};

const slideshowPaginationDotDark: ContainerFunction = (containerPalette) =>
transparentColour(cardHeadlineDark(containerPalette), 0.4);

const slideshowPaginationDotActiveLight: ContainerFunction = (
containerPalette,
) => cardHeadlineLight(containerPalette);
const slideshowPaginationDotActiveDark: ContainerFunction = (
containerPalette,
) => cardHeadlineDark(containerPalette);

type ColourName = Parameters<typeof palette>[0];

type ContainerFunction = (containerPalette: DCRContainerPalette) => string;
Expand Down Expand Up @@ -1210,6 +1232,14 @@ const containerColours = {
light: carouselChevronHoverLight,
dark: carouselChevronHoverDark,
},
'--slideshow-pagination-dot': {
light: slideshowPaginationDotLight,
dark: slideshowPaginationDotDark,
},
'--slideshow-pagination-dot-active': {
light: slideshowPaginationDotActiveLight,
dark: slideshowPaginationDotActiveDark,
},
'--section-border': {
light: sectionBorderLight,
dark: sectionBorderDark,
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Position = ({
css={css`
/* Decide where the content revealed by details appears */
position: absolute;
${getZIndex('summaryDetails')}
z-index: ${getZIndex('summaryDetails')};
${positionStyles}
`}
>
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/Dropdown.importable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface Props {
}

const ulStyles = css`
${getZIndex('dropdown')}
z-index: ${getZIndex('dropdown')};
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 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const container = css`
position: relative;
top: 0;
background-color: ${palette.brand[800]};
${getZIndex('editionSwitcherBanner')};
z-index: ${getZIndex('editionSwitcherBanner')};
`;

const content = css`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const hideBannerStyles = css`
const stickyContainerStyles = css`
position: sticky;
top: 0;
${getZIndex('expandableMarketingCardOverlay')};
z-index: ${getZIndex('expandableMarketingCardOverlay')};
/* The component slides in from the left-hand side */
animation: slidein 2.4s linear;
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/FeatureCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const CommentCount = ({
href={`${linkTo}#comments`}
cssOverrides={css`
/* See: https://css-tricks.com/nested-links/ */
${getZIndex('card-nested-link')}
z-index: ${getZIndex('card-nested-link')};
/* The following styles turn off those provided by Link */
color: inherit;
/* stylelint-disable-next-line property-disallowed-list */
Expand Down
4 changes: 2 additions & 2 deletions dotcom-rendering/src/components/GridItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const rightColumnStyles = css`
top: 0;
right: 0;
/* Pop me below the body */
${getZIndex('rightColumnArea')}
z-index: ${getZIndex('rightColumnArea')};
@supports (display: grid) {
position: relative;
Expand All @@ -25,7 +25,7 @@ const rightColumnStyles = css`

const bodyStyles = css`
/* Pop me above the right column */
${getZIndex('bodyArea')}
z-index: ${getZIndex('bodyArea')};
`;

const gridArea = css`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const stickyNavBaseStyles = css`
background-color: ${sourcePalette.neutral[100]};
border: 1px solid ${sourcePalette.neutral[86]};
top: 0;
${getZIndex('banner')}
z-index: ${getZIndex('banner')};
`;

const olStyles = css`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export const LightboxLayout = ({ format, images }: Props) => {
html.lightbox-open {
#gu-lightbox {
position: fixed;
${getZIndex('lightbox')};
z-index: ${getZIndex('lightbox')};
}
body {
Expand Down
4 changes: 2 additions & 2 deletions dotcom-rendering/src/components/MainMedia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ const immersiveWrapper = css`
we use this grow here to ensure the content fills the available height
*/
flex-grow: 1;
${getZIndex('mainMedia')}
z-index: ${getZIndex('mainMedia')};
/* Prevent the immersive image 100vh from spilling into main content */
overflow: hidden;
overflow: hidden;
`;

const chooseWrapper = (format: ArticleFormat) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface EditionDropdownProps {
}

const editionDropdownStyles = css`
${getZIndex('mastheadEditionDropdown')};
z-index: ${getZIndex('mastheadEditionDropdown')};
display: flex;
/** Required to absolutely position the dropdown menu */
position: relative;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const expandedMenuStyles = css`
`;

const wrapperMainMenuStyles = css`
${getZIndex('expanded-veggie-menu-wrapper')}
z-index: ${getZIndex('expanded-veggie-menu-wrapper')};
left: 0;
top: 0;
Expand All @@ -62,7 +62,7 @@ const wrapperMainMenuStyles = css`
const mainMenuStyles = css`
background-color: ${themePalette('--masthead-nav-background')};
${textSans20};
${getZIndex('expanded-veggie-menu')}
z-index: ${getZIndex('expanded-veggie-menu')};
left: 0;
top: 0;
box-sizing: border-box;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const labelStyles = css`
${`#${navInputCheckboxId}`}:checked ~ div & {
${until.desktop} {
/* Bump the z-index of the burger menu when expanded */
${getZIndex('mastheadVeggieBurgerExpandedMobile')}
z-index: ${getZIndex('mastheadVeggieBurgerExpandedMobile')};
}
}
`;
Expand Down
28 changes: 19 additions & 9 deletions dotcom-rendering/src/components/SlideshowCarousel.importable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { css } from '@emotion/react';
import { space, textSansBold12, width } from '@guardian/source/foundations';
import {
from,
space,
textSansBold12,
width,
} from '@guardian/source/foundations';
import type { ThemeButton } from '@guardian/source/react-components';
import {
Button,
Expand Down Expand Up @@ -49,18 +54,18 @@ const carouselItemStyles = css`
`;

const captionStyles = css`
${textSansBold12}
position: absolute;
bottom: 0;
left: 0;
right: 0;
${textSansBold12}
color: ${palette('--slideshow-caption')};
background: linear-gradient(
to bottom,
rgba(0, 0, 0, 0) 0%,
rgba(0, 0, 0, 0.8) 100%
);
color: ${palette('--slideshow-caption')};
padding: 60px ${space[2]}px ${space[2]}px;
padding: ${space[10]}px ${space[2]}px ${space[2]}px;
`;

const navigationStyles = css`
Expand All @@ -70,20 +75,25 @@ const navigationStyles = css`
`;

const buttonStyles = css`
display: flex;
gap: ${space[2]}px;
display: none;
${from.tablet} {
display: flex;
gap: ${space[2]}px;
}
`;

/**
* Padding is added to the left of the scrolling navigation dots to match the
* width of the navigation buttons on the right. This allows them to be centred
* below the slideshow image.
* width of the navigation buttons on the right at tablet and above. This allows
* them to be centred below the slideshow image.
*/
const scrollingDotStyles = css`
display: flex;
justify-content: center;
flex: 1 0 0;
padding-left: ${width.ctaSmall * 2 + space[2]}px;
${from.tablet} {
padding-left: ${width.ctaSmall * 2 + space[2]}px;
}
`;

export const SlideshowCarousel = ({
Expand Down
Loading

0 comments on commit 5201605

Please sign in to comment.