-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
Add a Tailwind plugin and docs #337
Conversation
🦋 Changeset detectedLatest commit: adf7903 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs LGTM! So excited for this feature!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs and example Markdown files all look great to me! Only added a small, non-blocking comment 🙌
Super neat and clean ✨ I assume the Small question: any specific reason to use a |
Mainly that it's what I actually tried and all extensions work here (also
Ah yes, I'd been meaning to do that. Currently Update: Proposed support for this here: withastro/astro#7993 |
Makes total sense, thanks.
Ah yeah, that would be great indeed. |
Hey @delucis this looks awesome. Providing a
Even shorter would be |
I noticed two things while playing around with a custom theme.
Dev mode with Build output with I checked the generated CSS content. It does contain A workaround would be to add the
/* needs base directive otherwise vite throws: `@layer base` is used but no matching `@tailwind base` directive is present. */
@tailwind base;
@layer base {
/* Dark Theme */
:root {
--sl-color-white: theme('colors.white');
--sl-color-gray-1: theme('colors.gray.200');
--sl-color-gray-2: theme('colors.gray.300');
--sl-color-gray-3: theme('colors.gray.500');
--sl-color-gray-4: theme('colors.gray.600');
--sl-color-gray-5: theme('colors.gray.700');
--sl-color-gray-6: theme('colors.gray.950'); /* darker toolbar/sidebar */
--sl-color-black: theme('colors.gray.800'); /* brighter content */
}
} The custom theme styles are overridden by the styles provided by the In build output, the custom styles take effect over the Perhaps allowing |
Thanks for testing @marcjulian! Which Astro version was this with? |
|
Thanks for the testing and feedback @marcjulian! I’ve moved the docs and starter template back to the |
Yes using |
What kind of changes does this PR include?
Description
@astrojs/starlight-tailwind
, which will configure Tailwind for compatibility with Starlightborder
styling)data-theme
attributegray
andaccent
in Tailwind’stheme.colors
config.sans
andmono
in Tailwind’stheme.fontFamily
config.examples/tailwind/
Big shout out to @marcjulian for many of the tips in #88 that helped shape the work here. Very curious to hear feedback from folks about whether this solution works or not.
To do
Try it
Keeping this a draft while we wait for withastro/astro#7563 to be fixed, but you can try the starter template by cloning this branch, installing dependencies, then running
cd examples/tailwind && pnpm dev
.