4
4
// --------------------------------------------------
5
5
6
6
:host {
7
- --ion-color-base : #{ion-color (primary , base )} ;
8
- --ion-color-contrast : #{ion-color (primary , contrast )} ;
9
-
10
- // Checked colors
11
- --background-checked : #{current-color (base )} ;
12
- --border-color-checked : #{current-color (base )} ;
13
- --checkmark-color : #{current-color (contrast )} ;
7
+ /* *
8
+ * @prop --background: Background of the checkbox icon
9
+ * @prop --border-color: Border color of the checkbox icon
10
+ * @prop --border-radius: Border radius of the checkbox icon
11
+ * @prop --border-width: Border width of the checkbox icon
12
+ * @prop --border-style: Border style of the checkbox icon
13
+ * @prop --size: Size of the checkbox icon
14
+ * @prop --transition: Transition of the checkbox icon
15
+ * @prop --background-checked: Background of the checkbox icon when checked
16
+ * @prop --border-color-checked: Border color of the checkbox icon when checked
17
+ * @prop --checkmark-color: Color of the checkbox checkmark when checked
18
+ */
19
+ --background-checked : #{ion-color (primary , base )} ;
20
+ --border-color-checked : #{ion-color (primary , base )} ;
21
+ --checkmark-color : #{ion-color (primary , contrast )} ;
14
22
15
23
display : inline-block ;
16
24
position : relative ;
17
25
18
26
user-select : none ;
19
27
}
20
28
21
- :host (.checkbox-disabled ) {
22
- pointer-events : none ;
23
- }
24
-
25
- :host (.checkbox-checked ) .checkbox-icon {
26
- border-color : var (--border-color-checked );
27
-
28
- background : var (--background-checked );
29
- }
30
-
31
- :host (.checkbox-checked ) .checkbox-inner {
32
- opacity : 1 ;
29
+ :host (.ion-color ) {
30
+ --background-checked : #{current-color (base )} ;
31
+ --border-color-checked : #{current-color (base )} ;
32
+ --checkmark-color : #{current-color (contrast )} ;
33
33
}
34
34
35
35
input {
@@ -61,3 +61,22 @@ input {
61
61
opacity : 0 ;
62
62
}
63
63
64
+ // Checked Checkbox
65
+ // ---------------------------------------------
66
+
67
+ :host (.checkbox-checked ) .checkbox-icon {
68
+ border-color : var (--border-color-checked );
69
+
70
+ background : var (--background-checked );
71
+ }
72
+
73
+ :host (.checkbox-checked ) .checkbox-inner {
74
+ opacity : 1 ;
75
+ }
76
+
77
+ // Disabled Checkbox
78
+ // ---------------------------------------------
79
+
80
+ :host (.checkbox-disabled ) {
81
+ pointer-events : none ;
82
+ }
0 commit comments