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

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

Merged
merged 3 commits into from
May 18, 2024
Merged

Conversation

delucis
Copy link
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.

Copy link

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

Copy link

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

@astrobot-houston
Copy link
Collaborator

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% 🔺)

Copy link
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
11 checks passed
@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
  ...
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.

None yet

3 participants