|
1 | 1 | @import "./HXElement"; |
2 | 2 | @import "elements/hx-icon"; |
3 | 3 |
|
4 | | -#container { |
| 4 | +#hxCheckbox { |
5 | 5 | display: flex; |
6 | 6 | height: 100%; |
7 | 7 | position: relative; |
8 | 8 | width: 100%; |
9 | 9 | } |
10 | 10 |
|
11 | | -#customControl { |
| 11 | +#hxCustomControl { |
12 | 12 | align-content: center; |
13 | 13 | align-items: center; |
14 | 14 | background-color: @gray-0; |
|
30 | 30 | background-color: @cyan-50; |
31 | 31 | color: @cyan-500; |
32 | 32 | } |
33 | | -} |
34 | 33 |
|
35 | | -/* icons */ |
36 | | -#minus, |
37 | | -#tick { |
38 | | - display: none; |
39 | | - height: 1em; |
40 | | - line-height: 1; |
41 | | - width: 1em; |
| 34 | + /* icons */ |
| 35 | + #hxMinus, |
| 36 | + #hxTick { |
| 37 | + display: none; |
| 38 | + height: 1em; |
| 39 | + line-height: 1; |
| 40 | + width: 1em; |
| 41 | + } |
42 | 42 | } |
43 | 43 |
|
44 | | -#nativeControl:checked:not(:indeterminate) ~ #customControl #tick { |
| 44 | +#hxNativeControl:checked:not(:indeterminate) ~ #hxCustomControl #hxTick { |
45 | 45 | display: block; |
46 | 46 | } |
47 | 47 |
|
48 | | -#nativeControl:indeterminate ~ #customControl #minus { |
| 48 | +#hxNativeControl:indeterminate ~ #hxCustomControl #hxMinus { |
49 | 49 | display: block; |
50 | 50 | } |
51 | 51 |
|
52 | | -#nativeControl { |
| 52 | +#hxNativeControl { |
53 | 53 | /* opacity 0 because Firefox and OS focus styles */ |
54 | 54 | opacity: 0; |
55 | 55 | z-index: 0; |
|
58 | 58 | border: none; |
59 | 59 | outline: none; |
60 | 60 |
|
61 | | - ~ #customControl { |
| 61 | + ~ #hxCustomControl { |
62 | 62 | border-color: @cyan-700; |
63 | 63 | box-shadow: @focus-glow; |
64 | 64 | } |
65 | 65 | } |
66 | 66 |
|
67 | 67 | /* default checked and indeterminate (checked or unchecked) */ |
68 | 68 | &:checked, &:indeterminate { |
69 | | - ~ #customControl { |
| 69 | + ~ #hxCustomControl { |
70 | 70 | color: @cyan-900; |
71 | 71 |
|
72 | 72 | &:hover { |
|
77 | 77 | } |
78 | 78 |
|
79 | 79 | /* disabled unchecked */ |
80 | | - &:disabled ~ #customControl { |
| 80 | + &:disabled ~ #hxCustomControl { |
81 | 81 | background-color: @gray-100; |
82 | 82 | color: @gray-500; |
83 | 83 | cursor: not-allowed; |
|
91 | 91 |
|
92 | 92 | /* invalid */ |
93 | 93 | :host([invalid]){ |
94 | | - #customControl { |
| 94 | + #hxCustomControl { |
95 | 95 | border-width: 2px; |
96 | 96 | color: @red-900; |
97 | 97 |
|
|
100 | 100 | } |
101 | 101 | } |
102 | 102 |
|
103 | | - #nativeControl:focus ~ #customControl { |
| 103 | + #hxNativeControl:focus ~ #hxCustomControl { |
104 | 104 | border-color: @red-900; |
105 | 105 | box-shadow: @focus-glow-invalid; |
106 | 106 | } |
107 | 107 |
|
108 | 108 | /* below styles needed to override above, custom control styles */ |
109 | 109 | /* invalid and checked or indeterminate */ |
110 | | - #nativeControl:checked, #nativeControl:indeterminate { |
111 | | - ~ #customControl { |
| 110 | + #hxNativeControl:checked, #hxNativeControl:indeterminate { |
| 111 | + ~ #hxCustomControl { |
112 | 112 | color: @red-900; |
113 | 113 |
|
114 | 114 | &:hover { |
|
118 | 118 | } |
119 | 119 |
|
120 | 120 | /* invalid and disabled */ |
121 | | - #nativeControl:disabled ~ #customControl { |
| 121 | + #hxNativeControl:disabled ~ #hxCustomControl { |
122 | 122 | border-width: 1px; |
123 | 123 | color: @gray-500; |
124 | 124 |
|
|
0 commit comments