Skip to content

Micro-optimization: clean up <details> CSS#1892

Merged
delucis merged 3 commits intomainfrom
chris/details-mini-op
May 18, 2024
Merged

Micro-optimization: clean up <details> CSS#1892
delucis merged 3 commits intomainfrom
chris/details-mini-op

Conversation

@delucis
Copy link
Copy Markdown
Member

@delucis delucis commented May 17, 2024

Description

  • I realised we could simplify the CSS for the <details> element a little bit by avoiding to repeat the hover selector logic when setting the custom colours inside asides
  • Also makes it a bit easier for customisation. For example, in Astro Docs I wanted to add an extra custom colour where we have <details> in a purple container. Currently that requires duplicating (again) the :hover selectors. With this change it can be done just with the two custom properties.

@vercel
Copy link
Copy Markdown

vercel bot commented May 17, 2024

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

Name Status Preview Updated (UTC)
starlight ✅ Ready (Inspect) Visit Preview May 17, 2024 10:06pm
1 Ignored Deployment
Name Status Preview Updated (UTC)
starlight-i18n ⬜️ Ignored (Inspect) May 17, 2024 10:06pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented May 17, 2024

🦋 Changeset detected

Latest commit: 4701cc8

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 Patch

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

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

astrobot-houston commented May 17, 2024

size-limit report 📦

Path Size
/index.html 5.26 KB (0%)
/_astro/*.js 21.81 KB (0%)
/_astro/*.css 13.79 KB (+0.03% 🔺)

@delucis delucis added the 🌟 patch Change that triggers a patch release label May 17, 2024
Copy link
Copy Markdown
Member

@HiDeoo HiDeoo left a comment

Choose a reason for hiding this comment

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

Excellent catch, looks like a great change to me 👍

@delucis delucis merged commit 01de9be into main May 18, 2024
@delucis delucis deleted the chris/details-mini-op branch May 18, 2024 13:17
@astrobot-houston astrobot-houston mentioned this pull request May 18, 2024
HiDeoo added a commit to HiDeoo/starlight that referenced this pull request May 20, 2024
* main: (45 commits)
  i18n(tr): add `showcase.mdx` (withastro#1896)
  [ci] format
  i18n(zh-cn): Update `authoring-content.md` (withastro#1901)
  [ci] format
  [ci] release (withastro#1897)
  [ci] format
  i18n(tr): update `authoring-content.md` (withastro#1887)
  Micro-optimization: clean up `<details>` CSS (withastro#1892)
  [ci] format
  i18n(tr): update `components.md` file (withastro#1889)
  [ci] format
  i18n(tr): add css-and-tailwind (withastro#1893)
  [ci] format
  [ci] release (withastro#1890)
  Adds custom styles for `<details>` and `<summary>` elements in Markdown content (withastro#1735)
  Update @astrojs/mdx to v3 (withastro#1846)
  [ci] format
  [ci] release (withastro#1869)
  Add BlueSky social icon (withastro#1871)
  [ci] format
  ...
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 🌟 patch Change that triggers a patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants