@esportsplus/ui 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +2 -2
- package/components/accordion/scss/accordion.scss +16 -16
- package/components/accordion/scss/variables.scss +4 -4
- package/components/anchor/scss/anchor.scss +41 -41
- package/components/anchor/scss/anchors.scss +9 -9
- package/components/anchor/scss/variables.scss +5 -5
- package/components/banner/scss/banner.scss +13 -13
- package/components/border/scss/border.scss +10 -10
- package/components/border/scss/variables.scss +6 -6
- package/components/bubble/scss/bubble.scss +30 -30
- package/components/bubble/scss/variables.scss +19 -19
- package/components/button/scss/button.scss +93 -93
- package/components/button/scss/variables.scss +70 -70
- package/components/card/scss/card.scss +36 -36
- package/components/card/scss/variables.scss +42 -42
- package/components/container/scss/container.scss +10 -10
- package/components/container/scss/variables.scss +5 -5
- package/components/field/scss/_check.scss +225 -225
- package/components/field/scss/_normalize.scss +36 -36
- package/components/field/scss/_text.scss +103 -103
- package/components/field/scss/field.scss +137 -132
- package/components/field/scss/variables.scss +138 -133
- package/components/group/scss/group.scss +41 -41
- package/components/group/scss/variables.scss +25 -25
- package/components/icon/scss/icon.scss +18 -18
- package/components/icon/scss/variables.scss +8 -8
- package/components/link/scss/link.scss +29 -29
- package/components/link/scss/variables.scss +48 -48
- package/components/loading/scss/loading.scss +24 -24
- package/components/loading/scss/variables.scss +31 -31
- package/components/page/scss/page.scss +22 -22
- package/components/page/scss/variables.scss +19 -19
- package/components/root/scss/root.scss +93 -93
- package/components/root/scss/variables.scss +54 -54
- package/components/row/scss/row.scss +8 -8
- package/components/scrollbar/scss/scrollbar.scss +51 -51
- package/components/scrollbar/scss/variables.scss +8 -8
- package/components/sidebar/scss/sidebar.scss +50 -50
- package/components/sidebar/scss/sidebars.scss +13 -13
- package/components/sidebar/scss/variables.scss +25 -25
- package/components/text/scss/text.scss +12 -12
- package/components/text/scss/variables.scss +9 -9
- package/components/thumbnail/scss/thumbnail.scss +7 -7
- package/components/thumbnail/scss/variables.scss +7 -7
- package/components/tooltip/scss/_center.scss +13 -13
- package/components/tooltip/scss/_east.scss +34 -34
- package/components/tooltip/scss/_north.scss +34 -34
- package/components/tooltip/scss/_south.scss +35 -35
- package/components/tooltip/scss/_west.scss +34 -34
- package/components/tooltip/scss/tooltip.scss +107 -107
- package/components/tooltip/scss/variables.scss +25 -25
- package/css-utilities/[margin,padding]/scss/styles.scss +41 -41
- package/css-utilities/[margin,padding]/scss/variables.scss +52 -52
- package/css-utilities/[max,min]/scss/variables.scss +23 -23
- package/css-utilities/absolute/scss/absolute.scss +59 -59
- package/css-utilities/background/scss/variables.scss +28 -28
- package/css-utilities/border/scss/border.scss +21 -21
- package/css-utilities/border/scss/variables.scss +66 -66
- package/css-utilities/color/scss/variables.scss +32 -32
- package/css-utilities/flex/scss/flex.scss +67 -67
- package/css-utilities/hidden/scss/hidden.scss +28 -28
- package/css-utilities/index.scss +14 -14
- package/css-utilities/pointer/scss/pointer.scss +5 -5
- package/css-utilities/size/scss/variables.scss +12 -12
- package/css-utilities/slide/scss/slide.scss +20 -20
- package/css-utilities/slide/scss/variables.scss +6 -6
- package/css-utilities/text/scss/text.scss +93 -93
- package/css-utilities/text/scss/variables.scss +31 -31
- package/css-utilities/width/scss/variables.scss +12 -12
- package/lib/index.scss +7 -7
- package/lib/scss/color.scss +8 -8
- package/lib/scss/list.scss +112 -112
- package/lib/scss/string.scss +54 -54
- package/package.json +22 -22
- package/storage/fonts/Montserrat/montserrat.css +79 -79
- package/tokens/index.scss +11 -11
- package/tokens/scss/border-radius.scss +12 -12
- package/tokens/scss/border-width.scss +6 -6
- package/tokens/scss/box-shadow.scss +13 -13
- package/tokens/scss/breakpoints.scss +13 -13
- package/tokens/scss/color.scss +71 -71
- package/tokens/scss/font-size.scss +12 -12
- package/tokens/scss/font-weight.scss +6 -6
- package/tokens/scss/line-height.scss +6 -6
- package/tokens/scss/size.scss +13 -13
- package/tokens/scss/state.scss +93 -93
- package/tokens/scss/transition-duration.scss +5 -5
- package/webpack.sass.config.js +59 -59
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
@use 'ui/lib';
|
|
2
|
-
@use 'ui/tokens';
|
|
3
|
-
|
|
4
|
-
.card {
|
|
5
|
-
background: var(--background);
|
|
6
|
-
border-radius: var(--border-radius);
|
|
7
|
-
padding: var(--padding-vertical) var(--padding-horizontal);
|
|
8
|
-
position: relative;
|
|
9
|
-
transition:
|
|
10
|
-
background var(--transition-duration) ease-in-out,
|
|
11
|
-
border-color var(--transition-duration) ease-in-out,
|
|
12
|
-
box-shadow var(--transition-duration) ease-in-out,
|
|
13
|
-
max-height var(--transition-duration) ease-in-out;
|
|
14
|
-
width: var(--width);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// Pseudo Element Box Shadow
|
|
18
|
-
&::after {
|
|
19
|
-
@include lib.position(absolute, full);
|
|
20
|
-
border-radius: inherit;
|
|
21
|
-
box-shadow: var(--box-shadow);
|
|
22
|
-
content: '';
|
|
23
|
-
pointer-events: none;
|
|
24
|
-
transition:
|
|
25
|
-
box-shadow var(--transition-duration) ease-in-out,
|
|
26
|
-
opacity var(--transition-duration) ease-in-out;
|
|
27
|
-
z-index: 0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
&--flat {
|
|
32
|
-
&::after {
|
|
33
|
-
display: none;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
@use 'ui/lib';
|
|
2
|
+
@use 'ui/tokens';
|
|
3
|
+
|
|
4
|
+
.card {
|
|
5
|
+
background: var(--background);
|
|
6
|
+
border-radius: var(--border-radius);
|
|
7
|
+
padding: var(--padding-vertical) var(--padding-horizontal);
|
|
8
|
+
position: relative;
|
|
9
|
+
transition:
|
|
10
|
+
background var(--transition-duration) ease-in-out,
|
|
11
|
+
border-color var(--transition-duration) ease-in-out,
|
|
12
|
+
box-shadow var(--transition-duration) ease-in-out,
|
|
13
|
+
max-height var(--transition-duration) ease-in-out;
|
|
14
|
+
width: var(--width);
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
// Pseudo Element Box Shadow
|
|
18
|
+
&::after {
|
|
19
|
+
@include lib.position(absolute, full);
|
|
20
|
+
border-radius: inherit;
|
|
21
|
+
box-shadow: var(--box-shadow);
|
|
22
|
+
content: '';
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
transition:
|
|
25
|
+
box-shadow var(--transition-duration) ease-in-out,
|
|
26
|
+
opacity var(--transition-duration) ease-in-out;
|
|
27
|
+
z-index: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
&--flat {
|
|
32
|
+
&::after {
|
|
33
|
+
display: none;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
@use 'ui/tokens';
|
|
2
|
-
|
|
3
|
-
.card {
|
|
4
|
-
--background: var(--background-default);
|
|
5
|
-
--background-active: var(--background-default);
|
|
6
|
-
--background-default: transparent;
|
|
7
|
-
--background-hover: var(--background-default);
|
|
8
|
-
--background-pressed: var(--background-default);
|
|
9
|
-
--border-color: var(--border-color-default);
|
|
10
|
-
--border-color-active: var(--border-color-default);
|
|
11
|
-
--border-color-default: var(--background);
|
|
12
|
-
--border-color-hover: var(--border-color-default);
|
|
13
|
-
--border-color-pressed: var(--border-color-default);
|
|
14
|
-
--border-radius: var(--border-radius-400);
|
|
15
|
-
--box-shadow: var(--box-shadow-default);
|
|
16
|
-
--box-shadow-active: var(--box-shadow-300);
|
|
17
|
-
--box-shadow-default: none;
|
|
18
|
-
--box-shadow-hover: var(--box-shadow-300);
|
|
19
|
-
--box-shadow-pressed: none;
|
|
20
|
-
--padding-horizontal: 0px;
|
|
21
|
-
--padding-vertical: 0px;
|
|
22
|
-
--transition-duration: var(--transition-duration-400);
|
|
23
|
-
--width: auto;
|
|
24
|
-
|
|
25
|
-
@include tokens.state(active) {
|
|
26
|
-
--background: var(--background-active);
|
|
27
|
-
--border-color: var(--border-color-active);
|
|
28
|
-
--box-shadow: var(--box-shadow-active);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@include tokens.state(hover) {
|
|
32
|
-
--background: var(--background-hover);
|
|
33
|
-
--border-color: var(--border-color-hover);
|
|
34
|
-
--box-shadow: var(--box-shadow-hover);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@include tokens.state(pressed) {
|
|
38
|
-
--background: var(--background-pressed);
|
|
39
|
-
--border-color: var(--border-color-pressed);
|
|
40
|
-
--box-shadow: var(--box-shadow-pressed);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
@use 'ui/tokens';
|
|
2
|
+
|
|
3
|
+
.card {
|
|
4
|
+
--background: var(--background-default);
|
|
5
|
+
--background-active: var(--background-default);
|
|
6
|
+
--background-default: transparent;
|
|
7
|
+
--background-hover: var(--background-default);
|
|
8
|
+
--background-pressed: var(--background-default);
|
|
9
|
+
--border-color: var(--border-color-default);
|
|
10
|
+
--border-color-active: var(--border-color-default);
|
|
11
|
+
--border-color-default: var(--background);
|
|
12
|
+
--border-color-hover: var(--border-color-default);
|
|
13
|
+
--border-color-pressed: var(--border-color-default);
|
|
14
|
+
--border-radius: var(--border-radius-400);
|
|
15
|
+
--box-shadow: var(--box-shadow-default);
|
|
16
|
+
--box-shadow-active: var(--box-shadow-300);
|
|
17
|
+
--box-shadow-default: none;
|
|
18
|
+
--box-shadow-hover: var(--box-shadow-300);
|
|
19
|
+
--box-shadow-pressed: none;
|
|
20
|
+
--padding-horizontal: 0px;
|
|
21
|
+
--padding-vertical: 0px;
|
|
22
|
+
--transition-duration: var(--transition-duration-400);
|
|
23
|
+
--width: auto;
|
|
24
|
+
|
|
25
|
+
@include tokens.state(active) {
|
|
26
|
+
--background: var(--background-active);
|
|
27
|
+
--border-color: var(--border-color-active);
|
|
28
|
+
--box-shadow: var(--box-shadow-active);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@include tokens.state(hover) {
|
|
32
|
+
--background: var(--background-hover);
|
|
33
|
+
--border-color: var(--border-color-hover);
|
|
34
|
+
--box-shadow: var(--box-shadow-hover);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@include tokens.state(pressed) {
|
|
38
|
+
--background: var(--background-pressed);
|
|
39
|
+
--border-color: var(--border-color-pressed);
|
|
40
|
+
--box-shadow: var(--box-shadow-pressed);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-wrap: wrap;
|
|
4
|
-
justify-content: flex-start;
|
|
5
|
-
margin: 0 auto;
|
|
6
|
-
max-width: var(--max-width);
|
|
7
|
-
padding: var(--padding-vertical) var(--padding-horizontal);
|
|
8
|
-
position: relative;
|
|
9
|
-
width: 100%;
|
|
10
|
-
}
|
|
1
|
+
.container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
justify-content: flex-start;
|
|
5
|
+
margin: 0 auto;
|
|
6
|
+
max-width: var(--max-width);
|
|
7
|
+
padding: var(--padding-vertical) var(--padding-horizontal);
|
|
8
|
+
position: relative;
|
|
9
|
+
width: 100%;
|
|
10
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
--max-width: 1400px;
|
|
3
|
-
--padding-horizontal: var(--size-600);
|
|
4
|
-
--padding-vertical: 0px;
|
|
5
|
-
}
|
|
1
|
+
.container {
|
|
2
|
+
--max-width: 1400px;
|
|
3
|
+
--padding-horizontal: var(--size-600);
|
|
4
|
+
--padding-vertical: 0px;
|
|
5
|
+
}
|
|
@@ -1,225 +1,225 @@
|
|
|
1
|
-
@use 'ui/lib';
|
|
2
|
-
@use 'ui/tokens';
|
|
3
|
-
|
|
4
|
-
@mixin css() {
|
|
5
|
-
&-mask {
|
|
6
|
-
&--checkbox,
|
|
7
|
-
&--radio,
|
|
8
|
-
&--switch {
|
|
9
|
-
background: var(--background);
|
|
10
|
-
border-color: var(--border-color);
|
|
11
|
-
border-radius: var(--border-radius);
|
|
12
|
-
border-style: var(--border-style);
|
|
13
|
-
border-width: var(--border-width);
|
|
14
|
-
flex: 0 0 var(--width);
|
|
15
|
-
height: var(--height);
|
|
16
|
-
position: relative;
|
|
17
|
-
transition:
|
|
18
|
-
background var(--transition-duration) ease-in-out,
|
|
19
|
-
border-color var(--transition-duration) ease-in-out,
|
|
20
|
-
box-shadow var(--transition-duration) ease-in-out,
|
|
21
|
-
opacity var(--transition-duration) ease-in-out,
|
|
22
|
-
transform var(--transition-duration) ease-in-out;
|
|
23
|
-
width: var(--width);
|
|
24
|
-
|
|
25
|
-
&:invalid,
|
|
26
|
-
&:required {
|
|
27
|
-
box-shadow: none;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&::before {
|
|
31
|
-
box-shadow: var(--box-shadow);
|
|
32
|
-
content: '';
|
|
33
|
-
height: var(--height);
|
|
34
|
-
opacity: var(--opacity);
|
|
35
|
-
transform: translate(var(--translateX), var(--translateY)) rotate(var(--rotate)) scale(var(--scale));
|
|
36
|
-
width: var(--width);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Hide HTML Field Element
|
|
40
|
-
.field-tag {
|
|
41
|
-
@include lib.position(absolute, 0 null null 0);
|
|
42
|
-
height: 0px;
|
|
43
|
-
opacity: 0;
|
|
44
|
-
pointer-events: none;
|
|
45
|
-
width: 0px;
|
|
46
|
-
z-index: 0;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&--checkbox,
|
|
51
|
-
&--radio {
|
|
52
|
-
&::before {
|
|
53
|
-
position: absolute;
|
|
54
|
-
bottom: 50%;
|
|
55
|
-
right: 50%;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
&--radio,
|
|
60
|
-
&--switch {
|
|
61
|
-
&::before {
|
|
62
|
-
background: var(--accent);
|
|
63
|
-
border-radius: inherit;
|
|
64
|
-
transform-origin: center;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
&--checkbox {
|
|
69
|
-
&::before {
|
|
70
|
-
border-bottom: var(--border-width) solid var(--accent);
|
|
71
|
-
border-right: var(--border-width) solid var(--accent);
|
|
72
|
-
transform-origin: center left;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&--switch {
|
|
77
|
-
&::before {
|
|
78
|
-
@include lib.position(absolute, var(--padding-vertical) null null var(--padding-horizontal));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@mixin variables() {
|
|
85
|
-
label#{&},
|
|
86
|
-
#{tokens.state(inactive, '.field:not(label)')} &-mask {
|
|
87
|
-
@include tokens.state(hover) {
|
|
88
|
-
--background: var(--background-hover);
|
|
89
|
-
--border-color: var(--border-color-hover);
|
|
90
|
-
--box-shadow: var(--box-shadow-hover);
|
|
91
|
-
--color: var(--color-hover);
|
|
92
|
-
--outline-opacity: var(--outline-opacity-hover);
|
|
93
|
-
--outline-width: var(--outline-width-hover);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
@include tokens.state(pressed) {
|
|
97
|
-
--background: var(--background-pressed);
|
|
98
|
-
--border-color: var(--border-color-pressed);
|
|
99
|
-
--box-shadow: var(--box-shadow-pressed);
|
|
100
|
-
--color: var(--color-pressed);
|
|
101
|
-
--outline-opacity: var(--outline-opacity-pressed);
|
|
102
|
-
--outline-width: var(--outline-width-pressed);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
&-mask {
|
|
107
|
-
&--checkbox,
|
|
108
|
-
&--radio,
|
|
109
|
-
&--switch {
|
|
110
|
-
--accent: var(--accent-default);
|
|
111
|
-
--accent-active: var(--accent-default);
|
|
112
|
-
--accent-default: var(--color-white-400);
|
|
113
|
-
--accent-hover: var(--accent-default);
|
|
114
|
-
--accent-pressed: var(--accent-default);
|
|
115
|
-
--height: var(--size);
|
|
116
|
-
--opacity: var(--opacity-default);
|
|
117
|
-
--opacity-active: var(--opacity-default);
|
|
118
|
-
--opacity-default: 1;
|
|
119
|
-
--opacity-hover: var(--opacity-default);
|
|
120
|
-
--opacity-pressed: var(--opacity-default);
|
|
121
|
-
--rotate: 0deg;
|
|
122
|
-
--scale: var(--scale-default);
|
|
123
|
-
--scale-active: var(--scale-default);
|
|
124
|
-
--scale-default: 1;
|
|
125
|
-
--scale-hover: var(--scale-default);
|
|
126
|
-
--scale-pressed: var(--scale-default);
|
|
127
|
-
--size: var(--size-600);
|
|
128
|
-
--width-switch: 40px;
|
|
129
|
-
|
|
130
|
-
&::before {
|
|
131
|
-
--translateX: 0px;
|
|
132
|
-
--translateY: 0px;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
#{tokens.state(inactive, 'label.field')},
|
|
136
|
-
#{tokens.state(inactive, '.field:not(label)')} & {
|
|
137
|
-
@include tokens.state(hover) {
|
|
138
|
-
--accent: var(--accent-hover);
|
|
139
|
-
--opacity: var(--opacity-hover);
|
|
140
|
-
--scale: var(--scale-hover);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
@include tokens.state(pressed) {
|
|
144
|
-
--accent: var(--accent-pressed);
|
|
145
|
-
--opacity: var(--opacity-pressed);
|
|
146
|
-
--scale: var(--scale-pressed);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
#{tokens.state(active, '.field')} & {
|
|
151
|
-
--accent: var(--accent-active);
|
|
152
|
-
--opacity: var(--opacity-active);
|
|
153
|
-
--scale: var(--scale-active);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
&--checkbox,
|
|
158
|
-
&--radio {
|
|
159
|
-
--margin-horizontal: calc(var(--width-switch) - var(--width));
|
|
160
|
-
--width: var(--height);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
&--radio,
|
|
164
|
-
&--switch {
|
|
165
|
-
&::before {
|
|
166
|
-
--box-shadow: 0 1px 0 rgba(0,0,0, 0.16);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
&--checkbox {
|
|
171
|
-
--border-radius: var(--border-radius-300);
|
|
172
|
-
--rotate: 45deg;
|
|
173
|
-
--scale-active: 1;
|
|
174
|
-
--scale-default: 0;
|
|
175
|
-
--scale-hover: 1.08;
|
|
176
|
-
--scale-pressed: 0.98;
|
|
177
|
-
|
|
178
|
-
&::before {
|
|
179
|
-
--box-shadow: 1px 1px 0 rgba(0,0,0, 0.16);
|
|
180
|
-
--border-width: 5px;
|
|
181
|
-
--height: 110%;
|
|
182
|
-
--translateX: 108%;
|
|
183
|
-
--translateY: 8%;
|
|
184
|
-
--width: 50%;
|
|
185
|
-
|
|
186
|
-
#{tokens.state(default, '.field')} & {
|
|
187
|
-
--translateY: 100%;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
&--radio {
|
|
193
|
-
--border-radius: var(--border-radius-circle);
|
|
194
|
-
--opacity-active: 1;
|
|
195
|
-
--opacity-default: 0.4;
|
|
196
|
-
--scale-active: 0.9;
|
|
197
|
-
--scale-default: 0;
|
|
198
|
-
--scale-hover: 0.8;
|
|
199
|
-
--scale-pressed: 0.7;
|
|
200
|
-
|
|
201
|
-
&::before {
|
|
202
|
-
--height: calc((var(--size) / 2) - (var(--border-width) * 2));
|
|
203
|
-
--translateX: 50%;
|
|
204
|
-
--translateY: 50%;
|
|
205
|
-
--width: var(--height);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
&--switch {
|
|
210
|
-
--border-radius: var(--border-radius-curved);
|
|
211
|
-
--padding-horizontal: var(--border-width-400);
|
|
212
|
-
--padding-vertical: var(--border-width-400);
|
|
213
|
-
--width: var(--width-switch);
|
|
214
|
-
|
|
215
|
-
&::before {
|
|
216
|
-
--height: calc(var(--size) - (var(--border-width) * 2) - (var(--padding-vertical) * 2));
|
|
217
|
-
--width: var(--height);
|
|
218
|
-
|
|
219
|
-
#{tokens.state(active, '.field')} & {
|
|
220
|
-
--translateX: calc(var(--width-switch) - (var(--border-width) * 2) - var(--height) - (var(--padding-horizontal) * 2));
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
1
|
+
@use 'ui/lib';
|
|
2
|
+
@use 'ui/tokens';
|
|
3
|
+
|
|
4
|
+
@mixin css() {
|
|
5
|
+
&-mask {
|
|
6
|
+
&--checkbox,
|
|
7
|
+
&--radio,
|
|
8
|
+
&--switch {
|
|
9
|
+
background: var(--background);
|
|
10
|
+
border-color: var(--border-color);
|
|
11
|
+
border-radius: var(--border-radius);
|
|
12
|
+
border-style: var(--border-style);
|
|
13
|
+
border-width: var(--border-width);
|
|
14
|
+
flex: 0 0 var(--width);
|
|
15
|
+
height: var(--height);
|
|
16
|
+
position: relative;
|
|
17
|
+
transition:
|
|
18
|
+
background var(--transition-duration) ease-in-out,
|
|
19
|
+
border-color var(--transition-duration) ease-in-out,
|
|
20
|
+
box-shadow var(--transition-duration) ease-in-out,
|
|
21
|
+
opacity var(--transition-duration) ease-in-out,
|
|
22
|
+
transform var(--transition-duration) ease-in-out;
|
|
23
|
+
width: var(--width);
|
|
24
|
+
|
|
25
|
+
&:invalid,
|
|
26
|
+
&:required {
|
|
27
|
+
box-shadow: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&::before {
|
|
31
|
+
box-shadow: var(--box-shadow);
|
|
32
|
+
content: '';
|
|
33
|
+
height: var(--height);
|
|
34
|
+
opacity: var(--opacity);
|
|
35
|
+
transform: translate(var(--translateX), var(--translateY)) rotate(var(--rotate)) scale(var(--scale));
|
|
36
|
+
width: var(--width);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Hide HTML Field Element
|
|
40
|
+
.field-tag {
|
|
41
|
+
@include lib.position(absolute, 0 null null 0);
|
|
42
|
+
height: 0px;
|
|
43
|
+
opacity: 0;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
width: 0px;
|
|
46
|
+
z-index: 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&--checkbox,
|
|
51
|
+
&--radio {
|
|
52
|
+
&::before {
|
|
53
|
+
position: absolute;
|
|
54
|
+
bottom: 50%;
|
|
55
|
+
right: 50%;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&--radio,
|
|
60
|
+
&--switch {
|
|
61
|
+
&::before {
|
|
62
|
+
background: var(--accent);
|
|
63
|
+
border-radius: inherit;
|
|
64
|
+
transform-origin: center;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&--checkbox {
|
|
69
|
+
&::before {
|
|
70
|
+
border-bottom: var(--border-width) solid var(--accent);
|
|
71
|
+
border-right: var(--border-width) solid var(--accent);
|
|
72
|
+
transform-origin: center left;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&--switch {
|
|
77
|
+
&::before {
|
|
78
|
+
@include lib.position(absolute, var(--padding-vertical) null null var(--padding-horizontal));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@mixin variables() {
|
|
85
|
+
label#{&},
|
|
86
|
+
#{tokens.state(inactive, '.field:not(label)')} &-mask {
|
|
87
|
+
@include tokens.state(hover) {
|
|
88
|
+
--background: var(--background-hover);
|
|
89
|
+
--border-color: var(--border-color-hover);
|
|
90
|
+
--box-shadow: var(--box-shadow-hover);
|
|
91
|
+
--color: var(--color-hover);
|
|
92
|
+
--outline-opacity: var(--outline-opacity-hover);
|
|
93
|
+
--outline-width: var(--outline-width-hover);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@include tokens.state(pressed) {
|
|
97
|
+
--background: var(--background-pressed);
|
|
98
|
+
--border-color: var(--border-color-pressed);
|
|
99
|
+
--box-shadow: var(--box-shadow-pressed);
|
|
100
|
+
--color: var(--color-pressed);
|
|
101
|
+
--outline-opacity: var(--outline-opacity-pressed);
|
|
102
|
+
--outline-width: var(--outline-width-pressed);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&-mask {
|
|
107
|
+
&--checkbox,
|
|
108
|
+
&--radio,
|
|
109
|
+
&--switch {
|
|
110
|
+
--accent: var(--accent-default);
|
|
111
|
+
--accent-active: var(--accent-default);
|
|
112
|
+
--accent-default: var(--color-white-400);
|
|
113
|
+
--accent-hover: var(--accent-default);
|
|
114
|
+
--accent-pressed: var(--accent-default);
|
|
115
|
+
--height: var(--size);
|
|
116
|
+
--opacity: var(--opacity-default);
|
|
117
|
+
--opacity-active: var(--opacity-default);
|
|
118
|
+
--opacity-default: 1;
|
|
119
|
+
--opacity-hover: var(--opacity-default);
|
|
120
|
+
--opacity-pressed: var(--opacity-default);
|
|
121
|
+
--rotate: 0deg;
|
|
122
|
+
--scale: var(--scale-default);
|
|
123
|
+
--scale-active: var(--scale-default);
|
|
124
|
+
--scale-default: 1;
|
|
125
|
+
--scale-hover: var(--scale-default);
|
|
126
|
+
--scale-pressed: var(--scale-default);
|
|
127
|
+
--size: var(--size-600);
|
|
128
|
+
--width-switch: 40px;
|
|
129
|
+
|
|
130
|
+
&::before {
|
|
131
|
+
--translateX: 0px;
|
|
132
|
+
--translateY: 0px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
#{tokens.state(inactive, 'label.field')},
|
|
136
|
+
#{tokens.state(inactive, '.field:not(label)')} & {
|
|
137
|
+
@include tokens.state(hover) {
|
|
138
|
+
--accent: var(--accent-hover);
|
|
139
|
+
--opacity: var(--opacity-hover);
|
|
140
|
+
--scale: var(--scale-hover);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@include tokens.state(pressed) {
|
|
144
|
+
--accent: var(--accent-pressed);
|
|
145
|
+
--opacity: var(--opacity-pressed);
|
|
146
|
+
--scale: var(--scale-pressed);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
#{tokens.state(active, '.field')} & {
|
|
151
|
+
--accent: var(--accent-active);
|
|
152
|
+
--opacity: var(--opacity-active);
|
|
153
|
+
--scale: var(--scale-active);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&--checkbox,
|
|
158
|
+
&--radio {
|
|
159
|
+
--margin-horizontal: calc(var(--width-switch) - var(--width));
|
|
160
|
+
--width: var(--height);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&--radio,
|
|
164
|
+
&--switch {
|
|
165
|
+
&::before {
|
|
166
|
+
--box-shadow: 0 1px 0 rgba(0,0,0, 0.16);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&--checkbox {
|
|
171
|
+
--border-radius: var(--border-radius-300);
|
|
172
|
+
--rotate: 45deg;
|
|
173
|
+
--scale-active: 1;
|
|
174
|
+
--scale-default: 0;
|
|
175
|
+
--scale-hover: 1.08;
|
|
176
|
+
--scale-pressed: 0.98;
|
|
177
|
+
|
|
178
|
+
&::before {
|
|
179
|
+
--box-shadow: 1px 1px 0 rgba(0,0,0, 0.16);
|
|
180
|
+
--border-width: 5px;
|
|
181
|
+
--height: 110%;
|
|
182
|
+
--translateX: 108%;
|
|
183
|
+
--translateY: 8%;
|
|
184
|
+
--width: 50%;
|
|
185
|
+
|
|
186
|
+
#{tokens.state(default, '.field')} & {
|
|
187
|
+
--translateY: 100%;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&--radio {
|
|
193
|
+
--border-radius: var(--border-radius-circle);
|
|
194
|
+
--opacity-active: 1;
|
|
195
|
+
--opacity-default: 0.4;
|
|
196
|
+
--scale-active: 0.9;
|
|
197
|
+
--scale-default: 0;
|
|
198
|
+
--scale-hover: 0.8;
|
|
199
|
+
--scale-pressed: 0.7;
|
|
200
|
+
|
|
201
|
+
&::before {
|
|
202
|
+
--height: calc((var(--size) / 2) - (var(--border-width) * 2));
|
|
203
|
+
--translateX: 50%;
|
|
204
|
+
--translateY: 50%;
|
|
205
|
+
--width: var(--height);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
&--switch {
|
|
210
|
+
--border-radius: var(--border-radius-curved);
|
|
211
|
+
--padding-horizontal: var(--border-width-400);
|
|
212
|
+
--padding-vertical: var(--border-width-400);
|
|
213
|
+
--width: var(--width-switch);
|
|
214
|
+
|
|
215
|
+
&::before {
|
|
216
|
+
--height: calc(var(--size) - (var(--border-width) * 2) - (var(--padding-vertical) * 2));
|
|
217
|
+
--width: var(--height);
|
|
218
|
+
|
|
219
|
+
#{tokens.state(active, '.field')} & {
|
|
220
|
+
--translateX: calc(var(--width-switch) - (var(--border-width) * 2) - var(--height) - (var(--padding-horizontal) * 2));
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|