44// Default styles for checkbox and radio
55
66.ui.option {
7- display : flex ;
8- align-items : flex-start ;
9- margin : 0 0 spacer (" 4x" ) 0 ;
10- cursor : pointer ;
7+ display : block ;
118 position : relative ;
9+ margin-bottom : 1rem ;
10+ padding-left : 26px ;
11+ cursor : pointer ;
1212 line-height : 1.2 ;
13- font-size : $font-size-base ;
13+ font-size : $font-size-content- base ;
1414
15- & :hover {
16- .control__indicator {
17- border-color : $control-bg-hover ;
15+ .control__input {
16+ position : absolute ;
17+ width : 1px ;
18+ height : 1px ;
19+ margin : -1px ;
20+ padding : 0 ;
21+ overflow : hidden ;
22+ border : 0 ;
23+ clip : rect (0 0 0 0 );
24+ }
25+
26+ .control__indicator {
27+ line-height : 1.2 ;
28+
29+ & ::after {
30+ content : " " ;
31+ position : absolute ;
32+ z-index : 201 ;
33+ left : 0 ;
34+ width : $control-size ;
35+ height : $control-size ;
36+ opacity : 0 ;
1837 }
1938
20- .control__description {
21- color : $input-color ;
39+ & ::before {
40+ content : " " ;
41+ display : block ;
42+ position : absolute ;
43+ z-index : 200 ;
44+ width : $control-size ;
45+ height : $control-size ;
46+ top : 0 ;
47+ left : 0 ;
48+ border-radius : $border-radius ;
49+ border : $control-border-width solid $control-border-color ;
50+ background-color : $control-bg ;
51+ transition : .075s ease-out ;
52+ transition-property : transform , border-color , background-color ;
2253 }
2354 }
2455
25- .control__input {
26- position : absolute ;
27- top : 50% ;
28- left : 12px ;
29- transform : translate (-50% , -50% );
30- opacity : 0 ;
31- margin : 0 ;
32- padding : 0 ;
33-
34- & :checked {
35- ~ .control__indicator {
56+ .control__input :checked {
57+ ~ .control__indicator {
58+ & ::before {
3659 border : none ;
37- background : $control-checked-bg ;
60+ background-color : $control-checked-bg ;
61+ }
62+
63+ & ::after {
64+ opacity : 1 ;
65+ transition : opacity .075s ease-in-out , transform .125s ease-in-out ;
3866 }
3967 }
68+ }
4069
41- & :focus {
42- ~ .control__indicator {
70+ .control__input :focus {
71+ ~ .control__indicator {
72+ & ::before {
4373 border : none ;
4474 box-shadow : inset 0 0 2px 1px rgba ($gray-darker , .5 );
4575 }
4676 }
4777 }
4878
49- .control__indicator {
50- display : block ;
51- position : absolute ;
52- width : $control-size ;
53- height : $control-size ;
54- border : $control-border-width solid $control-border-color ;
55- border-radius : $border-radius ;
56- background-color : $control-bg ;
57- background-size : 135% ;
58- }
59-
60- .control__description {
61- margin : 0 0 0 26px ;
62- display : inline-block ;
63- color : $control-color ;
79+ & :hover {
80+ .control__indicator ::before {
81+ border : $control-border-width solid $gray-dark ;
82+ }
6483 }
6584
6685 & .disabled {
6786 cursor : default ;
87+ opacity : .5 ;
6888
69- & :hover .control__indicator {
70- border-color : $control-border-color ;
89+ .control__indicator ::before {
90+ border-color : $control-disabled-bg ;
7191 }
7292
73- .control__input {
74- & :checked ~ .control__indicator {
75- background : $control-disabled-bg ;
76-
93+ & :hover {
94+ .control__indicator ::before {
95+ border-color : $control-disabled-bg ;
7796 }
7897 }
79-
80- .control__description {
81- color : $control-disabled-bg ;
82- }
8398 }
8499}
85100
89104 display : block ;
90105
91106 .option :last-child {
92- margin-bottom : 0 !important ;
107+ margin-bottom : 0 !important ;
93108 }
94109
95110 & .inline {
114129 margin-bottom : 0 ;
115130 }
116131 }
117- }
132+ }
0 commit comments