Skip to content

Commit 0b955a5

Browse files
committed
Tailwind 4.x
1 parent 49b054a commit 0b955a5

15 files changed

+234
-473
lines changed

astro.config.mjs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
import {defineConfig, passthroughImageService} from 'astro/config';
1+
import { defineConfig, passthroughImageService } from 'astro/config';
22
import starlight from '@astrojs/starlight';
3-
import tailwind from "@astrojs/tailwind";
43

54
// Markdown plugins
65
import links from './src/markdown/links.js';
76
import youtube from './src/markdown/youtube.js';
7+
import tailwindcss from '@tailwindcss/vite';
88

99
// https://astro.build/config
1010

1111
const site = 'https://ozzyczech.cz';
1212
export default defineConfig({
1313
site,
14+
1415
markdown: {
1516
remarkPlugins: [links, youtube]
1617
},
18+
1719
image: {
1820
service: passthroughImageService(),
1921
},
22+
2023
integrations: [
2124
starlight({
2225
title: 'Roman\'s notes',
@@ -52,7 +55,9 @@ export default defineConfig({
5255
{label: 'Hardware', collapsed: true, autogenerate: {directory: 'Hardware'}},
5356
{label: 'Povídky', collapsed: true, autogenerate: {directory: 'Povidky'}},
5457
]
55-
}),
56-
tailwind({applyBaseStyles: false})
57-
]
58+
})
59+
],
60+
vite: {
61+
plugins: [tailwindcss()]
62+
}
5863
});

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
"@astrojs/starlight-tailwind": "^3.0.0",
1717
"@astrojs/tailwind": "^6.0.0",
1818
"@sindresorhus/slugify": "^2.2.1",
19+
"@tailwindcss/vite": "^4.0.6",
1920
"astro": "^5.3.0",
2021
"prettier": "^3.5.1",
2122
"sharp": "^0.33.5",
22-
"tailwindcss": "^3.4.17",
23+
"tailwindcss": "^4.0.6",
2324
"typescript": "^5.7.3",
2425
"unist-util-visit": "^5.0.0"
2526
}

src/components/Series.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ const img = result.poster_path ? `https://image.tmdb.org/t/p/w500${result.poster
99
const link = `https://www.themoviedb.org/tv/${result.id}`;
1010
const name = result.name;
1111
---
12-
<li class="text-center !m-0">
12+
<li class="text-center m-0!">
1313
<a href={link} target="_blank" class="p-0 m-0">
14-
<img src={img} alt="${result.name}" class="rounded-lg shadow"/>
14+
<img src={img} alt="${result.name}" class="rounded-lg shadow-sm"/>
1515
</a>
16-
<a href={link} title={name} target="_blank" class="inline-flex text-sm leading-normal no-underline hover:underline !text-inherit">{name}</a>
16+
<a href={link} title={name} target="_blank" class="inline-flex text-sm leading-normal no-underline hover:underline text-inherit!">{name}</a>
1717
</li>

src/content/docs/Awesome/Watchlist.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: Watchlist
44

55
import SeriesList from '../../../components/SeriesList.astro'
66

7+
### 2025
8+
79
### 2024
810

911
<SeriesList>

src/content/docs/Web Development/Tailwind/CSS Only tooltips.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ There's a plenty of libraries (mostly JavaScript) to enable the classic tooltip
77
Lets starts with HTML code:
88

99
```html
10-
<div class="mx-auto my-20 max-w-prose divide-y rounded-2xl border shadow">
10+
<div class="mx-auto my-20 max-w-prose divide-y rounded-2xl border shadow-sm">
1111
<div class="py-20 text-center">
1212
<span aria-label="Content extra long">Hover this</span>
1313
</div>

src/content/docs/Web Development/Tailwind/Checkbox as toggle switch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Then you have to add follow code to your `tailwind.css` file:
4646

4747
@apply after:bg-white dark:after:bg-gray-50;
4848
@apply before:bg-gray-300 dark:before:bg-gray-600;
49-
@apply before:checked:bg-lime-500 dark:before:checked:bg-lime-500;
49+
@apply checked:before:bg-lime-500 dark:checked:before:bg-lime-500;
5050
@apply checked:after:duration-300 checked:after:translate-x-4;
5151

5252
@apply disabled:after:bg-opacity-75 disabled:cursor-not-allowed;

src/content/docs/Web Development/Tailwind/Dropdown menu.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Let's have button first:
1717
<button
1818
data-dropdown="userMenu"
1919
aria-expanded="false"
20-
class="border rounded py-2 px-3 shadow"
20+
class="border rounded-sm py-2 px-3 shadow-sm"
2121
l
2222
>
2323
Show menu
@@ -29,7 +29,7 @@ and some simple dropdown menu:
2929
```html
3030
<div
3131
id="userMenu"
32-
class="hidden z-50 w-60 text-base bg-white rounded divide-y divide-gray-200 focus:outline-none"
32+
class="hidden z-50 w-60 text-base bg-white rounded-sm divide-y divide-gray-200 focus:outline-hidden"
3333
>
3434
<ul>
3535
<li>

src/content/docs/Web Development/Tailwind/Form validation with Tailwind.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Following [Tailwind code](https://tailwindcss.com/docs/hover-focus-and-other-sta
4444
```css
4545
/* invalid and dirty or :user*/
4646
:is(input:user-invalid, input.dirty) {
47-
@apply invalid:focus:ring-red-100 invalid:focus:dark:ring-red-500 invalid:focus:dark:ring-opacity-30;
48-
@apply invalid:dark:bg-red-800/20 invalid:dark:border-red-900;
47+
@apply invalid:focus:ring-red-100 dark:invalid:focus:ring-red-500 dark:invalid:focus:ring-opacity-30;
48+
@apply dark:invalid:bg-red-800/20 dark:invalid:border-red-900;
4949
@apply invalid:bg-red-50 invalid:border-red-300;
5050
}
5151
```
@@ -77,7 +77,7 @@ and full CSS example:
7777
@apply placeholder-gray-500 dark:placeholder-gray-400;
7878
@apply dark:border-gray-600 dark:focus:border-gray-500;
7979

80-
@a,pply focus:ring;
80+
@a,pply focus:ring-3;
8181
@apply focus:ring-blue-200 dark:focus:ring-gray-600;
8282
@apply focus:ring-opacity-50 dark:focus:ring-opacity-50;
8383
}
@@ -88,8 +88,8 @@ and full CSS example:
8888

8989
/* invalid and dirty or :user*/
9090
:is(input:user-invalid, input.dirty) {
91-
@apply invalid:focus:ring-red-100 invalid:focus:dark:ring-red-500 invalid:focus:dark:ring-opacity-30;
92-
@apply invalid:dark:bg-red-800/20 invalid:dark:border-red-900;
91+
@apply invalid:focus:ring-red-100 dark:invalid:focus:ring-red-500 dark:invalid:focus:ring-opacity-30;
92+
@apply dark:invalid:bg-red-800/20 dark:invalid:border-red-900;
9393
@apply invalid:bg-red-50 invalid:border-red-300;
9494
}
9595
```

src/content/docs/Web Development/Tailwind/Password component.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ Then add following HTML code:
2222
name="password"
2323
autocompletetype="password"
2424
x-autocompletetype="password"
25-
class="block w-full border-gray-200 rounded-l border-t border-l border-b p-2 shadow-sm"
25+
class="block w-full border-gray-200 rounded-l border-t border-l border-b p-2 shadow-xs"
2626
placeholder="Your password"
2727
required
2828
/>
2929
<label
30-
class="cursor-pointer border shadow-sm px-3 border-y border-r m-0 pt-2 rounded-r-md hover:bg-gray-100"
30+
class="cursor-pointer border shadow-xs px-3 border-y border-r m-0 pt-2 rounded-r-md hover:bg-gray-100"
3131
>
3232
<input
3333
type="checkbox"

src/content/docs/Web Development/Tailwind/Radio select switch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This code snippet is a `radio` input based multiple select switch using Tailwind
66

77
```html
88
<div class="flex h-screen w-full items-center justify-center">
9-
<form class="w-full max-w-screen-sm">
9+
<form class="w-full max-w-(--breakpoint-sm)">
1010
<div class="mb-3">
1111
<span class="mb-0.5 inline-flex font-medium"
1212
>Please chose one option:</span

0 commit comments

Comments
 (0)