Skip to content

Commit 646cb1f

Browse files
authored
[WIP] Add alpha & beta badges (#1248)
* Add alpha & beta badges * Update badge style * Add test example on Custom Fields docs * Update style based on designer's feedback and clean up CSS * Test autodeploy by adding a CSS comment * Remove examples in content
1 parent 745d9c8 commit 646cb1f

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<template>
2+
<CustomBadge text="Alpha" type="alpha" :withLinkIcon=withLinkIcon :link="link"/>
3+
</template>
4+
5+
<script>
6+
export default {
7+
name: 'AlphaBadge',
8+
props: {
9+
text: {
10+
type: String,
11+
default: 'Alpha',
12+
// required: true // to suppress Vue warnings
13+
},
14+
withLinkIcon: {
15+
type: Boolean,
16+
default: false
17+
},
18+
link: {
19+
type: String,
20+
},
21+
}
22+
}
23+
</script>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<template>
2+
<CustomBadge text="Beta" type="beta" :withLinkIcon=withLinkIcon :link="link"/>
3+
</template>
4+
5+
<script>
6+
export default {
7+
name: 'BetaBadge',
8+
props: {
9+
text: {
10+
type: String,
11+
default: 'Beta',
12+
// required: true // to suppress Vue warnings
13+
},
14+
withLinkIcon: {
15+
type: Boolean,
16+
default: false
17+
},
18+
link: {
19+
type: String,
20+
},
21+
}
22+
}
23+
</script>

docs/.vuepress/theme/global-components/CustomBadge.vue

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,32 @@ export default {
3535
background-color #00b6c8
3636
&.bronze
3737
background-color #15bb70
38+
&.alpha
39+
&.beta
40+
position relative
41+
top -.2em
42+
left .6em
43+
text-transform uppercase
44+
font-size 14px
45+
font-weight 700
46+
border-radius 4px
47+
padding .32em .6em .25em 1.2em
48+
color $neutral800
49+
&::before
50+
position absolute
51+
content: '•'
52+
font-size 1.5em
53+
left .25em
54+
top .12em
55+
content: '•'
56+
font-size 1.5em
57+
&.alpha
58+
background-color $danger100 // check palette.styl for values
59+
&::before
60+
color $danger600
61+
&.beta
62+
background-color $alternative100
63+
&::before
64+
color $alternative600
3865
</style>
3966

0 commit comments

Comments
 (0)