summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvin Bryan2025-07-11 11:50:19 +0100
committerGitHub2025-07-11 12:50:19 +0200
commit13e344035cf39f661571891e5738c1a8efbc9533 (patch)
tree5ed6244d245258d00e4048c950d588edd40b96f5
parente32ca800813ad615f273e4509038b2f1a251a360 (diff)
downloadIT.starlight-13e344035cf39f661571891e5738c1a8efbc9533.tar.gz
IT.starlight-13e344035cf39f661571891e5738c1a8efbc9533.tar.bz2
IT.starlight-13e344035cf39f661571891e5738c1a8efbc9533.zip
Make targeting sidebar links with CSS a little easier (#3281)
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
-rw-r--r--.changeset/breezy-months-kneel.md5
-rw-r--r--packages/starlight/components/SidebarSublist.astro2
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/breezy-months-kneel.md b/.changeset/breezy-months-kneel.md
new file mode 100644
index 00000000..4d5391b4
--- /dev/null
+++ b/.changeset/breezy-months-kneel.md
@@ -0,0 +1,5 @@
+---
+"@astrojs/starlight": patch
+---
+
+Adds a `sl-sidebar-link` class to sidebar links
diff --git a/packages/starlight/components/SidebarSublist.astro b/packages/starlight/components/SidebarSublist.astro
index a027f565..3379e59f 100644
--- a/packages/starlight/components/SidebarSublist.astro
+++ b/packages/starlight/components/SidebarSublist.astro
@@ -21,7 +21,7 @@ const { sublist, nested } = Astro.props;
<a
href={entry.href}
aria-current={entry.isCurrent && 'page'}
- class:list={[{ large: !nested }, entry.attrs.class]}
+ class:list={['sl-sidebar-link', { large: !nested }, entry.attrs.class]}
{...entry.attrs}
>
<span>{entry.label}</span>