Skip to content

Commit 461d63a

Browse files
author
Cathy Siller
committed
refactor(elements-css): moving elements css into component based css
chore(pr-review): corrections from pr review
1 parent d0fd2dc commit 461d63a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+648
-683
lines changed

src/helix-ui.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
@import 'config';
33
@import 'reset';
44
@import 'base';
5-
@import 'elements';
65
@import 'components';
76
@import 'helpers';
87
@import 'overrides';

src/helix-ui/elements/HXFileTileElement.less

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
@import "./HXElement";
22
@import "base/links";
3-
@import "elements/hx-progress";
4-
@import "components/progress";
53
@import (reference) "components/buttons";
4+
@import (reference) "components/progress";
65

76
:host {
87
// reset buttons

src/helix-ui/styles/components.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- Complex CSS Selectors
33
- NO !important
44
\* ========== COMPONENTS ========== */
5+
@import 'components/accordions';
56
@import 'components/alerts';
67
@import 'components/badges';
78
@import 'components/box';
@@ -10,18 +11,28 @@
1011
@import 'components/checkbox';
1112
@import 'components/choice-tiles';
1213
@import 'components/dropdown-select';
14+
@import 'components/files';
1315
@import 'components/forms';
1416
@import 'components/grid';
17+
@import 'components/icons';
1518
@import 'components/layouts';
1619
@import 'components/lists';
20+
@import 'components/loaders';
21+
@import 'components/menus';
22+
@import 'components/modals';
1723
@import 'components/navigation';
1824
@import 'components/pagination';
1925
@import 'components/panels';
26+
@import 'components/pills';
27+
@import 'components/popovers';
2028
@import 'components/progress';
29+
@import 'components/reveals';
2130
@import 'components/search';
2231
@import 'components/selectors';
2332
@import 'components/stepper'; // BETA
2433
@import 'components/tables';
2534
@import 'components/tabs';
2635
@import 'components/text-inputs';
36+
@import 'components/toasts';
37+
@import 'components/tooltips';
2738
@import 'components/typography';

src/helix-ui/styles/elements/hx-accordion-panel.less renamed to src/helix-ui/styles/components/accordions.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ hx-accordion-panel {
1616
padding: 0.5rem 0;
1717
}
1818
}
19+
20+
hx-accordion {
21+
display: block;
22+
}
23+

src/helix-ui/styles/components/alerts.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
hx-alert {
22
background-color: @gray-400;
33
color: @gray-1000;
4+
display: block;
45
font-weight: 300;
56
line-height: 1.25rem;
67

src/helix-ui/styles/components/choice-tiles.less

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,77 @@
1+
@import (reference) 'components/box';
12
@import (reference) 'components/grid';
23
@import (reference) 'mixins';
34

5+
hx-tile {
6+
#Box.md();
7+
border-radius: 2px;
8+
display: inline-block;
9+
height: 100%;
10+
position: relative;
11+
text-align: center;
12+
width: 100%;
13+
14+
> header {
15+
font-size: 1rem;
16+
font-weight: 700;
17+
margin-bottom: 0;
18+
}
19+
20+
> p {
21+
font-size: 0.75rem;
22+
}
23+
24+
&.hxSm {
25+
@pad: 0.75rem;
26+
padding: @pad;
27+
28+
> p {
29+
display: none;
30+
}
31+
32+
hx-icon[type="checkmark"] {
33+
right: @pad;
34+
top: @pad;
35+
}
36+
}
37+
38+
&.hxLg {
39+
@pad: 1.75rem;
40+
padding: @pad;
41+
42+
hx-icon[type="checkmark"] {
43+
right: @pad;
44+
top: @pad;
45+
}
46+
}
47+
48+
> header + *,
49+
.hx-tile-icon + * {
50+
margin-top: 0.5rem;
51+
}
52+
53+
.hx-tile-icon {
54+
hx-icon {
55+
font-size: 1.75rem;
56+
}
57+
}
58+
59+
hx-icon[type="checkmark"] {
60+
display: none;
61+
font-size: 1rem;
62+
right: 1.25rem;
63+
top: 1.25rem;
64+
}
65+
66+
&.hxSubdued {
67+
opacity: 0.7;
68+
69+
&:hover {
70+
opacity: 1;
71+
}
72+
}
73+
}//hx-tile
74+
475
.hxRow > label.hxChoice {
576
#grid.column();
677
}
@@ -142,3 +213,31 @@ label.hxChoice > input[disabled] + hx-tile:hover {
142213
color: @gray-500;
143214
}
144215
}
216+
217+
// DEPRECATED: remove in v1.0.0
218+
hx-tile-description {
219+
display: block;
220+
font-size: 0.75rem;
221+
}
222+
223+
hx-tile-title {
224+
display: block;
225+
font-size: 1rem;
226+
font-weight: 700;
227+
}
228+
229+
hx-tile {
230+
hx-tile-title {
231+
margin-bottom: 0;
232+
}
233+
234+
&.hxSm {
235+
hx-tile-description {
236+
display: none;
237+
}
238+
}
239+
240+
hx-tile-title + * {
241+
margin-top: 0.5rem;
242+
}
243+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
@import (reference) 'components/box';
2+
3+
hx-drop-fence {
4+
#Box.md();
5+
border: 1px dashed @gray-600;
6+
display: block;
7+
font-size: 0.875rem;
8+
text-align: center;
9+
}
10+
11+
hx-drop-zone {
12+
display: block;
13+
min-height: 0; // because IE
14+
padding: 0 !important;
15+
position: relative;
16+
17+
&::after {
18+
border: 4px dashed @cyan-500;
19+
content: '';
20+
display: none;
21+
height: 100%;
22+
left: 0;
23+
position: absolute;
24+
top: 0;
25+
width: 100%;
26+
}
27+
28+
&[drag]{
29+
&::after {
30+
display: block;
31+
}
32+
}
33+
34+
&[drag="over"] {
35+
&::after {
36+
background-color: rgba(255, 255, 255, 0.6);
37+
border-style: solid;
38+
}
39+
}
40+
}
41+
42+
hx-file-icon {
43+
display: inline-block;
44+
}
45+
46+
hx-file-input {
47+
display: inline-block;
48+
position: relative;
49+
50+
input[type="file"] {
51+
-moz-appearance: none;
52+
-webkit-appearance: none;
53+
appearance: none;
54+
border: 0;
55+
height: 1px;
56+
margin: -1px;
57+
outline: none;
58+
overflow: hidden;
59+
padding: 0;
60+
position: absolute;
61+
width: 1px;
62+
z-index: -10;
63+
}
64+
}
65+
66+
hx-file-tile {
67+
display: block;
68+
height: 3.75rem;
69+
width: 25rem; // 400px
70+
}

src/helix-ui/styles/components/layouts.less

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@import (reference) 'vars';
2+
@import (reference) 'components/box';
3+
14
// NOTE: be aware of changes needed in the base/typography.less
25
@header-height: 3.5rem; // 56px
36
@footer-height: 2.5rem; // 40px
@@ -194,3 +197,115 @@ body.hxHorizontal {
194197
grid-area: footer;
195198
}
196199
}//body.hxHorizontal
200+
201+
// TODO: refactor and find a better home for this mixin
202+
#HXDiv {
203+
.shadyRoot(@rules) {
204+
> #hxDiv {
205+
@rules();
206+
}
207+
}
208+
}
209+
210+
hx-div {
211+
display: block;
212+
padding: 0 !important; // avoid unfixable padding-block-end bug
213+
214+
&[scroll="horizontal"] {
215+
overflow-x: auto;
216+
overflow-y: hidden;
217+
}
218+
219+
&[scroll="vertical"] {
220+
overflow-x: hidden;
221+
overflow-y: auto;
222+
}
223+
224+
&[scroll="both"] {
225+
overflow: auto;
226+
}
227+
228+
&[scroll="none"] {
229+
overflow: visible;
230+
}
231+
}
232+
233+
// ===== Polyfilled browsers =====
234+
// CSS specificity overrides selectors in the next block
235+
hx-div {
236+
&.hxXs {
237+
#HXDiv.shadyRoot({
238+
#Box.xs();
239+
});
240+
}
241+
242+
&.hxSm {
243+
#HXDiv.shadyRoot({
244+
#Box.sm();
245+
});
246+
}
247+
248+
&.hxMd {
249+
#HXDiv.shadyRoot({
250+
#Box.md();
251+
});
252+
}
253+
254+
&.hxLg {
255+
#HXDiv.shadyRoot({
256+
#Box.lg();
257+
});
258+
}
259+
260+
&.hxXl {
261+
#HXDiv.shadyRoot({
262+
#Box.xl();
263+
});
264+
}
265+
266+
&.hx2x {
267+
#HXDiv.shadyRoot({
268+
#Box.xxl();
269+
});
270+
}
271+
272+
&.hxFlush {
273+
#HXDiv.shadyRoot({
274+
#Box.flush();
275+
});
276+
}
277+
}
278+
279+
// ===== Modern Browsers =====
280+
// Should only apply to browsers with ShadowDOM support.
281+
@supports(--modern: true) {
282+
hx-div {
283+
&.hxXs {
284+
--padding-base: @space[xs];
285+
}
286+
287+
&.hxSm {
288+
--padding-base: @space[sm];
289+
}
290+
291+
&.hxMd {
292+
--padding-base: @space[md];
293+
}
294+
295+
&.hxLg {
296+
--padding-base: @space[lg];
297+
}
298+
299+
&.hxXl {
300+
--padding-base: @space[xl];
301+
}
302+
303+
&.hx2x {
304+
--padding-base: @space[xxl];
305+
}
306+
307+
&.hxFlush {
308+
--padding-base: @space[flush];;
309+
}
310+
}
311+
}

src/helix-ui/styles/components/lists.less

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ dl.hxList.hxVertical {
5757
}
5858
}
5959

60-
ol.hxList,
60+
ol.hxList,
6161
ul.hxList {
6262
margin-left: 1.25rem;
6363
padding-left: 1.25rem;
@@ -117,3 +117,13 @@ hx-dl.hxVertical {
117117
margin: 0;
118118
}
119119
}
120+
121+
hx-dl,
122+
hx-dd,
123+
hx-dt {
124+
display: block;
125+
}
126+
127+
hx-def {
128+
display: flex;
129+
}

0 commit comments

Comments
 (0)