Skip to content

Commit 19cc584

Browse files
reininkadamwathan
andcommitted
Update demo to latest version of Tailwind CSS and enable JIT mode
Co-Authored-By: Adam Wathan <[email protected]>
1 parent 8678309 commit 19cc584

File tree

3 files changed

+9
-26
lines changed

3 files changed

+9
-26
lines changed

demo/tailwind.config.js

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,12 @@
11
const mdx = require('@mdx-js/mdx')
22

33
module.exports = {
4+
mode: 'jit',
45
purge: {
5-
mode: 'all',
66
content: ['./demo/pages/**/*.{js,mdx}', './demo/components/**/*.{js,mdx}'],
7-
options: {
8-
whitelist: ['html', 'body'],
9-
extractors: [
10-
{
11-
extensions: ['mdx'],
12-
extractor: (content) => {
13-
content = mdx.sync(content)
14-
15-
// Capture as liberally as possible, including things like `h-(screen-1.5)`
16-
const broadMatches = content.match(/[^<>"'`\s]*[^<>"'`\s:]/g) || []
17-
18-
// Capture classes within other delimiters like .block(class="w-1/2") in Pug
19-
const innerMatches =
20-
content.match(/[^<>"'`\s.(){}[\]#=%]*[^<>"'`\s.(){}[\]#=%:]/g) || []
21-
22-
return broadMatches.concat(innerMatches)
23-
},
24-
},
25-
],
26-
},
7+
transform: {
8+
mdx: (content) => mdx.sync(content),
9+
}
2710
},
2811
theme: {},
2912
variants: {},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"react": "^17.0.2",
4747
"react-dom": "^17.0.2",
4848
"snapshot-diff": "^0.8.1",
49-
"tailwindcss": "^2.0.2"
49+
"tailwindcss": "^2.2.16"
5050
},
5151
"dependencies": {
5252
"lodash.castarray": "^4.4.0",

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6069,10 +6069,10 @@ symbol-tree@^3.2.4:
60696069
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"
60706070
integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==
60716071

6072-
tailwindcss@^2.0.2:
6073-
version "2.2.15"
6074-
resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-2.2.15.tgz#8bee3ebe68b988c050508ce20633f35b040dd9fe"
6075-
integrity sha512-WgV41xTMbnSoTNMNnJvShQZ+8GmY86DmXTrCgnsveNZJdlybfwCItV8kAqjYmU49YiFr+ofzmT1JlAKajBZboQ==
6072+
tailwindcss@^2.2.16:
6073+
version "2.2.16"
6074+
resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-2.2.16.tgz#32f81bdf1758b639cb83b9d30bf7cbecdda49e5e"
6075+
integrity sha512-EireCtpQyyJ4Xz8NYzHafBoy4baCOO96flM0+HgtsFcIQ9KFy/YBK3GEtlnD+rXen0e4xm8t3WiUcKBJmN6yjg==
60766076
dependencies:
60776077
arg "^5.0.1"
60786078
bytes "^3.0.0"

0 commit comments

Comments
 (0)