Skip to content

Commit a89e41e

Browse files
committed
tailwind: postcss
1 parent f2b35e5 commit a89e41e

File tree

5 files changed

+52
-2
lines changed

5 files changed

+52
-2
lines changed

packages/lexical/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"@babel/preset-env": "^7.20.2",
9595
"@babel/preset-react": "^7.18.6",
9696
"@babel/preset-typescript": "^7.21.0",
97+
"@tailwindcss/postcss": "^4.1.11",
9798
"@types/codemirror": "^5.60.4",
9899
"@types/katex": "^0.14.0",
99100
"@types/lodash-es": "^4.17.6",

packages/lexical/postcss.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
module.exports = {
2-
plugins: [require('tailwindcss'), require('autoprefixer')],
2+
plugins: {
3+
'@tailwindcss/postcss': {},
4+
autoprefixer: {},
5+
}
36
};

packages/lexical/src/examples/AppNbformat.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,21 @@ export function AppNbformat() {
126126
</LexicalProvider>
127127
</Jupyter>
128128
<div className="other App">
129+
{/* Tailwind v4 Button - Pure Utility Classes */}
130+
<div className="flex flex-col items-center gap-4 my-8">
131+
<button
132+
className="bg-blue-600 hover:bg-blue-800 text-white font-bold py-3 px-8 rounded-lg shadow-lg hover:shadow-xl transform hover:scale-105 transition duration-300 ease-in-out"
133+
onClick={() => alert('Tailwind CSS v4 is working correctly!')}
134+
>
135+
Tailwind v4 Button
136+
</button>
137+
{/* Custom class from tailwind.css */}
138+
<div className="mt-4 text-center">
139+
<span className="tailwind-demo-badge">
140+
Tailwind v4 Custom Component
141+
</span>
142+
</div>
143+
</div>
129144
<br/>
130145
<a href="https://datalayer.io" target="_blank">
131146
<ThreeBarsIcon/>

packages/lexical/style/tailwind.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,28 @@
88
@tailwind components;
99
@tailwind utilities;
1010

11+
/* Custom variables for compatibility */
12+
:root {
13+
--font-family-system: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
14+
--color-gray-dark: #374151;
15+
}
16+
17+
/* Tailwind v4 custom component example */
18+
.tailwind-demo-badge {
19+
display: inline-flex;
20+
align-items: center;
21+
justify-content: center;
22+
gap: 0.25rem;
23+
padding-left: 0.75rem;
24+
padding-right: 0.75rem;
25+
padding-top: 0.25rem;
26+
padding-bottom: 0.25rem;
27+
font-size: 0.875rem;
28+
font-weight: 500;
29+
color: white;
30+
background-image: linear-gradient(to right, rgb(59 130 246), rgb(147 51 234));
31+
border-radius: 9999px;
32+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
33+
}
34+
1135
@import url('./lexical/index.css');

packages/lexical/webpack.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,14 @@ module.exports = {
9999
test: /\.(jpe?g|png|gif|ico|eot|ttf|map|woff2?)(\?v=\d+\.\d+\.\d+)?$/i,
100100
type: 'asset/resource',
101101
},
102-
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
102+
{
103+
test: /\.css$/,
104+
use: [
105+
'style-loader',
106+
'css-loader',
107+
'postcss-loader'
108+
]
109+
},
103110
{ test: /\.md$/, use: 'raw-loader' },
104111
{ test: /\.js.map$/, use: 'file-loader' },
105112
/*

0 commit comments

Comments
 (0)