Skip to content
This repository was archived by the owner on Sep 30, 2023. It is now read-only.

Commit 313f092

Browse files
committed
refactor: move css components to windi shortcut
1 parent 41c740f commit 313f092

File tree

3 files changed

+20
-24
lines changed

3 files changed

+20
-24
lines changed

components.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
declare module 'vue' {
55
export interface GlobalComponents {
66
Header: typeof import('./src/components/Header.vue')['default']
7-
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
87
}
98
}
109

src/style/main.css

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,3 @@ body,
1313
text-align: center;
1414
color: #2c3e50;
1515
}
16-
17-
@layer components {
18-
.btn {
19-
@apply
20-
px-3.5 py-2 bg-primary text-white rounded-md
21-
focus:outline-none;
22-
}
23-
24-
.icon-btn {
25-
@apply
26-
p-2 text-2xl inline-flex items-center
27-
focus:outline-none;
28-
}
29-
30-
.tag {
31-
@apply
32-
inline-block p-1 bg-secondary text-white text-sm font-bold leading-4 rounded-sm;
33-
&-outline {
34-
@apply
35-
bg-white border border-secondary text-secondary;
36-
}
37-
}
38-
}

windi.config.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,24 @@ export default defineConfig({
99
},
1010
},
1111
},
12+
shortcuts: {
13+
'btn': {
14+
'@apply': 'px-3.5 py-2 bg-primary text-white rounded-md',
15+
'&:focus': {
16+
'@apply': 'outline-none',
17+
},
18+
},
19+
'icon-btn': {
20+
'@apply': 'p-2 text-2xl inline-flex items-center',
21+
'&:focus': {
22+
'@apply': 'outline-none',
23+
},
24+
},
25+
'tag': {
26+
'@apply': 'inline-block p-1 bg-secondary text-white text-sm font-bold leading-4 rounded-sm',
27+
'&-outline': {
28+
'@apply': 'bg-white border border-secondary text-secondary',
29+
},
30+
},
31+
},
1232
})

0 commit comments

Comments
 (0)