Skip to content

Commit

Permalink
docs(guides/styling): add Tailwind import warning (#6346)
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish authored May 8, 2023
1 parent bac8b5b commit c90b16b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/guides/styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ Note that if you're also using Remix's [built-in PostCSS support][built-in-post-

If you're using VS Code, it's recommended you install the [Tailwind IntelliSense extension][tailwind-intelli-sense-extension] for the best developer experience.

<docs-warning>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.</docs-warning>

## Remote Stylesheets

You can load stylesheets from any server, here's an example of loading a modern css reset from unpkg.
Expand Down Expand Up @@ -822,3 +824,4 @@ module.exports = {
[css-modules]: #css-modules
[vanilla-extract-3]: #vanilla-extract
[css-side-effect-imports-2]: #css-side-effect-imports
[postcss-import]: https://github.com/postcss/postcss-import

0 comments on commit c90b16b

Please sign in to comment.