diff --git a/.changeset/enable-css-features-by-default.md b/.changeset/enable-css-features-by-default.md
new file mode 100644
index 00000000000..fa7f23b3e84
--- /dev/null
+++ b/.changeset/enable-css-features-by-default.md
@@ -0,0 +1,16 @@
+---
+"@remix-run/dev": major
+---
+
+Enable built-in PostCSS and Tailwind support by default.
+
+These tools are now automatically used within the Remix compiler if PostCSS and/or Tailwind configuration files are present in your project.
+
+If you have a custom PostCSS and/or Tailwind setup outside of Remix, you can disable these features in your `remix.config.js`.
+
+```js
+module.exports = {
+ postcss: false,
+ tailwind: false,
+};
+```
diff --git a/docs/file-conventions/remix-config.md b/docs/file-conventions/remix-config.md
index 80f6fd13bbd..93aa016aac7 100644
--- a/docs/file-conventions/remix-config.md
+++ b/docs/file-conventions/remix-config.md
@@ -72,7 +72,7 @@ The URL prefix of the browser build with a trailing slash. Defaults to
## postcss
-Whether to process CSS using [PostCSS][postcss] if `postcss.config.js` is present. Defaults to `false`.
+Whether to process CSS using [PostCSS][postcss] if `postcss.config.js` is present. Defaults to `true`.
## routes
@@ -249,7 +249,7 @@ The platform the server build is targeting, which can either be `"neutral"` or
## tailwind
-Whether to support [Tailwind functions and directives][tailwind-functions-and-directives] in CSS files if `tailwindcss` is installed. Defaults to `false`.
+Whether to support [Tailwind functions and directives][tailwind-functions-and-directives] in CSS files if `tailwindcss` is installed. Defaults to `true`.
## watchPaths
diff --git a/docs/guides/migrating-react-router-app.md b/docs/guides/migrating-react-router-app.md
index 033adcd806c..13d2d72aeb8 100644
--- a/docs/guides/migrating-react-router-app.md
+++ b/docs/guides/migrating-react-router-app.md
@@ -615,18 +615,6 @@ You'll notice on line 32 that we've rendered a `` component that replac
If you currently inject `` tags into your page client-side in your existing route components, either directly or via an abstraction like [`react-helmet`][react-helmet], you can stop doing that and instead use the `links` export. You get to delete a lot of code and possibly a dependency or two!
-### PostCSS
-
-To enable [PostCSS] support, set the `postcss` option to `true` in `remix.config.js`. Remix will then automatically process your styles with PostCSS if a `postcss.config.js` file is present.
-
-```js filename=remix.config.js
-/** @type {import('@remix-run/dev').AppConfig} */
-module.exports = {
- postcss: true,
- // ...
-};
-```
-
### CSS bundling
Remix has built-in support for [CSS Modules][css-modules], [Vanilla Extract][vanilla-extract] and [CSS side effect imports][css-side-effect-imports]. In order to make use of these features, you'll need to set up CSS bundling in your application.
@@ -757,7 +745,6 @@ Now then, go off and _remix your app_. We think you'll like what you build along
[styling-in-remix]: ./styling
[frequently-asked-questions]: ../pages/faq
[common-gotchas]: ../pages/gotchas
-[postcss]: ./styling#postcss
[css-modules]: ./styling#css-modules
[vanilla-extract]: ./styling#vanilla-extract
[css-side-effect-imports]: ./styling#css-side-effect-imports
diff --git a/docs/guides/styling.md b/docs/guides/styling.md
index 0b037f2aea5..cf1dd70ddfa 100644
--- a/docs/guides/styling.md
+++ b/docs/guides/styling.md
@@ -404,17 +404,7 @@ export const links: LinksFunction = () => {
Perhaps the most popular way to style a Remix application in the community is to use [Tailwind CSS][tailwind]. It has the benefits of inline-style collocation for developer ergonomics and is able to generate a CSS file for Remix to import. The generated CSS file generally caps out around 8-10kb, even for large applications. Load that file into the `root.tsx` links and be done with it. If you don't have any CSS opinions, this is a great approach.
-To use the built-in Tailwind support, first enable the `tailwind` option in `remix.config.js`:
-
-```js filename=remix.config.js
-/** @type {import('@remix-run/dev').AppConfig} */
-module.exports = {
- tailwind: true,
- // ...
-};
-```
-
-Install Tailwind as a dev dependency:
+To use Tailwind, first install it as a dev dependency:
```sh
npm install -D tailwindcss
@@ -470,6 +460,8 @@ If you're using VS Code, it's recommended you install the [Tailwind IntelliSense
It's recommended that you avoid Tailwind's `@import` syntax (e.g. `@import 'tailwindcss/base'`) in favor of Tailwind directives (e.g. `@tailwind base`). Tailwind replaces its import statements with inlined CSS but this can result in the interleaving of styles and import statements. This clashes with the restriction that all import statements must be at the start of the file. Alternatively, you can use [PostCSS][built-in-post-css-support] with the [postcss-import] plugin to process imports before passing them to esbuild.
+Built-in Tailwind support can be disabled by setting the `tailwind` option to `false` in `remix.config.js`.
+
## Remote Stylesheets
You can load stylesheets from any server, here's an example of loading a modern css reset from unpkg.
@@ -491,17 +483,7 @@ export const links: LinksFunction = () => {
[PostCSS][postcss] is a popular tool with a rich plugin ecosystem, commonly used to prefix CSS for older browsers, transpile future CSS syntax, inline images, lint your styles and more. When a PostCSS config is detected, Remix will automatically run PostCSS across all CSS in your project.
-For example, to use [Autoprefixer][autoprefixer], first enable the `postcss` option in `remix.config.js`:
-
-```js filename=remix.config.js
-/** @type {import('@remix-run/dev').AppConfig} */
-module.exports = {
- postcss: true,
- // ...
-};
-```
-
-Install the PostCSS plugin.
+For example, to use [Autoprefixer][autoprefixer], first install the PostCSS plugin.
```sh
npm install -D autoprefixer
@@ -531,6 +513,8 @@ module.exports = (ctx) => {
};
```
+Built-in PostCSS support can be disabled by setting the `postcss` option to `false` in `remix.config.js`.
+
## CSS Preprocessors
You can use CSS preprocessors like LESS and SASS. Doing so requires running an additional build process to convert these files to CSS files. This can be done via the command line tools provided by the preprocessor or any equivalent tool.
diff --git a/integration/deterministic-build-output-test.ts b/integration/deterministic-build-output-test.ts
index 458035340fc..c8c107d06ed 100644
--- a/integration/deterministic-build-output-test.ts
+++ b/integration/deterministic-build-output-test.ts
@@ -27,7 +27,6 @@ test("builds deterministically under different paths", async () => {
// * vanillaExtractPlugin (via app/routes/foo.tsx' .css.ts file import)
let init: FixtureInit = {
config: {
- postcss: true,
future: {
v2_routeConvention: true,
},
diff --git a/integration/hmr-log-test.ts b/integration/hmr-log-test.ts
index 4dc69a71426..1691476cf5d 100644
--- a/integration/hmr-log-test.ts
+++ b/integration/hmr-log-test.ts
@@ -13,7 +13,6 @@ test.setTimeout(120_000);
let fixture = (options: { appPort: number; devPort: number }): FixtureInit => ({
config: {
serverModuleFormat: "cjs",
- tailwind: true,
future: {
v2_dev: {
port: options.devPort,
diff --git a/integration/hmr-test.ts b/integration/hmr-test.ts
index 476040777ba..8df8a747317 100644
--- a/integration/hmr-test.ts
+++ b/integration/hmr-test.ts
@@ -13,7 +13,6 @@ test.setTimeout(150_000);
let fixture = (options: { appPort: number; devPort: number }): FixtureInit => ({
config: {
serverModuleFormat: "cjs",
- postcss: true,
future: {
v2_dev: {
port: options.devPort,
diff --git a/integration/postcss-test.ts b/integration/postcss-test.ts
index c78c7bf9946..2d689632e08 100644
--- a/integration/postcss-test.ts
+++ b/integration/postcss-test.ts
@@ -34,8 +34,6 @@ test.describe("PostCSS enabled", () => {
test.beforeAll(async () => {
fixture = await createFixture({
config: {
- postcss: true,
- tailwind: true,
future: {
v2_routeConvention: true,
},
@@ -350,92 +348,6 @@ test.describe("PostCSS enabled", () => {
});
});
-test.describe("PostCSS enabled via unstable future flag", () => {
- let fixture: Fixture;
- let appFixture: AppFixture;
-
- test.beforeAll(async () => {
- fixture = await createFixture({
- config: {
- future: {
- unstable_postcss: true,
- },
- },
- files: {
- "postcss.config.js": js`
- module.exports = (ctx) => ({
- plugins: [
- {
- postcssPlugin: 'replace',
- Declaration (decl) {
- decl.value = decl.value
- .replace(
- /TEST_PADDING_VALUE/g,
- ${JSON.stringify(TEST_PADDING_VALUE)},
- );
- },
- },
- ],
- });
- `,
- "app/root.jsx": js`
- import { Links, Outlet } from "@remix-run/react";
- export default function Root() {
- return (
-
-