UNPKG

4.19 kBSCSSView Raw
1@import "mixins/settings.global";
2@import "mixins/components.lists";
3
4.c-card {
5 @include list--unstyled;
6 display: block;
7 border-radius: $card-border-radius;
8 background-color: $card-background-color;
9 box-shadow: $card-box-shadow;
10 overflow: hidden;
11
12 > .o-image:not(:first-child) {
13 padding: $spacing-medium 0 0;
14 }
15}
16
17.c-card + .c-card {
18 margin: $card-margin;
19}
20
21.c-card__header {
22 padding: $spacing-small $spacing-small 0;
23
24 .c-heading {
25 padding: 0;
26 }
27}
28
29.c-card__item,
30.c-card__body,
31.c-card__footer {
32 padding: $spacing-small;
33}
34
35.c-card__item + .c-card__footer--block {
36 padding: 0;
37}
38
39.c-card__footer--block {
40 padding: $spacing-small 0 0;
41
42 .c-input-group .c-button:first-child {
43 border-top-left-radius: 0;
44 border-bottom-left-radius: 0;
45 }
46
47 .c-input-group .c-button:last-child {
48 border-top-right-radius: 0;
49 border-bottom-right-radius: 0;
50 }
51}
52
53.c-card__item:not(:last-child) {
54 border-bottom: $card-item-border-bottom;
55}
56
57.c-card--accordion {
58 label.c-card__item {
59 display: block;
60 position: relative;
61 width: 100%;
62 padding-left: $spacing-xlarge;
63 cursor: pointer;
64
65 &:before {
66 position: absolute;
67 left: .75em;
68 content: "+";
69 }
70 }
71
72 > input {
73 display: none;
74 }
75
76 > input + .c-card__item + .c-card__item {
77 display: none;
78 }
79
80 > input:checked + .c-card__item + .c-card__item {
81 display: block;
82 }
83
84 > input:checked + .c-card__item:before {
85 transform: rotate(45deg);
86 }
87}
88
89.c-card--menu {
90 display: block;
91 width: $card-width;
92 max-height: $card-max-height;
93 margin: $card-margin;
94 z-index: $card-z-index;
95 overflow-y: auto;
96 overflow-x: hidden;
97 -webkit-overflow-scrolling: touch;
98}
99
100.c-card--grouped {
101 .c-card__item {
102 &:not(:last-child) {
103 border-bottom: 0;
104 }
105 }
106}
107
108.c-card__divider {
109 height: $card-item-border-width;
110 background-color: $card-item-divider-background-color;
111 overflow: hidden;
112}
113
114.c-card__item--divider {
115 background-color: $card-item-divider-background-color;
116 color: $card-item-divider-color;
117 font-weight: $card-item-divider-font-weight;
118}
119
120.c-card__item--brand {
121 background-color: $card-item-brand-background-color;
122 color: $card-item-brand-color;
123}
124
125.c-card__item--info {
126 background-color: $card-item-info-background-color;
127 color: $card-item-info-color;
128}
129
130.c-card__item--warning {
131 background-color: $card-item-warning-background-color;
132 color: $card-item-warning-color;
133}
134
135.c-card__item--success {
136 background-color: $card-item-success-background-color;
137 color: $card-item-success-color;
138}
139
140.c-card__item--error {
141 background-color: $card-item-error-background-color;
142 color: $card-item-error-color;
143}
144
145.c-card__item--disabled {
146 cursor: not-allowed;
147 opacity: $card-item-disabled-opacity;
148}
149
150.c-card--menu .c-card__item:not(.c-card__item--disabled):not(.c-card__item--divider):hover,
151.c-card--accordion label.c-card__item:not(.c-card__item--disabled):not(.c-card__item--divider):hover {
152 background-color: $card-item-hover-background-color;
153 cursor: pointer;
154
155 &.c-card__item--brand {
156 background-color: $card-item-brand-hover-background-color;
157 }
158
159 &.c-card__item--info {
160 background-color: $card-item-info-hover-background-color;
161 }
162
163 &.c-card__item--warning {
164 background-color: $card-item-warning-hover-background-color;
165 }
166
167 &.c-card__item--success {
168 background-color: $card-item-success-hover-background-color;
169 }
170
171 &.c-card__item--error {
172 background-color: $card-item-error-hover-background-color;
173 }
174}
175
176.c-card__item--active,
177.c-card--accordion > input:checked + .c-card__item {
178 background-color: $card-item-active-background-color;
179 font-weight: $card-item-active-font-weight;
180
181 &.c-card__item--brand {
182 background-color: $card-item-brand-active-background-color;
183 }
184
185 &.c-card__item--info {
186 background-color: $card-item-info-active-background-color;
187 }
188
189 &.c-card__item--warning {
190 background-color: $card-item-warning-active-background-color;
191 }
192
193 &.c-card__item--success {
194 background-color: $card-item-success-active-background-color;
195 }
196
197 &.c-card__item--error {
198 background-color: $card-item-error-active-background-color;
199 }
200}