I am developing an Angular 16 project with Tailwind CSS V3 installed. I have followed the official docs and it seems everything works; but I can´t understand why some classes work and others not.
For example, I can have this piece of code, trying to set the color of my test:
<div class="text-red-500 font-bold">
this text is supposed to be red and bold
</div>
the text displayed will have the font weight bold but the color will not be red color and i always have to edit it using traditionnal scss Thanks for taking a look on this.
I add the code of the styles.scss , tailwind.config and package.json
styles.scss
@tailwind base;
@tailwind components;
@tailwind utilities;
@import url('https://fonts.googleapis.com/css2family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,300&display=swap');
:root {
--gray-color: #979797;
--primary-green: #05bf95;
}
Tailwind config file:
module.exports = {
content: [
"./src/**/*.{html,ts}",
],
theme: {
extend: {},
},
plugins: [
],
}
package.json file:
{
"name": "position-web",
"version": "1.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test --no-watch --no-progress --code-coverage",
"lint": "ng lint",
"pretty-quick": "pretty-quick"
},
"private": true,
"dependencies": {
"@angular/animations": "^16.0.0",
"@angular/common": "^16.0.0",
"@angular/compiler": "^16.0.0",
"@angular/core": "^16.0.0",
"@angular/forms": "^16.0.0",
"@angular/platform-browser": "^16.0.0",
"@angular/platform-browser-dynamic": "^16.0.0",
"@angular/router": "^16.0.0",
"@ngrx/effects": "^16.0.1",
"@ngrx/entity": "^16.0.1",
"@ngrx/router-store": "^16.0.1",
"@ngrx/store": "^16.0.1",
"@ngrx/store-devtools": "^16.0.1",
"ngx-translate-multi-http-loader": "^16.0.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.0.5",
"@angular-eslint/builder": "^16.0.3",
"@angular-eslint/eslint-plugin": "^16.0.3",
"@angular-eslint/eslint-plugin-template": "^16.0.3",
"@angular-eslint/schematics": "^16.0.3",
"@angular-eslint/template-parser": "^16.0.3",
"@angular/cli": "~16.0.5",
"@angular/compiler-cli": "^16.0.0",
"@types/geojson": "^7946.0.10",
"@types/jasmine": "~4.3.0",
"@types/maplibre-gl": "^1.14.0",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"autoprefixer": "^10.4.14",
"daisyui": "^3.0.23",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-ngrx": "^2.1.4",
"eslint-plugin-prettier": "^4.2.1",
"i": "^0.3.7",
"jasmine-core": "~4.6.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"postcss": "^8.4.24",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"tailwindcss": "^3.3.2",
"typescript": "~5.0.2"
}
}