summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Swithinbank2023-06-03 03:18:49 +0200
committerGitHub2023-06-03 03:18:49 +0200
commit2f2d3eed1e7ed48d75205cfc3169719da7fdae1a (patch)
tree5db1b44797fbfd2066e52250f8417b249eef7285
parent9783377888d162e59c421515b446a9c607a4ea62 (diff)
downloadIT.starlight-2f2d3eed1e7ed48d75205cfc3169719da7fdae1a.tar.gz
IT.starlight-2f2d3eed1e7ed48d75205cfc3169719da7fdae1a.tar.bz2
IT.starlight-2f2d3eed1e7ed48d75205cfc3169719da7fdae1a.zip
Small CSS optimisation (#107)
-rw-r--r--.changeset/plenty-ducks-attend.md5
-rw-r--r--packages/starlight/components/FallbackContentNotice.astro3
-rw-r--r--packages/starlight/components/Header.astro3
-rw-r--r--packages/starlight/components/Hero.astro6
-rw-r--r--packages/starlight/components/MobileMenuToggle.astro3
-rw-r--r--packages/starlight/components/PrevNextLinks.astro3
-rw-r--r--packages/starlight/components/Search.astro8
-rw-r--r--packages/starlight/layout/PageFrame.astro3
-rw-r--r--packages/starlight/layout/TwoColumnContent.astro6
9 files changed, 13 insertions, 27 deletions
diff --git a/.changeset/plenty-ducks-attend.md b/.changeset/plenty-ducks-attend.md
new file mode 100644
index 00000000..981659d3
--- /dev/null
+++ b/.changeset/plenty-ducks-attend.md
@@ -0,0 +1,5 @@
+---
+"@astrojs/starlight": patch
+---
+
+Small CSS size optimisation
diff --git a/packages/starlight/components/FallbackContentNotice.astro b/packages/starlight/components/FallbackContentNotice.astro
index 0faf151b..ba54e212 100644
--- a/packages/starlight/components/FallbackContentNotice.astro
+++ b/packages/starlight/components/FallbackContentNotice.astro
@@ -9,7 +9,7 @@ interface Props {
const t = useTranslations(Astro.props.locale);
---
-<p>
+<p class="flex">
<Icon
name={'warning'}
size="1.5em"
@@ -25,7 +25,6 @@ const t = useTranslations(Astro.props.locale);
color: var(--sl-color-orange-high);
width: max-content;
max-width: 100%;
- display: flex;
align-items: center;
gap: 0.75em;
font-size: var(--sl-text-body-sm);
diff --git a/packages/starlight/components/Header.astro b/packages/starlight/components/Header.astro
index 594b1690..258a1a06 100644
--- a/packages/starlight/components/Header.astro
+++ b/packages/starlight/components/Header.astro
@@ -12,7 +12,7 @@ interface Props {
const { locale } = Astro.props;
---
-<div class="header">
+<div class="header flex">
<SiteTitle {locale} />
<Search {locale} />
<div class="hidden md:flex right-group">
@@ -24,7 +24,6 @@ const { locale } = Astro.props;
<style>
.header {
- display: flex;
gap: var(--sl-nav-gap);
justify-content: space-between;
align-items: center;
diff --git a/packages/starlight/components/Hero.astro b/packages/starlight/components/Hero.astro
index 942eabd8..d16a60e2 100644
--- a/packages/starlight/components/Hero.astro
+++ b/packages/starlight/components/Hero.astro
@@ -27,7 +27,7 @@ const {
alt={image.alt}
/>
) : (
- image?.html && <div class="hero-html" set:html={image.html} />
+ image?.html && <div class="hero-html flex" set:html={image.html} />
)
}
<div class="flex stack">
@@ -63,10 +63,6 @@ const {
margin-inline: auto;
}
- .hero-html {
- display: flex;
- }
-
.stack {
flex-direction: column;
gap: clamp(1.5rem, calc(1.5rem + 1vw), 2rem);
diff --git a/packages/starlight/components/MobileMenuToggle.astro b/packages/starlight/components/MobileMenuToggle.astro
index e6092a50..b531d751 100644
--- a/packages/starlight/components/MobileMenuToggle.astro
+++ b/packages/starlight/components/MobileMenuToggle.astro
@@ -14,7 +14,7 @@ const t = useTranslations(Astro.props.locale);
aria-expanded="false"
aria-label={t('menuButton.accessibleLabel')}
aria-controls="starlight__sidebar"
- class="md:hidden"
+ class="flex md:hidden"
>
<Icon name="bars" />
</button>
@@ -64,7 +64,6 @@ const t = useTranslations(Astro.props.locale);
z-index: var(--sl-z-index-navbar);
border: 0;
border-radius: 50%;
- display: flex;
width: var(--sl-menu-button-size);
height: var(--sl-menu-button-size);
padding: 0.5rem;
diff --git a/packages/starlight/components/PrevNextLinks.astro b/packages/starlight/components/PrevNextLinks.astro
index 6e21d335..76847f91 100644
--- a/packages/starlight/components/PrevNextLinks.astro
+++ b/packages/starlight/components/PrevNextLinks.astro
@@ -15,7 +15,7 @@ const isRtl = dir === 'rtl';
const t = useTranslations(locale);
---
-<div class="pagination-links" dir={dir}>
+<div class="pagination-links flex" dir={dir}>
{
prev && (
<a href={prev.href} rel="prev">
@@ -44,7 +44,6 @@ const t = useTranslations(locale);
<style>
.pagination-links {
- display: flex;
flex-wrap: wrap;
gap: 1rem;
}
diff --git a/packages/starlight/components/Search.astro b/packages/starlight/components/Search.astro
index 08684d04..d01415ac 100644
--- a/packages/starlight/components/Search.astro
+++ b/packages/starlight/components/Search.astro
@@ -25,7 +25,7 @@ const t = useTranslations(Astro.props.locale);
</button>
<dialog style="padding:0" aria-label={t('search.label')}>
- <div class="dialog-frame">
+ <div class="dialog-frame flex">
{
/* TODO: Make the layout of this button flexible to accommodate different word lengths. Currently hard-coded for English: โ€œCancelโ€ */
}
@@ -170,7 +170,6 @@ const t = useTranslations(Astro.props.locale);
}
.dialog-frame {
- display: flex;
flex-direction: column;
gap: 1rem;
padding: 1.5rem;
@@ -179,7 +178,6 @@ const t = useTranslations(Astro.props.locale);
button[data-close-modal] {
position: absolute;
z-index: 1;
- display: flex;
align-items: center;
align-self: flex-end;
height: calc(64px * var(--pagefind-ui-scale));
@@ -213,10 +211,6 @@ const t = useTranslations(Astro.props.locale);
min-height: 15rem;
max-height: calc(100% - 8rem);
}
-
- button[data-close-modal] {
- display: none;
- }
}
</style>
diff --git a/packages/starlight/layout/PageFrame.astro b/packages/starlight/layout/PageFrame.astro
index 1775be8b..bb7224f9 100644
--- a/packages/starlight/layout/PageFrame.astro
+++ b/packages/starlight/layout/PageFrame.astro
@@ -11,7 +11,7 @@ const { hasSidebar, locale } = Astro.props;
const t = useTranslations(locale);
---
-<div class="page">
+<div class="page flex">
<header class="header"><slot name="header" /></header>
{
hasSidebar && (
@@ -30,7 +30,6 @@ const t = useTranslations(locale);
<style>
.page {
- display: flex;
flex-direction: column;
min-height: 100vh;
}
diff --git a/packages/starlight/layout/TwoColumnContent.astro b/packages/starlight/layout/TwoColumnContent.astro
index e6c6bede..3210c407 100644
--- a/packages/starlight/layout/TwoColumnContent.astro
+++ b/packages/starlight/layout/TwoColumnContent.astro
@@ -4,7 +4,7 @@ interface Props {
}
---
-<div class="container">
+<div class="lg:flex">
{
Astro.props.hasToC && (
<aside class="right-sidebar-container">
@@ -19,10 +19,6 @@ interface Props {
<style>
@media (min-width: 72rem) {
- .container {
- display: flex;
- }
-
.right-sidebar-container {
order: 2;
position: relative;