Skip to content
This repository was archived by the owner on Jan 9, 2022. It is now read-only.

Commit 9e0d981

Browse files
Michael.KryvoruchkoMichael.Kryvoruchko
Michael.Kryvoruchko
authored and
Michael.Kryvoruchko
committed
feat: upgrade dev playground
- setup WindiCSS - add btn component in the WindiCSS
1 parent 154d9bf commit 9e0d981

File tree

6 files changed

+91
-3
lines changed

6 files changed

+91
-3
lines changed

packages/dialog/dev/Playground.template.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
Content
77
</GDialog>
88

9-
<button @click="dialog = true">
9+
<button
10+
class="btn"
11+
@click="dialog = true"
12+
>
1013
Open
1114
</button>
1215
</template>

packages/dialog/dev/main.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { createApp } from 'vue'
22

3+
import 'virtual:windi.css'
4+
35
import App from './App.vue'
46
import dialogPlugin from './g-dialog'
57

packages/dialog/dev/vite.config.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ export default defineConfig({
4040
],
4141
dts: resolve('components.d.ts'),
4242
}),
43-
WindiCSS(),
43+
WindiCSS({
44+
config: resolve('windi.config.ts'),
45+
}),
4446
],
4547

4648
server: {

packages/dialog/dev/windi.config.ts

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { defineConfig } from 'windicss/helpers'
2+
import plugin from 'windicss/plugin'
3+
4+
export default defineConfig({
5+
attributify: true,
6+
extract: {
7+
include: ['./**/*.{vue,html,jsx,tsx}'],
8+
},
9+
plugins: [
10+
plugin(({ addComponents }) => {
11+
addComponents({
12+
'.btn': {
13+
'backgroundColor': '#3490dc',
14+
padding: '.5rem 1rem',
15+
borderRadius: '.25rem',
16+
color: '#fff',
17+
fontWeight: '600',
18+
'&:hover': {
19+
backgroundColor: '#2779bd',
20+
},
21+
},
22+
})
23+
}),
24+
],
25+
})

packages/dialog/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@
4646
"unplugin-auto-import": "^0.5.1",
4747
"unplugin-vue-components": "^0.17.5",
4848
"vite": "^2.5.3",
49+
"vite-plugin-windicss": "^1.5.4",
4950
"vue": "3.2.6",
50-
"vue-tsc": "^0.29.8"
51+
"vue-tsc": "^0.29.8",
52+
"windicss": "^3.2.1"
5153
},
5254
"peerDependencies": {
5355
"vue": "^3.2.6"

yarn.lock

+54
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,15 @@
653653
tsup "^4.14.0"
654654
windicss "^3.1.7"
655655

656+
"@windicss/[email protected]":
657+
version "1.5.4"
658+
resolved "https://registry.yarnpkg.com/@windicss/config/-/config-1.5.4.tgz#69b10fb02cfea1103a4ca9a65a738ef7d3734b29"
659+
integrity sha512-muRPFulqh7nU3VrsPb5+k6ulNyiw8VGg62zAWRZIBfeCRXZb2gV1Q8a/tPn8X1T/+HTt4f/1bzFiusqMKscmlw==
660+
dependencies:
661+
debug "^4.3.3"
662+
jiti "^1.12.9"
663+
windicss "^3.2.1"
664+
656665
"@windicss/[email protected]":
657666
version "1.3.0"
658667
resolved "https://registry.yarnpkg.com/@windicss/plugin-utils/-/plugin-utils-1.3.0.tgz#165ea203613d0308234edd18448f4da87ec4ee1d"
@@ -666,6 +675,19 @@
666675
micromatch "^4.0.4"
667676
windicss "^3.1.7"
668677

678+
"@windicss/[email protected]":
679+
version "1.5.4"
680+
resolved "https://registry.yarnpkg.com/@windicss/plugin-utils/-/plugin-utils-1.5.4.tgz#a283b1fe040b9559542462c80bbf1db9fd2850e8"
681+
integrity sha512-fS4y52OYB9rIzEUolIWIrrHYuaQfcqTaX3ISbFUiNbvNgH97JATjzB2iOnNqWNy6pH3M8RP0TqYQOOCCeanDoA==
682+
dependencies:
683+
"@antfu/utils" "^0.3.0"
684+
"@windicss/config" "1.5.4"
685+
debug "^4.3.3"
686+
fast-glob "^3.2.7"
687+
magic-string "^0.25.7"
688+
micromatch "^4.0.4"
689+
windicss "^3.2.1"
690+
669691
acorn-jsx@^5.2.0, acorn-jsx@^5.3.1:
670692
version "5.3.2"
671693
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
@@ -1107,6 +1129,13 @@ debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3
11071129
dependencies:
11081130
ms "2.1.2"
11091131

1132+
debug@^4.3.3:
1133+
version "4.3.3"
1134+
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664"
1135+
integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==
1136+
dependencies:
1137+
ms "2.1.2"
1138+
11101139
debug@~3.1.0:
11111140
version "3.1.0"
11121141
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
@@ -2157,6 +2186,11 @@ jiti@^1.11.0:
21572186
resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.11.0.tgz#64120a30d97b9bf37b8b032cf4564dfadc28984c"
21582187
integrity sha512-/2c7e61hxxTIN34UeHBB0LCJ5Tq64kgJDV7GR+++e8XRxCKRIKmB8tH6ww1W+Z6Kgd6By+C3RSCu1lXjbPT68A==
21592188

2189+
jiti@^1.12.9:
2190+
version "1.12.9"
2191+
resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.12.9.tgz#2ce45b265cfc8dc91ebd70a5204807cf915291bc"
2192+
integrity sha512-TdcJywkQtcwLxogc4rSMAi479G2eDPzfW0fLySks7TPhgZZ4s/tM6stnzayIh3gS/db3zExWJyUx4cNWrwAmoQ==
2193+
21602194
joycon@^3.0.1:
21612195
version "3.0.1"
21622196
resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.0.1.tgz#9074c9b08ccf37a6726ff74a18485f85efcaddaf"
@@ -2252,6 +2286,11 @@ known-css-properties@^0.21.0:
22522286
resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.21.0.tgz#15fbd0bbb83447f3ce09d8af247ed47c68ede80d"
22532287
integrity sha512-sZLUnTqimCkvkgRS+kbPlYW5o8q5w1cu+uIisKpEWkj31I8mx8kNG162DwRav8Zirkva6N5uoFsm9kzK4mUXjw==
22542288

2289+
kolorist@^1.5.0:
2290+
version "1.5.0"
2291+
resolved "https://registry.yarnpkg.com/kolorist/-/kolorist-1.5.0.tgz#a06f7dd11d1b5fdb743d79c8acd4e1ecbcbd89b3"
2292+
integrity sha512-pPobydIHK884YBtkS/tWSZXpSAEpcMbilyun3KL37ot935qL2HNKm/tI45i/Rd+MxdIWEhm7/LmUQzWZYK+Qhg==
2293+
22552294
levn@^0.4.1:
22562295
version "0.4.1"
22572296
resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"
@@ -3909,6 +3948,16 @@ vite-plugin-windicss@^1.2.7:
39093948
debug "^4.3.2"
39103949
windicss "^3.1.7"
39113950

3951+
vite-plugin-windicss@^1.5.4:
3952+
version "1.5.4"
3953+
resolved "https://registry.yarnpkg.com/vite-plugin-windicss/-/vite-plugin-windicss-1.5.4.tgz#b3bda784e50a9b6603ff4c253614271ac300d9d3"
3954+
integrity sha512-bG2IERA9J50MGq1QEbGC/PjrkVIaq2b3LilCeidyIpmFV/4aR14/wGDe83SobF+8coIeJ+23S0uDK/fXX5X0pQ==
3955+
dependencies:
3956+
"@windicss/plugin-utils" "1.5.4"
3957+
debug "^4.3.3"
3958+
kolorist "^1.5.0"
3959+
windicss "^3.2.1"
3960+
39123961
vite@^2.5.3:
39133962
version "2.5.3"
39143963
resolved "https://registry.yarnpkg.com/vite/-/vite-2.5.3.tgz#88d40a9efb9bec66bd87a7676c5689f35ff63742"
@@ -4125,6 +4174,11 @@ windicss@^3.1.6, windicss@^3.1.7:
41254174
resolved "https://registry.yarnpkg.com/windicss/-/windicss-3.1.7.tgz#8a3b8a07ed97c2c1354a6e31820d8059da35f724"
41264175
integrity sha512-Q/HQ9j+r2R0fdt85zAjccdo11kHWzQmpkuwIUQIO6PSypyDmBTfN14aAy4szLrpgo2woyuHM7Y+kir4IG4qnKQ==
41274176

4177+
windicss@^3.2.1:
4178+
version "3.2.1"
4179+
resolved "https://registry.yarnpkg.com/windicss/-/windicss-3.2.1.tgz#bd0f7b9ebabba04ea8dfedcbb0263c2ef9591db4"
4180+
integrity sha512-LusrIrryBFHAPQ/OOTbS4EWWuzI6eGeJglI9nQ3kDBr1cqH69NWt8Z8q59f9kTkgptXroejmWfksWwqgHs8EVw==
4181+
41284182
with@^7.0.0:
41294183
version "7.0.2"
41304184
resolved "https://registry.yarnpkg.com/with/-/with-7.0.2.tgz#ccee3ad542d25538a7a7a80aad212b9828495bac"

0 commit comments

Comments
 (0)