Skip to content

Commit 7680e87

Browse files
Extract main padding to CSS custom property (#3282)
Co-authored-by: Chris Swithinbank <[email protected]>
1 parent 5eea9cc commit 7680e87

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.changeset/neat-steaks-cry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@astrojs/starlight": patch
3+
---
4+
5+
Moves padding of `<main>` element to a `--sl-main-pad` CSS custom property to simplify setting custom values

packages/starlight/components/Page.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ if (pagefindEnabled) mainDataAttributes['data-pagefind-body'] = '';
6363
scroll-padding-top: calc(1.5rem + var(--sl-nav-height) + var(--sl-mobile-toc-height));
6464
}
6565
main {
66-
padding-bottom: 3vh;
66+
padding: var(--sl-main-pad);
6767
}
6868
@media (min-width: 50em) {
6969
[data-has-sidebar] {

packages/starlight/style/props.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
--sl-sidebar-pad-x: 1rem;
102102
--sl-content-width: 45rem;
103103
--sl-content-pad-x: 1rem;
104+
--sl-main-pad: 0 0 3vh 0;
104105
--sl-menu-button-size: 2rem;
105106
--sl-nav-gap: var(--sl-content-pad-x);
106107
/* Offset required to show outline inside an element instead of round the outside */

0 commit comments

Comments
 (0)