Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ToC highlighting styles to prevent UI shifts #1372

Merged
merged 3 commits into from
Jan 18, 2024

Conversation

HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Jan 15, 2024

What kind of changes does this PR include?

  • Changes to Starlight code

Description

This PR applies the suggested changes from @doodlemarks to prevent UI shifts in the table of contents when scrolling through a page.

Old New
SCR-20240115-pkop SCR-20240115-pkrj

Currently those styles are also applied on :hover and :focus, but with this update, I think we can remove that and let the default hover/focus styles kick in.

I applied this suggestion too which means that hovering the currently highlighted ToC item will change its color to the default link hover color whereas before hovering the currently highlighted ToC item would have no effect. Just wanted to mention this to make sure this is the intended behavior.

Copy link

changeset-bot bot commented Jan 15, 2024

🦋 Changeset detected

Latest commit: 0db5362

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Minor

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Jan 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
starlight ✅ Ready (Inspect) Visit Preview Jan 18, 2024 5:14pm
1 Ignored Deployment
Name Status Preview Updated (UTC)
starlight-i18n ⬜️ Ignored (Inspect) Visit Preview Jan 18, 2024 5:14pm

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Oh nice! This was on my to-do list this week — fun for someone else to do it instead 😁

Left a couple of notes, but the style change looks good to me 🙌

.changeset/young-roses-tickle.md Outdated Show resolved Hide resolved
.changeset/young-roses-tickle.md Outdated Show resolved Hide resolved
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
@HiDeoo
Copy link
Member Author

HiDeoo commented Jan 16, 2024

Thanks for the review 🙌 Just applied both suggestions:

  • The minor is a good call, UI changes are something I always tend to downplay semver-wise.
  • I like the idea of providing the code to keep the old behavior. I would never have thought of that in this case. And thinking more about it, I would not be surprised if some people would prefer the old background color change.

@delucis delucis added the 🌟 minor Change that triggers a minor release label Jan 16, 2024
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Thanks! This looks great now.

Let’s hold before merging — maybe we can get a few more changes in a new minor. I’d love to review #1175 today and have a few other styling things that could pair well with this.

@delucis
Copy link
Member

delucis commented Jan 18, 2024

Although I won’t release the minor just yet, merging this early because I can see a sidebar style issue in #1383 and want to see if it is also present with this change and then fix it once, instead of fixing it for the old styling on that branch and then maybe having to fix again for these changes. Hoping to release v0.16 tomorrow anyway, so hopefully shouldn’t block any other patches between then and now.

@delucis delucis merged commit 773880d into withastro:main Jan 18, 2024
9 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Jan 18, 2024
HiDeoo added a commit to HiDeoo/starlight that referenced this pull request Jan 23, 2024
* main: (23 commits)
  i18n(ko-KR): add`plugins.mdx` (withastro#1401)
  [ci] format
  i18n(ko-KR): add `community-content.mdx` (withastro#1402)
  i18n(ko-KR): update `site-search.mdx` (withastro#1400)
  i18n(ko-KR): add `showcase.mdx` (withastro#1403)
  [docs] new Resources sidebar section and pages (withastro#1357)
  i18n(hi): add `i18n.mdx` (withastro#1388)
  [ci] format
  [ci] release (withastro#1384)
  Restore original tighter line-height on `<LinkCard>` titles (withastro#1386)
  Refactor virtual module system for layout components (withastro#1383)
  Update astro to 4.2.1 (withastro#1385)
  fix: tree generation for autogenerated groups (withastro#1151)
  Tweak vertical spacing in Markdown content styles (withastro#1376)
  Update ToC highlighting styles to prevent UI shifts (withastro#1372)
  i18n(hi): update `index.mdx` (withastro#1380)
  [ci] format
  [ci] release (withastro#1379)
  Update dependencies (withastro#1378)
  [ci] format
  ...
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 🌟 minor Change that triggers a minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ToC highlighting UI shifts
2 participants