Skip to content

Commit fdcf2e0

Browse files
authored
Merge pull request #19 from FullStacksDev/styles-tailwind-refactor
Upgrades + refactor to make Tailwind CSS v4 play nice with Angular Material
2 parents f461dd8 + 4f5bc0f commit fdcf2e0

10 files changed

+654
-610
lines changed

app/.postcssrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"plugins": {
33
"@tailwindcss/postcss": {}
44
}
5-
}
5+
}

app/.prettierrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"printWidth": 100,
3-
"tailwindConfig": "./tailwind.config.js",
3+
"tailwindStylesheet": "./src/tailwind.css",
44
"plugins": ["prettier-plugin-tailwindcss"]
55
}

app/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,32 @@
4242
"rxfire": "^6.1.0",
4343
"rxjs": "~7.8.0",
4444
"tslib": "^2.8.1",
45-
"type-fest": "^4.33.0",
45+
"type-fest": "^4.34.1",
4646
"zone.js": "~0.15.0"
4747
},
4848
"devDependencies": {
4949
"@angular-devkit/build-angular": "^19.1.6",
5050
"@angular/cli": "^19.1.6",
5151
"@angular/compiler-cli": "^19.1.5",
5252
"@ngrx/eslint-plugin": "^19.0.1",
53-
"@tailwindcss/postcss": "^4.0.0",
53+
"@tailwindcss/postcss": "^4.0.5",
5454
"@types/express": "^5.0.0",
5555
"@types/jasmine": "~5.1.5",
5656
"@types/node": "^22.13.1",
5757
"angular-eslint": "^19.0.2",
58-
"eslint": "^9.19.0",
58+
"eslint": "^9.20.0",
5959
"eslint-config-prettier": "^10.0.1",
60-
"jasmine-core": "~5.5.0",
60+
"jasmine-core": "~5.6.0",
6161
"karma": "~6.4.4",
6262
"karma-chrome-launcher": "~3.2.0",
6363
"karma-coverage": "~2.2.0",
6464
"karma-jasmine": "~5.1.0",
6565
"karma-jasmine-html-reporter": "~2.1.0",
6666
"ng-mocks": "^14.13.2",
6767
"postcss": "^8.5.1",
68-
"prettier": "^3.4.2",
68+
"prettier": "^3.5.0",
6969
"prettier-plugin-tailwindcss": "^0.6.11",
70-
"tailwindcss": "^4.0.0",
70+
"tailwindcss": "^4.0.5",
7171
"typescript": "~5.7.3",
7272
"typescript-eslint": "^8.23.0"
7373
},

app/pnpm-lock.yaml

+329-309
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/app/logbook/feature/entry-item.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { EntryFormComponent } from '../ui/entry-form.component';
2020
@let category = entry().category;
2121
@if (category) {
2222
<span class="px-2">•</span>
23-
<span class="uppercase tracking-widest text-teal-700">{{ category }}</span>
23+
<span class="tracking-widest text-teal-700 uppercase">{{ category }}</span>
2424
}
2525
</mat-card-subtitle>
2626
<mat-card-title class="py-2">

app/src/styles.scss

+21-37
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,29 @@
22
// For more information: https://material.angular.io/guide/theming
33
@use "@angular/material" as mat;
44

5-
html {
6-
background: var(--mat-sys-surface);
7-
color: var(--mat-sys-on-surface);
8-
9-
@include mat.theme(
10-
(
11-
color: (
12-
theme-type: light,
13-
primary: mat.$azure-palette,
14-
tertiary: mat.$blue-palette,
15-
),
16-
typography: Roboto,
17-
density: 0,
18-
),
19-
$overrides: (
20-
// Custom background and foreground colors
21-
surface: var(--color-slate-50),
22-
on-surface: var(--color-slate-900)
23-
)
24-
);
25-
}
26-
27-
@import "tailwindcss";
5+
@import "./tailwind.css"; // This is importing our local Tailwind CSS file
286

297
@layer base {
30-
/*
31-
The default border color has changed to `currentColor` in Tailwind CSS v4,
32-
so we've added these compatibility styles to make sure everything still
33-
looks the same as it did with Tailwind CSS v3.
34-
35-
If we ever want to remove these styles, we need to add an explicit border
36-
color utility to any element that depends on these defaults.
37-
*/
38-
*,
39-
::after,
40-
::before,
41-
::backdrop,
42-
::file-selector-button {
43-
border-color: var(--color-gray-200, currentColor);
8+
html {
9+
background: var(--mat-sys-surface);
10+
color: var(--mat-sys-on-surface);
11+
12+
@include mat.theme(
13+
(
14+
color: (
15+
theme-type: light,
16+
primary: mat.$azure-palette,
17+
tertiary: mat.$blue-palette,
18+
),
19+
typography: Roboto,
20+
density: 0,
21+
),
22+
$overrides: (
23+
// Custom background and foreground colors
24+
surface: var(--color-slate-50),
25+
on-surface: var(--color-slate-900)
26+
)
27+
);
4428
}
4529

4630
// Uncomment this out to help debug

app/src/tailwind.css

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@layer theme, base, components, utilities;
2+
3+
@import "tailwindcss/theme.css" layer(theme);
4+
@import "tailwindcss/preflight.css" layer(base);
5+
@import "tailwindcss/utilities.css" layer(utilities) important;
6+
7+
@layer base {
8+
/*
9+
The default border color has changed to `currentColor` in Tailwind CSS v4,
10+
so we've added these compatibility styles to make sure everything still
11+
looks the same as it did with Tailwind CSS v3.
12+
13+
If we ever want to remove these styles, we need to add an explicit border
14+
color utility to any element that depends on these defaults.
15+
*/
16+
*,
17+
::after,
18+
::before,
19+
::backdrop,
20+
::file-selector-button {
21+
border-color: var(--color-gray-200, currentColor);
22+
}
23+
}

firebase/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
},
2929
"devDependencies": {
3030
"@firebase/rules-unit-testing": "^4.0.1",
31-
"eslint": "^9.19.0",
31+
"eslint": "^9.20.0",
3232
"eslint-config-prettier": "^10.0.1",
3333
"firebase-functions-test": "^3.4.0",
3434
"firebase-tools": "^13.30.0",
3535
"globals": "^15.14.0",
3636
"npm-run-all": "^4.1.5",
37-
"prettier": "^3.4.2",
37+
"prettier": "^3.5.0",
3838
"typescript": "~5.7.3",
3939
"typescript-eslint": "^8.23.0",
4040
"vitest": "^3.0.5"

0 commit comments

Comments
 (0)