File tree Expand file tree Collapse file tree 5 files changed +41
-5
lines changed
core/src/components/radio Expand file tree Collapse file tree 5 files changed +41
-5
lines changed Original file line number Diff line number Diff line change 5
5
// --------------------------------------------------
6
6
7
7
:host {
8
+ --color-checked : #{ion-color (primary , base )} ;
8
9
--width : #{$radio-ios-icon-width } ;
9
10
--height : #{$radio-ios-icon-height } ;
10
11
}
11
12
13
+ :host (.ion-color.radio-checked ) .radio-inner {
14
+ border-color : current-color (base );
15
+ }
12
16
13
17
.item-radio.item-ios ion-label {
14
18
@include margin-horizontal (0 , null);
32
36
border-top-width : 0 ;
33
37
border-left-width : 0 ;
34
38
border-style : $radio-ios-icon-border-style ;
35
- border-color : $radio-ios -color-on ;
39
+ border-color : var ( - -color-checked ) ;
36
40
}
37
41
38
42
Original file line number Diff line number Diff line change 5
5
// --------------------------------------------------
6
6
7
7
:host {
8
+ --color : #{$radio-md-color-off } ;
9
+ --color-checked : #{ion-color (primary , base )} ;
8
10
--width : #{$radio-md-icon-width } ;
9
11
--height : #{$radio-md-icon-height } ;
10
12
}
11
13
14
+ :host (.ion-color ) .radio-inner {
15
+ background : current-color (base );
16
+ }
17
+
18
+ :host (.ion-color.radio-checked ) .radio-icon {
19
+ border-color : current-color (base );
20
+ }
21
+
12
22
// Material Design Radio Outer Circle: Unchecked
13
23
// -----------------------------------------
14
24
19
29
20
30
border-width : $radio-md-icon-border-width ;
21
31
border-style : $radio-md-icon-border-style ;
22
- border-color : $radio-md -color-off ;
32
+ border-color : var ( - -color) ;
23
33
}
24
34
25
35
39
49
40
50
transition : transform $radio-md-transition-duration $radio-md-transition-easing ;
41
51
42
- background-color : $radio-md -color-on ;
52
+ background : var ( - -color-checked ) ;
43
53
}
44
54
45
55
46
56
// Material Design Radio Outer Circle: Checked
47
57
// -----------------------------------------
48
58
49
59
:host (.radio-checked ) .radio-icon {
50
- border-color : $radio-md -color-on ;
60
+ border-color : var ( - -color-checked ) ;
51
61
}
52
62
53
63
Original file line number Diff line number Diff line change 4
4
// --------------------------------------------------
5
5
6
6
:host {
7
- --ion-color-base : #{ion-color (primary , base )} ;
7
+ /* *
8
+ * @prop --color: Color of the radio
9
+ * @prop --color-checked: Color of the checked radio
10
+ */
8
11
9
12
display : inline-block ;
10
13
position : relative ;
Original file line number Diff line number Diff line change @@ -34,6 +34,14 @@ An `ion-radio-group` can be used to group a set of radios. When radios are insid
34
34
| ` ionStyle ` | Emitted when the styles change. |
35
35
36
36
37
+ ## CSS Custom Properties
38
+
39
+ | Name | Description |
40
+ | ----------------- | -------------------------- |
41
+ | ` --color ` | Color of the radio |
42
+ | ` --color-checked ` | Color of the checked radio |
43
+
44
+
37
45
----------------------------------------------
38
46
39
47
* Built with [ StencilJS] ( https://stenciljs.com/ ) *
Original file line number Diff line number Diff line change 40
40
< ion-radio checked color ="secondary " disabled > </ ion-radio >
41
41
</ p >
42
42
43
+ < p >
44
+ < ion-radio class ="custom "> </ ion-radio >
45
+ < ion-radio class ="custom " checked > </ ion-radio >
46
+ < ion-radio class ="custom " checked color ="primary "> </ ion-radio >
47
+ </ p >
48
+
43
49
< style >
44
50
/* to be able to see the radio buttons */
45
51
.radio-ios {
46
52
border : 1px solid # dedede ;
47
53
padding : 10px 5px ;
48
54
}
55
+
56
+ .custom {
57
+ --color : orange;
58
+ --color-checked : hotpink;
59
+ }
49
60
</ style >
50
61
</ body >
51
62
</ html >
You can’t perform that action at this time.
0 commit comments