File tree Expand file tree Collapse file tree 3 files changed +59
-23
lines changed Expand file tree Collapse file tree 3 files changed +59
-23
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <button class =" app-btn" type =" button" >
3
+ <span tabindex =" -1" >
4
+ <slot ></slot >
5
+ </span >
6
+ </button >
7
+ </template >
8
+
9
+ <script >
10
+ export default {
11
+ name: " AppButton"
12
+ };
13
+ </script >
14
+
15
+ <style lang="scss" scoped></style >
Original file line number Diff line number Diff line change 13
13
<div class =" control-footer" >
14
14
<span >Name</span >
15
15
<span :title =" fileName" >{{ fileName }}</span >
16
- <button class = " btn " @click =" openFilePicker" >
16
+ <app- button @click =" openFilePicker" >
17
17
<img src =" @/assets/triangle.svg" alt =" " srcset =" " />
18
18
Upload
19
- </button >
19
+ </app- button >
20
20
</div >
21
21
</div >
22
22
<input
29
29
</template >
30
30
31
31
<script >
32
+ import AppButton from " @/components/AppButton" ;
33
+
32
34
const pipe = (... fns ) => initVal => fns .reduce ((val , fn ) => fn (val), initVal);
33
35
34
36
export default {
35
- components: {},
37
+ components: {
38
+ AppButton
39
+ },
36
40
name: " CanvasEditor" ,
37
41
props: {
38
42
settings: {
@@ -157,7 +161,7 @@ export default {
157
161
}
158
162
}
159
163
160
- .btn {
164
+ .app- btn {
161
165
margin-left : 1.5rem ;
162
166
}
163
167
</style >
Original file line number Diff line number Diff line change 1
- .btn {
2
- @extend %control-style ;
3
- padding : 1rem 2rem ;
4
- display : flex ;
5
- align-items : center ;
6
- margin-left : 1.5rem ;
7
- border-radius : $border-radius ;
8
- background-color : $grey-1 ;
9
- color : $blue ;
1
+ .app-btn {
2
+ @at-root button #{&} {
3
+ appearance : none ;
4
+ background : none ;
5
+ border : none ;
6
+ outline : none ;
7
+ }
10
8
11
- & :hover {
12
- background-color : darken ($grey-1 , 10% );
9
+ > span {
10
+ @extend %control-style ;
11
+ position : relative ;
12
+ display : flex ;
13
+ align-items : center ;
14
+ padding : 1rem 2rem ;
15
+ border-radius : $border-radius ;
16
+ background-color : $grey-1 ;
17
+ color : $blue ;
18
+
19
+ & :focus {
20
+ outline : none ;
21
+ }
22
+
23
+ img {
24
+ width : 1em ;
25
+ height : 1em ;
26
+ margin-right : 0.5em ;
27
+ }
13
28
}
14
29
15
- & :focus {
16
- outline : none ;
30
+ & :hover > span {
31
+ background-color : darken ( $grey-1 , 5 % ) ;
17
32
}
18
33
19
- & :active {
20
- background-color : darken ($grey-1 , 15 % );
34
+ & :active > span {
35
+ background-color : darken ($grey-1 , 10 % );
21
36
}
22
37
23
- img {
24
- width : 1em ;
25
- height : 1em ;
26
- margin-right : 0.5em ;
38
+ & :focus {
39
+ outline : none ;
40
+
41
+ > span {
42
+ box-shadow : 0 0 10px 6px rgba (0 , 0 , 0 , 0.2 );
43
+ }
27
44
}
28
45
}
You can’t perform that action at this time.
0 commit comments