docs: add Tailwind instructions on how to use multiple configs#3198
docs: add Tailwind instructions on how to use multiple configs#3198HiDeoo wants to merge 2 commits intowithastro:mainfrom
Conversation
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
|
Is the Starlight with Tailwind example going to be updated to match these instructions? It sounds like we should get Just like someone might add Starlight to an Astro project, the other way around is also logical; I should be able to easily add custom Astro pages to a Starlight project. |
Not something planned with this approach as described at the end of the PR body. I'm working on another PR as an alternative to this one, doing what you described and taking another approach for the docs that I plan to share with the team to discuss the pros/cons of both approaches. |
|
Closing in favour of #3273! |

Description
This PR updates the Tailwind instructions to help with issue 6 in #3162:
My initial assessment was only focusing on the case of using Starlight at a subpath.
My initial idea was to add a small sentence in the existing Tailwind instructions, e.g.:
After discussing the topic during Talking and Doc'ing, the idea of creating a entirely new sub-section "Add site-wide Tailwind support with Starlight at a subpath" was identified as a better approach. Even though it was vaguely similar to the existing "Add Tailwind to an existing project" section, it gives the user better instructions, and in the "Tailwind CSS" intro section, we can link to the various possible setups.
When working on the PR and checking various support threads, I realized that this setup may not only be useful for Starlight at a subpath, but also for users who want to use custom pages.
This PR keeps the new idea of creating a new sub-section but tries to cover both use cases: custom pages and Starlight at a subpath.
Other ideas discarded during T&D:
Not re-using
src/styles/global.cssin our "Add Tailwind to an existing project" section but instead creating a newsrc/styles/starlight.cssfile so that it's more obvious that this file is only used for Starlight and the other one is only used for the main site/custom pages.This was discarded because
src/styles/global.cssis automatically scaffolded by Astro and this use-case is still a small percentage of users. That would mean that most people would end up with ansrc/styles/global.cssfile that they don't need.