|
6 | 6 |
|
7 | 7 | @mixin nb-radio-theme() {
|
8 | 8 | nb-radio {
|
9 |
| - .radio-circle { |
| 9 | + .outer-circle, |
| 10 | + .inner-circle { |
10 | 11 | height: nb-theme(radio-height);
|
11 | 12 | width: nb-theme(radio-width);
|
| 13 | + } |
| 14 | + |
| 15 | + .outer-circle { |
12 | 16 | background-color: nb-theme(radio-background-color);
|
13 | 17 | border-color: nb-theme(radio-border-color);
|
14 | 18 | border-style: nb-theme(radio-border-style);
|
15 | 19 | border-width: nb-theme(radio-border-width);
|
16 | 20 | }
|
17 | 21 |
|
18 |
| - .native-input:enabled:checked + .radio-circle { |
| 22 | + .native-input:enabled:checked + .outer-circle { |
19 | 23 | border-color: nb-theme(radio-primary-border-color);
|
20 |
| - |
21 |
| - &::before { |
22 |
| - background-color: nb-theme(radio-primary-inner-circle-color);; |
23 |
| - } |
| 24 | + } |
| 25 | + .native-input:enabled:checked ~ .inner-circle { |
| 26 | + background-color: nb-theme(radio-primary-inner-circle-color);; |
24 | 27 | }
|
25 | 28 |
|
26 |
| - .native-input:enabled:focus + .radio-circle { |
| 29 | + .native-input:enabled:focus + .outer-circle { |
27 | 30 | border-color: nb-theme(radio-primary-focus-border-color);
|
28 | 31 | box-shadow: 0 0 0 nb-theme(radio-outline-width) nb-theme(radio-outline-color);
|
29 | 32 | }
|
30 |
| - .native-input:enabled:checked:focus + .radio-circle::before { |
| 33 | + .native-input:enabled:checked:focus ~ .inner-circle { |
31 | 34 | background-color: nb-theme(radio-primary-focus-inner-circle-color);
|
32 | 35 | }
|
33 | 36 |
|
34 |
| - label:hover .native-input:enabled + .radio-circle { |
| 37 | + label:hover .native-input:enabled + .outer-circle { |
35 | 38 | border-color: nb-theme(radio-primary-hover-border-color);
|
36 | 39 | }
|
37 |
| - label:hover .native-input:checked:enabled + .radio-circle::before { |
| 40 | + label:hover .native-input:checked:enabled ~ .inner-circle { |
38 | 41 | background-color: nb-theme(radio-primary-hover-inner-circle-color);
|
39 | 42 | }
|
40 | 43 |
|
41 |
| - label .native-input:enabled:active + .radio-circle { |
| 44 | + label .native-input:enabled:active + .outer-circle { |
42 | 45 | border-color: nb-theme(radio-primary-active-border-color);
|
43 | 46 | }
|
44 |
| - label .native-input:enabled:checked:active + .radio-circle::before { |
| 47 | + label .native-input:enabled:checked:active ~ .inner-circle { |
45 | 48 | background-color: nb-theme(radio-primary-active-inner-circle-color);
|
46 | 49 | }
|
47 | 50 |
|
48 |
| - .native-input:disabled + .radio-circle { |
| 51 | + .native-input:disabled + .outer-circle { |
49 | 52 | border-color: nb-theme(radio-disabled-border-color);
|
50 | 53 | }
|
51 |
| - .native-input:disabled:checked + .radio-circle::before { |
| 54 | + .native-input:disabled:checked ~ .inner-circle { |
52 | 55 | background-color: nb-theme(radio-disabled-inner-circle-color);
|
53 | 56 | }
|
54 | 57 | .native-input:disabled ~ .text {
|
55 | 58 | color: nb-theme(radio-disabled-text-color);
|
56 | 59 | }
|
57 | 60 |
|
58 | 61 | @each $status in nb-get-statuses() {
|
59 |
| - &.status-#{$status} .native-input:enabled + .radio-circle { |
| 62 | + &.status-#{$status} .native-input:enabled + .outer-circle { |
60 | 63 | border-color: nb-theme(radio-#{$status}-border-color);
|
61 | 64 | }
|
62 |
| - &.status-#{$status} .native-input:enabled:checked + .radio-circle::before { |
| 65 | + &.status-#{$status} .native-input:enabled:checked ~ .inner-circle { |
63 | 66 | background-color: nb-theme(radio-#{$status}-inner-circle-color);;
|
64 | 67 | }
|
65 | 68 |
|
66 |
| - &.status-#{$status} .native-input:enabled:focus + .radio-circle { |
| 69 | + &.status-#{$status} .native-input:enabled:focus + .outer-circle { |
67 | 70 | border-color: nb-theme(radio-#{$status}-focus-border-color);
|
68 | 71 | }
|
69 |
| - &.status-#{$status} .native-input:enabled:checked:focus + .radio-circle::before { |
| 72 | + &.status-#{$status} .native-input:enabled:checked:focus ~ .inner-circle { |
70 | 73 | background-color: nb-theme(radio-#{$status}-focus-inner-circle-color);
|
71 | 74 | }
|
72 | 75 |
|
73 |
| - &.status-#{$status} label:hover .native-input:enabled + .radio-circle { |
| 76 | + &.status-#{$status} label:hover .native-input:enabled + .outer-circle { |
74 | 77 | border-color: nb-theme(radio-#{$status}-hover-border-color);
|
75 | 78 | }
|
76 |
| - &.status-#{$status} label:hover .native-input:checked:enabled + .radio-circle::before { |
| 79 | + &.status-#{$status} label:hover .native-input:checked:enabled ~ .inner-circle { |
77 | 80 | background-color: nb-theme(radio-#{$status}-hover-inner-circle-color);
|
78 | 81 | }
|
79 | 82 |
|
80 |
| - &.status-#{$status} label .native-input:enabled:active + .radio-circle { |
| 83 | + &.status-#{$status} label .native-input:enabled:active + .outer-circle { |
81 | 84 | border-color: nb-theme(radio-#{$status}-active-border-color);
|
82 | 85 | }
|
83 |
| - &.status-#{$status} label .native-input:enabled:checked:active + .radio-circle::before { |
| 86 | + &.status-#{$status} label .native-input:enabled:checked:active ~ .inner-circle { |
84 | 87 | background-color: nb-theme(radio-#{$status}-active-inner-circle-color);
|
85 | 88 | }
|
86 | 89 | }
|
|
91 | 94 | font-size: nb-theme(radio-text-font-size);
|
92 | 95 | font-weight: nb-theme(radio-text-font-weight);
|
93 | 96 | line-height: nb-theme(radio-text-line-height);
|
| 97 | + margin-left: nb-theme(radio-width); |
94 | 98 | }
|
95 | 99 | }
|
96 | 100 | }
|
0 commit comments