Skip to content

Commit 251c85e

Browse files
committed
Style pagination component for journeys
Add page-specific styling and ensure that links are targeted as direct children to prevent inherited styles for the detail area. The media query of 30rem is still mostly relevant, even if the journey tends to break the detail into three lines, however these viewports are in the tablet dead zone. Regardless, the content renders fine, even if not exactly as desired.
1 parent b576272 commit 251c85e

1 file changed

Lines changed: 31 additions & 1 deletion

File tree

src/astro/styles/components/_pagination.scss

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ nav[aria-label='Pagination'] {
1010
grid-template-columns: 1fr var(--pagination_middle-column-width) 1fr;
1111
gap: var(--spacing-8);
1212

13-
a {
13+
> a {
1414
// Remove underline from pagination links.
1515
--link_color-underline: transparent;
1616

@@ -103,6 +103,30 @@ nav[aria-label='Pagination'] {
103103
// Center the pagination text inside the grid row.
104104
text-align: center;
105105
align-self: center;
106+
// Make sure that 2 lines of text can fit without stretching the container
107+
// vertically and breking the visual alignment.
108+
line-height: var(--line-height-normal);
109+
110+
a {
111+
// Remove underline from snippet journey pagination link.
112+
--link_color-underline: transparent;
113+
114+
transition: color var(--animation-duration-short) ease;
115+
116+
@media (hover: hover) {
117+
// Only apply hover styles on devices that support hover.
118+
&:is(:hover, :focus) {
119+
color: var(--color-text);
120+
}
121+
}
122+
}
123+
124+
a,
125+
span {
126+
// Ensure that the journey pagination elements are displayed as inline blocks.
127+
// This allows for better alignment and spacing.
128+
display: inline-block;
129+
}
106130
}
107131

108132
@media (max-width: 30rem) {
@@ -127,3 +151,9 @@ nav[aria-label='Pagination'] {
127151
}
128152
}
129153
}
154+
155+
// Style the link for snippet journey pagination.
156+
main > article + nav {
157+
// Add some spacing below, based on the layout area spacing.
158+
margin-block-end: var(--layout-area-spacing);
159+
}

0 commit comments

Comments
 (0)