Skip to content

Commit 038e6dc

Browse files
authored
chore: update Tailwind to v4 (docker#22666)
- Extract classes to utilities and components. - Reduce number of colors used. - Harmonize button colors. - Restyle admonitions. - Move **Page options** button to main article. - Various color tweaks.
1 parent f23f120 commit 038e6dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+3738
-4025
lines changed

.github/labeler.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ hugo:
179179
- hugo_stats.json
180180
- i18n/**
181181
- layouts/**
182-
- postcss.config.js
183182
- static/**
184183
- tailwind.config.js
185184

assets/css/code.css

Lines changed: 0 additions & 81 deletions
This file was deleted.

assets/css/components.css

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
@layer components {
2+
.card {
3+
@apply mt-2 mb-2 flex flex-col gap-2 rounded-sm border border-gray-200 p-3;
4+
@apply dark:border-gray-700 dark:bg-gray-900;
5+
@apply transition-shadow duration-200;
6+
&:hover,
7+
&:focus {
8+
@apply border-gray-300 dark:border-gray-600;
9+
}
10+
}
11+
.card-link:hover {
12+
@apply !no-underline;
13+
}
14+
.card-header {
15+
@apply mb-2 flex items-center gap-2;
16+
@apply text-gray-700 dark:text-gray-100;
17+
}
18+
.card-icon {
19+
@apply text-gray-700 dark:text-gray-100;
20+
}
21+
.card-img,
22+
.card-img svg {
23+
@apply m-0 flex max-h-5 min-h-5 max-w-5 min-w-5 items-center justify-center fill-current;
24+
}
25+
.card-title {
26+
@apply font-semibold;
27+
}
28+
.card-link {
29+
@apply block text-inherit no-underline hover:underline;
30+
}
31+
.card-description {
32+
@apply text-gray-600;
33+
@apply dark:text-gray-300;
34+
}
35+
36+
.admonition {
37+
@apply relative mb-4 flex w-full flex-col items-start gap-3 rounded-sm px-6 py-4;
38+
@apply bg-gray-50 dark:bg-gray-900;
39+
}
40+
.admonition-header {
41+
@apply flex flex-wrap items-center gap-2;
42+
}
43+
.admonition-title {
44+
@apply font-semibold;
45+
}
46+
.admonition-content {
47+
@apply w-full min-w-0 flex-1 flex-wrap overflow-x-auto break-words;
48+
color: var(--tw-prose-body);
49+
}
50+
.admonition-note {
51+
@apply border-blue-400 bg-blue-50 text-blue-900;
52+
@apply dark:border-blue-600 dark:bg-blue-950 dark:text-blue-100;
53+
}
54+
.admonition-tip {
55+
@apply border-green-400 bg-green-100 text-green-900;
56+
@apply dark:border-green-600 dark:bg-green-950 dark:text-green-100;
57+
}
58+
.admonition-warning {
59+
@apply border-yellow-400 bg-yellow-50 text-yellow-900;
60+
@apply dark:border-yellow-600 dark:bg-yellow-950 dark:text-yellow-100;
61+
}
62+
.admonition-danger {
63+
@apply border-red-400 bg-red-50 text-red-900;
64+
@apply dark:border-red-600 dark:bg-red-950 dark:text-red-100;
65+
}
66+
.admonition-important {
67+
@apply border-purple-400 bg-purple-50 text-purple-900;
68+
@apply dark:border-purple-600 dark:bg-purple-950 dark:text-purple-100;
69+
}
70+
.admonition-icon {
71+
@apply flex-shrink-0;
72+
width: 24px;
73+
height: 24px;
74+
min-width: 24px;
75+
min-height: 24px;
76+
display: flex;
77+
align-items: center;
78+
justify-content: center;
79+
}
80+
81+
.download-links {
82+
@apply block;
83+
@apply text-gray-800;
84+
@apply dark:text-gray-200;
85+
}
86+
.download-links a {
87+
@apply link;
88+
}
89+
.download-links-subcontainer {
90+
@apply flex flex-wrap gap-2;
91+
}
92+
93+
.card-image {
94+
@apply h-12 w-12 overflow-hidden;
95+
}
96+
}
97+
98+
.summary-bar {
99+
@apply my-1 mt-4 flex flex-col rounded-sm border-1 border-gray-100 bg-gray-50 p-4 dark:border-gray-800 dark:bg-gray-900;
100+
}

assets/css/global.css

Lines changed: 83 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,106 @@
11
/* global styles */
22

3-
@layer base {
4-
[x-cloak=""] {
3+
[x-cloak=""] {
4+
display: none !important;
5+
}
6+
/* alpine cloak for small screens only */
7+
[x-cloak="sm"] {
8+
@media (width <= 768px) {
59
display: none !important;
610
}
7-
/* alpine cloak for small screens only */
8-
[x-cloak="sm"] {
9-
@media (width <= 768px) {
10-
display: none !important;
11-
}
11+
}
12+
:root {
13+
-webkit-font-smoothing: antialiased;
14+
-moz-osx-font-smoothing: grayscale;
15+
16+
scrollbar-color: var(--color-gray-400) rgba(0, 0, 0, 0.05);
17+
&.dark {
18+
scrollbar-color: var(--color-gray-700) rgba(255, 255, 255, 0.1);
1219
}
20+
}
21+
22+
mark {
23+
@apply bg-transparent font-bold text-blue-500 dark:text-blue-800;
24+
}
1325

14-
:root {
15-
-webkit-font-smoothing: antialiased;
16-
-moz-osx-font-smoothing: grayscale;
26+
/* Hide the clear (X) button for search inputs */
27+
/* Chrome, Safari, Edge, and Opera */
28+
input[type="search"]::-webkit-search-cancel-button {
29+
-webkit-appearance: none;
30+
appearance: none;
31+
}
1732

18-
scrollbar-color: theme(colors.gray.light.400) theme(colors.black / 0.05);
19-
&.dark {
20-
scrollbar-color: theme(colors.gray.dark.800) theme(colors.white / 0.10);
33+
/* Firefox */
34+
input[type="search"]::-moz-search-cancel-button {
35+
display: none;
36+
}
37+
38+
/* Internet Explorer and Edge (legacy) */
39+
input[type="search"]::-ms-clear {
40+
display: none;
41+
}
42+
.prose {
43+
code {
44+
@apply !bg-gray-100;
45+
}
46+
& .highlight,
47+
& :not(pre) > code {
48+
.dark & {
49+
background: var(--color-gray-900) !important;
50+
border-color: var(--color-gray-700) !important;
2151
}
2252
}
53+
}
2354

24-
mark {
25-
@apply bg-transparent font-bold text-blue-light dark:text-blue-dark;
55+
.prose {
56+
li {
57+
@apply my-2;
58+
> :last-child,
59+
> :first-child {
60+
margin: 0;
61+
}
2662
}
27-
28-
/* Hide the clear (X) button for search inputs */
29-
/* Chrome, Safari, Edge, and Opera */
30-
input[type="search"]::-webkit-search-cancel-button {
31-
-webkit-appearance: none;
32-
appearance: none;
63+
hr {
64+
@apply mt-8 mb-4;
3365
}
34-
35-
/* Firefox */
36-
input[type="search"]::-moz-search-cancel-button {
37-
display: none;
66+
:where(h1):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
67+
color: var(--tw-prose-headings);
68+
font-weight: 500 !important;
69+
margin-top: 0;
70+
margin-bottom: 0.2em !important;
71+
line-height: 1.1111111;
3872
}
39-
40-
/* Internet Explorer and Edge (legacy) */
41-
input[type="search"]::-ms-clear {
42-
display: none;
73+
> h2 {
74+
@apply mt-5! mb-3! text-3xl!;
75+
a {
76+
@apply hover:no-underline!;
77+
}
4378
}
44-
}
45-
46-
/* utility classes */
47-
48-
@layer utilities {
49-
.link {
50-
@apply text-blue-light underline underline-offset-2 dark:text-blue-dark;
79+
> h3 {
80+
@apply text-2xl!;
81+
a {
82+
@apply hover:no-underline!;
83+
}
5184
}
52-
53-
.invertible {
54-
@apply dark:hue-rotate-180 dark:invert dark:filter;
85+
> h4 {
86+
a {
87+
@apply hover:no-underline!;
88+
}
5589
}
56-
57-
.bg-pattern-blue {
58-
background-color: theme(colors.white / 50%);
59-
background-image: url('/assets/images/bg-pattern-blue.webp');
60-
background-blend-mode: overlay;
61-
background-size: cover;
62-
background-repeat: none;
63-
.dark & {
64-
background-color: theme(colors.black / 70%);
90+
> h5 {
91+
a {
92+
@apply hover:no-underline!;
6593
}
6694
}
95+
ol {
96+
list-style-type: decimal;
97+
}
6798

68-
.bg-pattern-purple {
69-
background-color: theme(colors.white / 50%);
70-
background-image: url('/assets/images/bg-pattern-purple.webp');
71-
background-blend-mode: overlay;
72-
background-size: cover;
73-
background-repeat: none;
74-
.dark & {
75-
background-color: theme(colors.black / 70%);
76-
}
99+
ol ol {
100+
list-style-type: lower-alpha;
77101
}
78102

79-
.bg-pattern-verde {
80-
background-color: theme(colors.white / 50%);
81-
background-image: url('/assets/images/bg-pattern-verde.webp');
82-
background-blend-mode: overlay;
83-
background-size: cover;
84-
background-repeat: none;
85-
.dark & {
86-
background-color: theme(colors.black / 70%);
87-
}
103+
ol ol ol {
104+
list-style-type: lower-roman;
88105
}
89106
}

assets/css/icons.css

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)