@astrojs/tailwind
6.0.2 · 26 Mar 2025MIT488.5k / weekRepositoryHomepagenpmAtom feed
In short
2 breaking1 internal
- Breaking
Rename options
config.pathtoconfigFile, andconfig.applyBaseStylestoapplyBaseStyles. If you are using these options, you need to migrate to the new names. - Breaking
Let the
tailwindcssPostCSS plugin load its config file itself. This changes the Tailwind config loading behaviour where it is loaded fromprocess.cwd()instead of the projectroot.
Release note
Major Changes
- Breaking
Rename options
config.pathtoconfigFile, andconfig.applyBaseStylestoapplyBaseStyles. If you are using these options, you need to migrate to the new names.// astro.config.mjs import { defineConfig } from 'astro/config'; import tailwind from '@astrojs/tailwind'; export default defineConfig({ integrations: [ tailwind({ - config: { - path: '...', - applyBaseStyles: true, - }, + configFile: '...', + applyBaseStyles: true, }), ], }); - Breaking
Let the
tailwindcssPostCSS plugin load its config file itself. This changes the Tailwind config loading behaviour where it is loaded fromprocess.cwd()instead of the projectroot.If your Tailwind config file is not located in the current working directory, you will need to configure the integration's
configFileoption to load from a specific path:// astro.config.mjs import { defineConfig } from 'astro/config'; import tailwind from '@astrojs/tailwind'; import { fileURLToPath } from 'url'; export default defineConfig({ integrations: [ tailwind({ configFile: fileURLToPath(new URL('./tailwind.config.cjs', import.meta.url)), }), ], });This change also requires a Tailwind config file to exist in your project as a fallback config is no longer provided. It is set up automatically during
astro add tailwind, but if it does not exist, you can manually create atailwind.config.cjsfile in your project root:// tailwind.config.cjs /** @type {import('tailwindcss').Config} */ module.exports = { content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'], theme: { extend: {}, }, plugins: [], };
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.