UNPKG

2.75 kBSCSSView Raw
1@import '../../styles/common/colors';
2
3.checkbox-component {
4 cursor: pointer;
5 height: 100%;
6 overflow: hidden;
7 position: relative;
8 width: 100%;
9
10 > input {
11 cursor: pointer;
12 height: 100%;
13 left: 0;
14 margin: 0;
15 opacity: 0;
16 padding: 0;
17 position: absolute;
18 width: 100%;
19 top: 0;
20 z-index: 2;
21 }
22
23 &:not(.checkbox-error) {
24 > input:focus + div .checkbox-input,
25 > input:active + div .checkbox-input {
26 border-color: rgba($neutral-4, .6);
27 }
28 }
29
30 > input:checked + div .checkbox-input {
31 svg {
32 display: block;
33 width: 12px;
34 height: 12px;
35 }
36 }
37
38 > div {
39 align-items: center;
40 display: flex;
41 height: 100%;
42 width: 100%;
43
44 &.label-group {
45 align-items: inherit;
46 }
47
48 .checkbox-input {
49 align-items: center;
50 background-color: $white;
51 border: solid 2px $neutral-3;
52 border-radius: 3px;
53 display: flex;
54 flex-shrink: 0;
55 height: 14px;
56 justify-content: center;
57 transition: border-color ease-in-out .15s;
58 width: 14px;
59
60 svg {
61 display: none;
62 }
63 }
64
65 .label-wrapper {
66 display: flex;
67
68 .label-title {
69 font-size: 15px;
70 font-weight: 200;
71 line-height: 18px;
72 }
73
74 .label-description {
75 display: block;
76 line-height: 22px;
77 opacity: 0.85;
78 margin-bottom: -4px;
79 margin-top: 8px;
80 }
81 }
82
83 label {
84 color: $navy-text;
85 font-size: 14px;
86 margin-left: 10px;
87 margin-top: 1px;
88 }
89
90 }
91
92 &.checkbox-error {
93 > div .checkbox-input {
94 border-color: $danger;
95 }
96 }
97
98 &.checkbox-disabled {
99 cursor: not-allowed;
100
101 > input {
102 cursor: not-allowed;
103 }
104
105 > div {
106 label {
107 color: $neutral-3;
108 }
109
110 .checkbox-input {
111 background-color: $neutral-3;
112 border-color: $neutral-3;
113
114 &:before {
115 display: none;
116 }
117
118 }
119 }
120 }
121
122 &.checkbox-native {
123 align-items: baseline;
124 display: flex;
125 overflow: visible;
126
127 // Overrides to allow for Checkbox block to use
128 // native checkbox, as opposed to the "stylized" checkbox
129 // as used throughout the app
130 > div [class^='checkbox-input'] {
131 display: none;
132 }
133
134 .label-wrapper {
135 width: 100%;
136 }
137
138 > div label {
139 cursor: pointer;
140 margin-left: 8px;
141 margin-top: 0;
142 position: relative;
143 top: -2px;
144 width: 100%;
145 }
146
147 > input {
148 opacity: 1;
149 height: auto;
150 position: static;
151 width: auto;
152 }
153
154 &.has-description > input {
155 top: -14px;
156 }
157 }
158
159 &:hover {
160 .checkbox-input {
161 border-color: rgba($neutral-4, .4);
162 }
163 }
164}