Skip to content

Revert #3281#3291

Merged
delucis merged 1 commit intomainfrom
chris/revert-sidebar-classname
Jul 11, 2025
Merged

Revert #3281#3291
delucis merged 1 commit intomainfrom
chris/revert-sidebar-classname

Conversation

@delucis
Copy link
Copy Markdown
Member

@delucis delucis commented Jul 11, 2025

Description

  • This PR reverts the changes made in Make targeting sidebar links with CSS a little easier #3281

  • In Make targeting sidebar links with CSS a little easier #3281 we initially agreed to add a class name to every link in the sidebar. After approving and merging, I realised I hadn’t considered all the implications.

  • Sidebars are one of the heftier parts of Starlight’s HTML output. Especially for larger sites. For example, Astro’s docs currently include 215 links in its sidebar. This means any changes to sidebar entry markup can quickly accumulate given they can be reproduced 100s of time on every page (in the uncached HTML). Using the Astro docs example, this adds up to multiple kilobytes per page.

  • Given this, we discussed it a bit with the team and decided adding a class name like this is not justified. It is already feasible to target these links with CSS:

    .sidebar-content a { /* styles */ }

    Adding a dedicated class name doesn’t provide any new functionality that is not currently available, and adds bloat to the HTML output, which may prove significant for content-heavy sites.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jul 11, 2025

⚠️ No Changeset found

Latest commit: c7cd482

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link
Copy Markdown

netlify bot commented Jul 11, 2025

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit c7cd482
🔍 Latest deploy log https://app.netlify.com/projects/astro-starlight/deploys/68714d3eae93740008865c8c
😎 Deploy Preview https://deploy-preview-3291--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Jul 11, 2025
@astrobot-houston
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
/index.html 7.21 KB (0%)
/_astro/*.js 25.76 KB (0%)
/_astro/*.css 14.25 KB (0%)

Copy link
Copy Markdown
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@delucis delucis merged commit 46524ac into main Jul 11, 2025
16 checks passed
@delucis delucis deleted the chris/revert-sidebar-classname branch July 11, 2025 17:48
HiDeoo added a commit to shubham-padia/starlight that referenced this pull request Jul 15, 2025
* main: (26 commits)
  [ci] release (withastro#3296)
  Fix slug override with `/` value (withastro#3293)
  i18n(fr): update `guides/i18n.mdx` (withastro#3294)
  i18n(ko-KR): update `i18n.mdx` (withastro#3292)
  [ci] release (withastro#3286)
  Revert withastro#3281 (withastro#3291)
  i18n(de): update `guides/i18n.mdx` (withastro#3289)
  Fix Astro i18n config default locale issue (withastro#3288)
  docs: fix `t.exists()` documentation + example (withastro#3287)
  Make targeting sidebar links with CSS a little easier (withastro#3281)
  i18n(fr): update `resources/plugins.mdx` (withastro#3284)
  Extract main padding to CSS custom property  (withastro#3282)
  i18n(de): update plugins translation (withastro#3285)
  i18n(ko-KR): update `plugins.mdx` (withastro#3283)
  Add link to the codeblock-fullscreen plugin (withastro#3279)
  Fix TabItem typo in zh-cn authoring-content.mdx (withastro#3268) (withastro#3269)
  [ci] format
  i18n(ru): update translations (withastro#3270)
  Update `sharp` in docs & examples to latest (withastro#3261)
  Add missing danish UI translations (withastro#3252)
  ...
Yoxnear pushed a commit to Yoxnear/starlight-custom that referenced this pull request Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌟 core Changes to Starlight’s main package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants