File tree Expand file tree Collapse file tree 1 file changed +73
-0
lines changed
docs/.vuepress/components Expand file tree Collapse file tree 1 file changed +73
-0
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div :class =" ['status-label', getSlug()]" >
3
+ <div class =" status-label-pip" :style =" { backgroundColor: getColor() }" ></div >
4
+ <div class =" status-label-text" >
5
+ {{ label }}
6
+ </div >
7
+ </div >
8
+ </template >
9
+
10
+ <script >
11
+ export default {
12
+ props: {
13
+ label: {
14
+ type: String ,
15
+ default: ' live' ,
16
+ },
17
+ color: {
18
+ type: String ,
19
+ default: null ,
20
+ },
21
+ },
22
+ methods: {
23
+ getSlug () {
24
+ return this .label .toLowerCase ().replace (/ [^ a-z ] / , ' -' );
25
+ },
26
+ getColor () {
27
+ if (! this .color ) {
28
+ return null ;
29
+ }
30
+
31
+ if (this .color .indexOf (' #' ) !== 0 ) {
32
+ return null ;
33
+ }
34
+
35
+ return this .color ;
36
+ },
37
+ },
38
+ };
39
+ </script >
40
+
41
+ <style lang="postcss" scoped>
42
+ .status-label {
43
+ align-items : center;
44
+ border-radius : 1 em ;
45
+ display : inline-flex;
46
+ height : 20 px ;
47
+ padding : 0 10 px 0 5 px ;
48
+
49
+ & .live {
50
+ background-color : theme ('colors.craft.green' );
51
+ }
52
+
53
+ & .pending {
54
+ background-color : theme ('colors.craft.orange' );
55
+ }
56
+ }
57
+
58
+ .status-label-pip {
59
+ background-color : white;
60
+ border-radius : 100 % ;
61
+ height : 12 px ;
62
+ margin-right : 5 px ;
63
+ width : 12 px ;
64
+ }
65
+
66
+ .status-label-text {
67
+ color : white;
68
+ font-size : 0.7 em ;
69
+ font-weight : 600 ;
70
+ letter-spacing : 0.05 em ;
71
+ text-transform : uppercase;
72
+ }
73
+ </style >
You can’t perform that action at this time.
0 commit comments