I am trying out Tailwindcss to a new Angular 11 project. I have the following dev packages installed.
NOTE: Removed other packages for simplicity "@angular-builders/custom-webpack": "^10.0.1", "@angular-devkit/build-angular": "~0.1100.2", "@angular/cli": "~11.0.2", "@angular/compiler-cli": "~11.0.1", "autoprefixer": "^10.0.2", "postcss-import": "^13.0.0", "postcss-loader": "^4.1.0", "postcss-scss": "^3.0.4", "tailwindcss": "^2.0.1", webpack.config.js
module.exports = { module: { rules: [ { test: /\.scss$/, loader: 'postcss-loader', options: { postcssOptions: { ident: 'postcss', syntax: 'postcss-scss', plugins: () => [ require('postcss-import'), require('tailwindcss'), require('autoprefixer') ] } } } ] } } style.scss
@import "tailwindcss/base"; @import "tailwindcss/components"; @import "tailwindcss/utilities"; angular.json
"builder": "@angular-builders/custom-webpack:browser", //dev-server "customWebpackConfig": { "path": "webpack.config.js" } I added this code to app.component.html but it seems like it does not recognize the styles.
...... some codes not included <div class="px-6 pb-4 space-x-2"> <a href="https://angular.io" target="_blank" rel="noreferrer" class="inline-block bg-red-500 rounded-full px-3 py-1 text-sm font-semibold text-white hover:bg-red-700"> #angular </a> <a href="https://tailwindcss.com" target="_blank" rel="noreferrer" class="inline-block bg-indigo-500 rounded-full px-3 py-1 text-sm font-semibold text-white hover:bg-indigo-700"> #tailwind </a> <a href="https://notiz.dev" target="_blank" rel="noreferrer" class="inline-block bg-blue-200 rounded-full px-3 py-1 text-sm font-semibold text-gray-700 hover:bg-blue-400"> #notiz </a> </div>