Skip to content

Commit f70031c

Browse files
authored
Upgrade tailwind v4 (#1078)
* chore: upgrade to tailwind v4 * fix issue with cm.css * format * fix inline highlighting * works by combining files * remove unused file * fix navbar hiding on desktop
1 parent 95f7996 commit f70031c

28 files changed

+1844
-1593
lines changed

package-lock.json

Lines changed: 1240 additions & 957 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88
"node": ">=20"
99
},
1010
"type": "module",
11-
"postcss": {
12-
"plugins": {
13-
"postcss-import": {},
14-
"tailwindcss/nesting": "postcss-nesting",
15-
"tailwindcss": {},
16-
"autoprefixer": {}
17-
}
18-
},
1911
"dependencies": {
2012
"@babel/generator": "^7.24.7",
2113
"@babel/parser": "^7.24.7",
@@ -69,6 +61,7 @@
6961
},
7062
"devDependencies": {
7163
"@mdx-js/react": "^2.3.0",
64+
"@tailwindcss/postcss": "^4.1.11",
7265
"autoprefixer": "^10.4.14",
7366
"cssnano": "^6.0.1",
7467
"dotenv": "^16.4.7",
@@ -79,6 +72,6 @@
7972
"postcss-nesting": "^12.1.1",
8073
"reanalyze": "^2.16.0",
8174
"simple-functional-loader": "^1.2.1",
82-
"tailwindcss": "^3.3.3"
75+
"tailwindcss": "^4"
8376
}
8477
}

pages/_app.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
// import App from 'next/app'
2-
3-
4-
//function MyApp({ Component, pageProps }) {
5-
//console.log(pageProps);
6-
//return <Component {...pageProps} />
7-
//}
8-
9-
import "styles/main.css";
10-
import "styles/utils.css";
111
import "codemirror/lib/codemirror.css";
12-
import "styles/cm.css";
132
import "styles/docson.css";
3+
import "styles/main.css";
4+
import "styles/utils.css";
145

15-
import {make as ResApp} from "src/common/App.mjs";
6+
import { make as ResApp } from "src/common/App.mjs";
167

178
export default function App(props) {
189
return <ResApp {...props} />

pages/docs/react/latest/styling.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ let make = (~active: bool) => {
114114
"text-red-600"
115115
}
116116
117-
<div className={`border-1 border-black ${activeClass}`}>
117+
<div className={`border border-black ${activeClass}`}>
118118
{React.string("Hello World")}
119119
</div>
120120
}

pages/docs/react/v0.10.0/styling.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ let make = (~active: bool) => {
114114
"text-red-600"
115115
}
116116
117-
<div className={`border-1 border-black ${activeClass}`}>
117+
<div className={`border border-black ${activeClass}`}>
118118
{React.string("Hello World")}
119119
</div>
120120
}

pages/docs/react/v0.11.0/styling.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ let make = (~active: bool) => {
114114
"text-red-600"
115115
}
116116
117-
<div className={`border-1 border-black ${activeClass}`}>
117+
<div className={`border border-black ${activeClass}`}>
118118
{React.string("Hello World")}
119119
</div>
120120
}

postcss.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
plugins: {
3+
'@tailwindcss/postcss': {},
4+
},
5+
}

src/ApiDocs.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ module SidebarTree = {
207207
) ++ " md:block md:w-48 md:-ml-4 lg:w-1/5 md:h-auto md:relative overflow-y-visible bg-white"}>
208208
<aside
209209
id="sidebar-content"
210-
className="relative top-0 px-4 w-full block md:top-[7rem] md:pt-10 md:sticky border-r border-gray-20 overflow-y-auto pb-24 h-[calc(100vh-7rem)]">
210+
className="relative top-0 px-4 w-full block md:top-28 md:pt-10 md:sticky border-r border-gray-20 overflow-y-auto pb-24 h-[calc(100vh-7rem)]">
211211
<div className="flex justify-between">
212212
<div className="w-3/4 md:w-full"> React.null </div>
213213
<button
@@ -350,7 +350,7 @@ let default = (props: props) => {
350350
| Ok({module_: {items}}) if Array.length(items) > 0 =>
351351
<div className="hidden xl:block lg:w-1/5 md:h-auto md:relative overflow-y-visible bg-white">
352352
<aside
353-
className="relative top-0 pl-4 w-full block md:top-[7rem] md:pt-4 md:sticky border-l border-gray-20 overflow-y-auto pb-24 h-[calc(100vh-7rem)]">
353+
className="relative top-0 pl-4 w-full block md:top-28 md:pt-4 md:sticky border-l border-gray-20 overflow-y-auto pb-24 h-[calc(100vh-7rem)]">
354354
<div className="hl-overline block text-gray-80 mt-16 mb-2">
355355
{"Types and values"->React.string}
356356
</div>

src/Blog.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ module FeatureCard = {
142142
}
143143
<section
144144
className="flex sm:px-4 md:px-8 lg:px-0 flex-col justify-end lg:flex-row sm:items-center h-full">
145-
<div className="w-full h-full sm:self-start md:self-auto max-h-[25.4375rem]">
145+
<div className="w-full h-full sm:self-start md:self-auto max-h-101.75">
146146
<Link href={`/blog/${slug}`} className="relative block pt-2/3">
147147
{switch badge {
148148
| Some(badge) =>
@@ -262,7 +262,7 @@ let default = (props: props): React.element => {
262262

263263
<>
264264
<div className="hidden sm:flex justify-center ">
265-
<div className="my-16 w-full max-w-[12rem]">
265+
<div className="my-16 w-full max-w-48">
266266
<CategorySelector selected=category />
267267
</div>
268268
</div>
@@ -284,7 +284,7 @@ let default = (props: props): React.element => {
284284
<main className="min-w-320 lg:align-center w-full lg:px-0 max-w-1280 pb-48">
285285
<MdxProvider components=MarkdownComponents.default>
286286
<div className="flex justify-center">
287-
<div className="w-full max-w-[66.625rem]"> content </div>
287+
<div className="w-full max-w-266.5"> content </div>
288288
</div>
289289
</MdxProvider>
290290
</main>

src/BlogArticle.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ module BlogHeader = {
9393
)}
9494
<div className="flex flex-col md:flex-row mb-12">
9595
{Array.map(authors, author =>
96-
<div key=author.username className="mt-4 md:mt-0 md:ml-8 first:ml-0 min-w-[8.1875rem]">
96+
<div key=author.username className="mt-4 md:mt-0 md:ml-8 first:ml-0 min-w-32.75">
9797
<AuthorBox author />
9898
</div>
9999
)->React.array}
@@ -102,7 +102,7 @@ module BlogHeader = {
102102
{switch articleImg {
103103
| Some(articleImg) =>
104104
<div className="-mx-8 sm:mx-0 sm:w-full bg-gray-5-tr md:mt-24">
105-
<img className="h-full w-full object-cover max-h-[33.625rem]" src=articleImg />
105+
<img className="h-full w-full object-cover max-h-134.5" src=articleImg />
106106
</div>
107107
| None =>
108108
<div className="max-w-740 w-full">

0 commit comments

Comments
 (0)