6
6
:bg =" colorMode === 'light' ? 'white' : 'gray.800'"
7
7
:color =" colorMode === 'light' ? 'gray.800' : 'gray.50'"
8
8
class =" root"
9
+ width =" 100vw"
10
+ height =" 100vh"
11
+ transition =" all 0.2s ease-in-out"
9
12
>
10
- <CHeading mb =" 50px" pos =" absolute" top =" 3" left =" 50%" transform =" translateX(-50%)" as =" h4" >@chakra-ui/vue</CHeading >
11
- <CReset />
12
- <CButton
13
- as =" a"
14
- target =" _blank"
15
- href =" https://github.com/chakra-ui/chakra-ui-vue"
16
- position =" fixed"
17
- top =" 3"
18
- left =" 3"
19
- shadow =" sm"
20
- left-icon =" github"
13
+ <CFlex justify-content =" space-between" padding =" 4" >
14
+ <CHeading mb =" 50px" as =" h4" >@chakra-ui/vue</CHeading >
15
+ <CReset />
16
+ <CButton
17
+ as =" a"
18
+ target =" _blank"
19
+ href =" https://github.com/chakra-ui/chakra-ui-vue"
20
+ shadow =" sm"
21
+ left-icon =" github"
22
+ order =" -1"
23
+ >
24
+ Github
25
+ </CButton >
26
+ <CIconButton
27
+ :aria-label ="
28
+ `Switch to ${colorMode === 'light' ? 'dark' : 'light'} mode`
29
+ "
30
+ variant =" solid"
31
+ :icon =" colorMode === 'light' ? 'sun' : 'moon'"
32
+ @click =" toggleColorMode"
33
+ >
34
+ </CIconButton >
35
+ </CFlex >
36
+ <CFlex
37
+ class =" wrapper"
38
+ flex-direction =" column"
39
+ justify-content =" center"
40
+ align-items =" center"
21
41
>
22
- Github
23
- </CButton >
24
- <CIconButton
25
- position =" fixed"
26
- top =" 3"
27
- right =" 3"
28
- :aria-label =" `Switch to ${colorMode === 'light' ? 'dark' : 'light'} mode`"
29
- variant =" ghost"
30
- :icon =" colorMode === 'light' ? 'sun' : 'moon'"
31
- @click =" toggleColorMode"
32
- >
33
- </CIconButton >
34
- <div class =" wrapper" >
35
42
<slot />
36
- </div >
43
+ </CFlex >
37
44
</CBox >
38
45
</CColorModeProvider >
39
46
</CThemeProvider >
@@ -46,8 +53,10 @@ import {
46
53
CReset ,
47
54
CButton ,
48
55
CBox ,
56
+ CFlex ,
49
57
CIconButton ,
50
- CColorModeProvider } from ' ../../packages/chakra-ui-core/src'
58
+ CColorModeProvider
59
+ } from ' ../../packages/chakra-ui-core/src'
51
60
52
61
export default {
53
62
name: ' Canvas' ,
@@ -57,32 +66,9 @@ export default {
57
66
CReset,
58
67
CButton,
59
68
CBox,
69
+ CFlex,
60
70
CIconButton,
61
71
CColorModeProvider
62
72
}
63
73
}
64
74
</script >
65
-
66
- <style lang="scss" scoped>
67
- html ,
68
- body {
69
- margin : 0
70
- }
71
- .root {
72
- height : 100vh ;
73
- width : 100vw ;
74
- display : flex ;
75
- flex-direction : column ;
76
- justify-content : center ;
77
- align-items : center ;
78
- transition : all 0.2s ease-in-out ;
79
- .wrapper {
80
- display : flex ;
81
- flex-direction : column ;
82
- justify-content : center ;
83
- align-items : center ;
84
- width : 100% ;
85
- height : 100%
86
- }
87
- }
88
- </style >
0 commit comments