Skip to content

Commit

Permalink
update tailwind example
Browse files Browse the repository at this point in the history
  • Loading branch information
ubermanu committed Sep 16, 2023
1 parent b13d7c0 commit 11ee02c
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions docs/examples/tailwindcss.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

The following example uses [Tailwind CSS](https://tailwindcss.com/) to generate a CSS file.

Install these packages, and initialize Tailwind CSS configuration:
Install these packages:

```sh
npm i magefront-plugin-postcss tailwindcss autoprefixer --save-dev
npx tailwindcss init -p
```

Add the following to your `magefront.config.js` file:
Expand All @@ -15,13 +14,18 @@ Add the following to your `magefront.config.js` file:
// magefront.config.js
import postcss from 'magefront-plugin-postcss'
import tailwindcss from 'tailwindcss'
import autoprefixer from 'autoprefixer'

export default {
plugins: [
postcss({
src: 'web/css/tailwind.pcss',
dest: 'css/tailwind.css',
plugins: [tailwindcss()]
src: 'css/tailwind.pcss',
plugins: [
tailwindcss({
content: ['app/design/frontend/**/*.{html,phtml}']
}),
autoprefixer()
]
})
]
}
Expand All @@ -34,12 +38,3 @@ Create a file named `tailwind.pcss` in the `web/css` directory of your theme:
@tailwind components;
@tailwind utilities;
```

Add the paths to all your templates in your `tailwind.config.js` file:

```js
/** @type {import('tailwindcss').Config} */
export default {
content: ['./**/*.{html,phtml}']
};
```

0 comments on commit 11ee02c

Please sign in to comment.