Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/many-cloths-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@r4ai/remark-callout": patch
---

update Astro Tailwind CSS setup to @tailwindcss/vite
19 changes: 8 additions & 11 deletions packages/remark-callout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,25 +128,22 @@ yields:

<https://github.com/r4ai/remark-callout/blob/40d857e9885d335ca0c688d6eb2755e54dd2567b/packages/website/src/pages/playground/_callout.css#L1-L384>

To use the above CSS, you need to configure Astro's TailwindCSS integration to support nested syntax:
The above CSS uses nested syntax. If you are using Tailwind CSS v4 with the [`@tailwindcss/vite`](https://tailwindcss.com/docs/installation/framework-guides/astro) plugin (recommended for Astro ≥ 5.2), CSS nesting is supported natively and no extra configuration is needed:

```ts
// astro.config.ts
import { defineConfig } from 'astro/config';
import tailwind from '@astrojs/tailwind';
import { defineConfig } from "astro/config";
import tailwindcss from "@tailwindcss/vite";

export default defineConfig({
integrations: [
tailwind({
// Example: Allow writing nested CSS declarations
// alongside Tailwind's syntax
nesting: true,
}),
],
vite: {
plugins: [tailwindcss()],
},
});
```

cf. <https://docs.astro.build/en/guides/integrations-guide/tailwind/#nesting>
> [!NOTE]
> The legacy `@astrojs/tailwind` integration is deprecated. See the [Tailwind CSS Astro guide](https://tailwindcss.com/docs/installation/framework-guides/astro) for the current setup instructions.

Or if you are using MDX, you can use custom components to style the callouts:

Expand Down
Loading