Replies: 2 comments
-
Hey! @deniscass I've got same question months ago but I wanted it for a luma project. (at this point to use talwind in a project is buying Hyva) But I'm working on a module that adds tailwindcss to any magento theme (it includes luma & breeze). I've already have a dirty/alpha prototype (various things are hardcoded) but it works! Some features I'm working:
Right now module is using tailwindcss v3 but I'm evaluating if I should focus on v4 (looks like it will be released on early 2025) I guess I'll finish the module in about 2 weeks or less |
Beta Was this translation helpful? Give feedback.
-
Here is a starting point based on tailwind installation instructions. 1. Install Tailwind CSScd <magento_root>
npm install -D tailwindcss
npx tailwindcss init 2. Configure Tailwind CSSReplace /** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./app/design/frontend/{{VENDOR}}/{{THEME}}/**/*.{xml,phtml,html,css,less,js}'],
theme: {
extend: {},
},
plugins: [],
} 3. Create tailwind-src.cssCreate /* @tailwind base; */
/* @tailwind components; */
@tailwind utilities;
.header.content {
@apply bg-pink-500;
} 4. Create tailwind-dist.cssCreate 5. Inject tailwind-dist.css into breeze stylesOpen or create & when (@critical) {
@import 'tailwind-dist.css';
} 6. Run tailwindcssRun the following command. It will parse all files in your theme, generate styles, and put them into tailwind-dist.css: npx tailwindcss -i ./app/design/frontend/{{VENDOR}}/{{THEME}}/web/css/tailwind-src.css -o ./app/design/frontend/{{VENDOR}}/{{THEME}}/web/css/tailwind-dist.css --watch |
Beta Was this translation helpful? Give feedback.
-
Hello everyone, what is the best way to include a CSS processor like Tailwind CSS in the layout construction integrated with Breeze?
Beta Was this translation helpful? Give feedback.
All reactions