@@ -21,6 +21,14 @@ $checkbox-size: 16px;
21
21
width : fit-content ;
22
22
height : min-content ;
23
23
24
+ & __label {
25
+ @include font-input ();
26
+ cursor : pointer ;
27
+ user-select : none ;
28
+ margin-inline-start : $spacing-small ;
29
+ @include theme-prop (color , primary- text- color);
30
+ }
31
+
24
32
& __checkbox {
25
33
cursor : pointer ;
26
34
visibility : visible ;
@@ -64,14 +72,6 @@ $checkbox-size: 16px;
64
72
}
65
73
}
66
74
67
- & __label {
68
- @include font-input ();
69
- cursor : pointer ;
70
- user-select : none ;
71
- margin-inline-start : $spacing-small ;
72
- @include theme-prop (color , primary- text- color);
73
- }
74
-
75
75
// Since it is not possible to change the design of the checkbox according to the requirements using css,
76
76
// we hide the checkbox and draw a new one instead.
77
77
// In order to allow accessibility, all operations will be performed on the hidden checkbox and be reflected
@@ -81,13 +81,13 @@ $checkbox-size: 16px;
81
81
82
82
// For any active attribute in the hidden checkbox, we will change the appearance of the checkbox we drew in its place.
83
83
& :focus {
84
- & + .monday-style-checkbox__checkbox {
85
- @include hover-unselected ;
86
- }
87
-
88
84
& :checked + .monday-style-checkbox__checkbox {
89
85
@include hover-selected ;
90
86
}
87
+
88
+ & + .monday-style-checkbox__checkbox {
89
+ @include hover-unselected ;
90
+ }
91
91
}
92
92
& :focus-visible {
93
93
& + .monday-style-checkbox__checkbox {
@@ -99,11 +99,21 @@ $checkbox-size: 16px;
99
99
}
100
100
}
101
101
102
- & :checked , & :indeterminate {
103
- & :focus + .monday-style-checkbox__checkbox :after {
104
- @include theme-prop (background-color , primary- hover- color);
102
+ & :disabled {
103
+ & + .monday-style-checkbox {
104
+ & __checkbox ,
105
+ & __checkbox :hover {
106
+ @include theme-prop (background-color , disabled- background- color);
107
+ @include theme-prop (border-color , ui- border- color);
108
+
109
+ .monday-style-checkbox__icon {
110
+ @include theme-prop (color , disabled- text- color);
111
+ }
112
+ }
105
113
}
114
+ }
106
115
116
+ & :checked , & :indeterminate {
107
117
& + .monday-style-checkbox {
108
118
& __checkbox {
109
119
animation : checkbox- grow- animation 50ms ;
@@ -137,25 +147,16 @@ $checkbox-size: 16px;
137
147
}
138
148
}
139
149
150
+ & :focus + .monday-style-checkbox__checkbox :after {
151
+ @include theme-prop (background-color , primary- hover- color);
152
+ }
153
+
140
154
& :disabled + .monday-style-checkbox {
141
155
& __checkbox :after {
142
156
@include theme-prop (background-color , disabled- background- color);
143
157
}
144
158
}
145
159
}
146
- & :disabled {
147
- & + .monday-style-checkbox {
148
- & __checkbox ,
149
- & __checkbox :hover {
150
- @include theme-prop (background-color , disabled- background- color);
151
- @include theme-prop (border-color , ui- border- color);
152
-
153
- .monday-style-checkbox__icon {
154
- @include theme-prop (color , disabled- text- color);
155
- }
156
- }
157
- }
158
- }
159
160
}
160
161
}
161
162
0 commit comments