-
Notifications
You must be signed in to change notification settings - Fork 68
/
BaseDivider.vue
108 lines (91 loc) Β· 2.32 KB
/
BaseDivider.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!-- *************************************************************************
TEMPLATE
************************************************************************* -->
<template lang="pug">
hr(
:class=`[
"gb-base-divider",
"gb-base-divider--" + size,
"gb-base-divider--" + computedTheme,
{
["gb-base-divider--" + color]: color
}
]`
:style=`{
margin: margin
}`
)
</template>
<!-- *************************************************************************
SCRIPT
************************************************************************* -->
<script>
// PROJECT: MIXINS
import ThemeMixin from "../../mixins/ThemeMixin.js"
export default {
mixins: [ThemeMixin],
props: {
color: {
type: String,
default: null,
validator(x) {
return ["black", "blue", "green", "grey", "orange", "purple", "red", "turquoise", "white", "yellow"].includes(x)
}
},
margin: {
type: String,
default: null
},
size: {
type: String,
default: "large",
validator(x) {
return ["small", "large"].includes(x)
}
}
}
}
</script>
<!-- *************************************************************************
STYLE
************************************************************************* -->
<style lang="scss">
// IMPORTS
@import "node_modules/@growthbunker/stylesheets/settings/_colors.scss";
@import "node_modules/@growthbunker/stylesheets/settings/_themes.scss";
@import "node_modules/@growthbunker/stylesheets/tools/_functions.scss";
// VARIABLES
$c: ".gb-base-divider";
$colors: "black", "blue", "green", "grey", "orange", "purple", "red", "turquoise", "white", "yellow";
#{$c} {
display: block;
border: 0;
border-top-style: solid;
// --> SIZES <--
&--small {
margin: 20px auto;
width: 60px;
height: 4px;
border-top-width: 4px;
}
&--large {
margin: 40px auto;
width: 100%;
height: 1px;
border-top-width: 1px;
}
// --> THEMES <--
@each $theme in $themes {
$themeName: map-get($theme, "name");
&--#{$themeName} {
border-top-color: mdg($theme, "borders", "default", "primary");
// --> COLORS <--
@each $color in $colors {
&#{$c}--#{$color} {
border-top-color: mdg($theme, "colors", $color);
}
}
}
}
}
</style>