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

Remove nested CSS from <FileTree> component #1608

Merged
merged 2 commits into from Mar 19, 2024

Conversation

HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Mar 6, 2024

What kind of changes does this PR include?

  • Changes to Starlight code

Description

This PR prevents a potential warning when using Tailwind CSS with Starlight due to the <FileTree> component containing nested CSS.

How I tested this change:

  • Without the changes, run pnpm dev in examples/tailwind/ and load a page in a browser. The console should show a warning about nested CSS.

    [WARN] [vite] [vite:css] Nested CSS was detected, but CSS nesting has not been configured correctly.
    Please enable a CSS nesting plugin *before* Tailwind in your configuration.
    See how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting
    29 |  		max-width: 100%;
    30 |
    31 |  		&::marker,
      |    ^^^^^^^^^^
    32 |  		&::-webkit-details-marker {
      |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    33 |  			color: var(--sl-color-gray-3);
      |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    34 |  		}
      |  ^^^
    
  • With the changes, running the same scenario does not show the warning.

Copy link

changeset-bot bot commented Mar 6, 2024

🦋 Changeset detected

Latest commit: 00c6790

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

Copy link

vercel bot commented Mar 6, 2024

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

Name Status Preview Updated (UTC)
starlight ✅ Ready (Inspect) Visit Preview Mar 19, 2024 9:04pm

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 for cleaning this up @HiDeoo! One day, we will all live in CSS nesting paradise, but for now, this will have to do 😁

@delucis delucis merged commit 4096e1b into withastro:main Mar 19, 2024
9 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Mar 19, 2024
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.

None yet

2 participants