1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | @import '../../globals/scss/vars';
|
13 | @import '../../globals/scss/helper-mixins';
|
14 | @import '../../globals/scss/vendor/@carbon/elements/scss/import-once/import-once';
|
15 | @import '../../globals/scss/css--reset';
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | @mixin tile {
|
21 | .#{$prefix}--tile {
|
22 | position: relative;
|
23 | display: block;
|
24 | min-width: 8rem;
|
25 | min-height: 4rem;
|
26 | padding: $carbon--spacing-05;
|
27 | background-color: $ui-01;
|
28 | outline: 2px solid transparent;
|
29 | outline-offset: -2px;
|
30 |
|
31 | &:focus {
|
32 | @include focus-outline('outline');
|
33 | }
|
34 | }
|
35 |
|
36 | .#{$prefix}--tile--light {
|
37 | background-color: $ui-02;
|
38 | }
|
39 |
|
40 | .#{$prefix}--tile--clickable,
|
41 | .#{$prefix}--tile--selectable,
|
42 | .#{$prefix}--tile--expandable {
|
43 | cursor: pointer;
|
44 | transition: $duration--moderate-01 motion(standard, productive);
|
45 |
|
46 | &:hover {
|
47 | background: $hover-ui;
|
48 | }
|
49 | }
|
50 |
|
51 | .#{$prefix}--tile--clickable,
|
52 | .#{$prefix}--tile--expandable {
|
53 | &:focus {
|
54 | @include focus-outline('outline');
|
55 | }
|
56 |
|
57 | &:hover,
|
58 | &:focus {
|
59 | .#{$prefix}--tile__checkmark {
|
60 | opacity: 1;
|
61 | }
|
62 | }
|
63 | }
|
64 |
|
65 |
|
66 | .#{$prefix}--tile--expandable::-moz-focus-inner {
|
67 | border: 0;
|
68 | }
|
69 |
|
70 | .#{$prefix}--tile--clickable {
|
71 | @include reset;
|
72 | @include type-style('body-short-01');
|
73 |
|
74 | color: $text-01;
|
75 | text-decoration: none;
|
76 | }
|
77 |
|
78 | .#{$prefix}--tile--selectable {
|
79 | padding-right: $carbon--spacing-09;
|
80 | }
|
81 |
|
82 | .#{$prefix}--tile__checkmark,
|
83 | .#{$prefix}--tile__chevron {
|
84 | position: absolute;
|
85 | background: transparent;
|
86 | border: none;
|
87 | transition: $duration--fast-02 motion(standard, productive);
|
88 | }
|
89 |
|
90 | .#{$prefix}--tile__checkmark {
|
91 | top: 1rem;
|
92 | right: 1rem;
|
93 | height: 1rem;
|
94 | opacity: 0;
|
95 |
|
96 | svg {
|
97 | border-radius: 50%;
|
98 | fill: $icon-02;
|
99 | }
|
100 |
|
101 | &:focus {
|
102 | @include focus-outline('outline');
|
103 | }
|
104 | }
|
105 |
|
106 | .#{$prefix}--tile__chevron {
|
107 | position: absolute;
|
108 | right: 0.5rem;
|
109 | bottom: 0.5rem;
|
110 | height: 1rem;
|
111 |
|
112 | svg {
|
113 | transform-origin: center;
|
114 | transition: $duration--fast-02 motion(standard, productive);
|
115 | fill: $ui-05;
|
116 | }
|
117 |
|
118 | &:hover {
|
119 | cursor: pointer;
|
120 | }
|
121 |
|
122 | &:focus {
|
123 | outline: none;
|
124 | }
|
125 | }
|
126 |
|
127 | .#{$prefix}--tile--expandable {
|
128 | width: 100%;
|
129 | overflow: hidden;
|
130 | color: inherit;
|
131 | font-size: inherit;
|
132 | text-align: left;
|
133 | border: 0;
|
134 | transition: max-height $duration--moderate-01 motion(standard, productive);
|
135 | }
|
136 |
|
137 | .#{$prefix}--tile-content__above-the-fold {
|
138 | display: block;
|
139 | }
|
140 |
|
141 | .#{$prefix}--tile-content__below-the-fold {
|
142 | display: block;
|
143 | visibility: hidden;
|
144 | opacity: 0;
|
145 | transition: opacity $duration--fast-02 motion(standard, productive),
|
146 | visibility $duration--fast-02 motion(standard, productive);
|
147 | }
|
148 |
|
149 | .#{$prefix}--tile--is-expanded {
|
150 | overflow: visible;
|
151 | transition: max-height $duration--fast-02 motion(standard, productive);
|
152 |
|
153 | .#{$prefix}--tile__chevron svg {
|
154 | transform: rotate(-180deg);
|
155 | }
|
156 |
|
157 | .#{$prefix}--tile-content__below-the-fold {
|
158 | visibility: inherit;
|
159 | opacity: 1;
|
160 | transition: opacity $duration--fast-02 motion(standard, productive),
|
161 | visibility $duration--fast-02 motion(standard, productive);
|
162 | }
|
163 | }
|
164 |
|
165 | .#{$prefix}--tile--is-selected {
|
166 | outline: 1px solid $ui-05;
|
167 | outline-offset: -1px;
|
168 | }
|
169 |
|
170 | .#{$prefix}--tile--is-selected .#{$prefix}--tile__checkmark {
|
171 | opacity: 1;
|
172 | }
|
173 |
|
174 | .#{$prefix}--tile-input:checked
|
175 | + .#{$prefix}--tile
|
176 | > .#{$prefix}--tile__checkmark
|
177 | svg {
|
178 | fill: $ui-05;
|
179 | }
|
180 |
|
181 | .#{$prefix}--tile-content {
|
182 | width: 100%;
|
183 | height: 100%;
|
184 | }
|
185 |
|
186 | .#{$prefix}--tile-input {
|
187 | @include hidden;
|
188 | }
|
189 |
|
190 | .#{$prefix}--tile-input:focus + .#{$prefix}--tile {
|
191 | @include focus-outline('outline');
|
192 | }
|
193 | }
|
194 |
|
195 | @include exports('tile') {
|
196 | @include tile;
|
197 | }
|