Skip to content

Commit a398530

Browse files
authored
Remove z-index from gallery main media (#14599)
It isn't needed for the layout. The lightbox link is absolute positioned relative to the figure, which is itself relative positioned; this allows the link to precisely overlay the image. Relative positioning the figure, however, causes it to be drawn over the headline and series link. These elements would normally appear over the top of the image because they are a) placed in the same location with CSS grid, and b) later in the DOM. Relatively positioning these elements solves this problem, and allows them to overlay the image again. In summary, this layout has already been achieved by positioning the elements, so setting additional `z-index` properties is not required.
1 parent 5b7b429 commit a398530

File tree

3 files changed

+0
-5
lines changed

3 files changed

+0
-5
lines changed

dotcom-rendering/src/components/ArticleHeadline.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ const galleryStyles = css`
398398
399399
grid-row: 7/9;
400400
position: relative;
401-
z-index: ${getZIndex('articleHeadline')};
402401
403402
${from.tablet} {
404403
${grid.between('centre-column-start', 'grid-end')};

dotcom-rendering/src/components/MainMediaGallery.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { isUndefined } from '@guardian/libs';
33
import { from } from '@guardian/source/foundations';
44
import { grid } from '../grid';
55
import { type ArticleFormat } from '../lib/articleFormat';
6-
import { getZIndex } from '../lib/getZIndex';
76
import { getImage } from '../lib/image';
87
import { type ImageBlockElement } from '../types/content';
98
import { type RenderingTarget } from '../types/renderingTarget';
@@ -23,7 +22,6 @@ const styles = css`
2322
position: relative;
2423
height: calc(80vh - 48px);
2524
grid-row: 1/8;
26-
z-index: ${getZIndex('mainMedia')};
2725
${from.desktop} {
2826
height: calc(100vh - 48px);
2927
}

dotcom-rendering/src/components/SeriesSectionLink.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
type ArticleFormat,
2020
ArticleSpecial,
2121
} from '../lib/articleFormat';
22-
import { getZIndex } from '../lib/getZIndex';
2322
import { palette as themePalette } from '../palette';
2423
import type { TagType } from '../types/tag';
2524
import { Hide } from './Hide';
@@ -372,7 +371,6 @@ export const SeriesSectionLink = ({
372371
css`
373372
display: inline-block;
374373
position: relative;
375-
z-index: ${getZIndex('articleHeadline')};
376374
`,
377375
format.display === ArticleDisplay.Immersive &&
378376
css`

0 commit comments

Comments
 (0)