Skip to content

Commit 942c39d

Browse files
committed
refactor(file): convert Light DOM LESS to SCSS
* convert `file-input-spec.less` after `button-spec.less`
1 parent 043904b commit 942c39d

File tree

9 files changed

+157
-1
lines changed

9 files changed

+157
-1
lines changed

src/less/components.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,4 @@
2727
@import 'components/checkbox/index';
2828
@import 'components/choice-tile/index';
2929
@import 'components/dropdown-select/index';
30-
@import 'components/file/index';
3130
@import 'components/form/index';

src/scss/components/_index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@import "breadcrumb/index";
66
@import "drawer/index";
77
@import "form/index";
8+
@import "file/index";
89
@import "grid/index";
910
@import "icon/index";
1011
@import "layout/index";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@import "vars";
2+
@import "components/form/config";
3+
@import "components/box/config";
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
hx-drop-fence {
2+
@include box-size(md);
3+
4+
border: 1px dashed $gray-600;
5+
display: block;
6+
font-size: 0.875rem;
7+
text-align: center;
8+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
hx-drop-zone {
2+
display: block;
3+
min-height: 0; // because IE
4+
padding: 0 !important;
5+
position: relative;
6+
7+
&::after {
8+
border: 4px dashed $cyan-500;
9+
content: "";
10+
display: none;
11+
height: 100%;
12+
left: 0;
13+
position: absolute;
14+
top: 0;
15+
width: 100%;
16+
}
17+
18+
&[drag] {
19+
&::after {
20+
display: block;
21+
}
22+
}
23+
24+
&[drag="over"] {
25+
&::after {
26+
background-color: rgba(255, 255, 255, 0.6);
27+
border-style: solid;
28+
}
29+
}
30+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
// ----- LAYOUT -----
2+
hx-file-control {
3+
position: relative;
4+
5+
> * {
6+
margin: 0;
7+
}
8+
9+
> label {
10+
display: inline-block;
11+
padding: 0;
12+
}
13+
14+
> input[type="file"] {
15+
@include hxInput(visuallyHidden);
16+
17+
background: none;
18+
19+
&::-ms-browse,
20+
&::-ms-value {
21+
opacity: 0.01;
22+
}
23+
}
24+
}
25+
26+
hx-file-control > input[type="file"]:focus {
27+
~ label > hx-file-input {
28+
box-shadow: $focus-glow;
29+
}
30+
}
31+
32+
hx-file-control > input[type="file"]:active {
33+
~ label > hx-file-input {
34+
// TODO refactor button mixins
35+
&.hxBtn {
36+
background-color: $cyan-700;
37+
border-color: transparent;
38+
color: $gray-0;
39+
}
40+
41+
// TODO refactor button mixins
42+
&.hxBtn.hxPrimary {
43+
background-color: $cyan-700;
44+
border-color: transparent;
45+
color: $gray-0;
46+
}
47+
48+
// TODO refactor button mixins
49+
&.hxBtn.hxTertiary {
50+
background-color: transparent;
51+
border-color: transparent;
52+
color: $cyan-700;
53+
}
54+
}
55+
}
56+
57+
// ========== DISABLED ==========
58+
hx-file-control > input[type="file"]:disabled {
59+
~ label {
60+
color: $gray-700;
61+
62+
> hx-file-input {
63+
cursor: not-allowed;
64+
65+
// TODO refactor button mixins
66+
&.hxBtn {
67+
background-color: transparent;
68+
border-color: $gray-400;
69+
color: $gray-400;
70+
}
71+
72+
// TODO refactor button mixins
73+
&.hxBtn.hxPrimary {
74+
background-color: $gray-400;
75+
border-color: transparent;
76+
color: $gray-700;
77+
}
78+
79+
// TODO refactor button mixins
80+
&.hxBtn.hxTertiary {
81+
background-color: transparent;
82+
border-color: transparent;
83+
color: $gray-400;
84+
}
85+
}
86+
}
87+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
hx-file-icon {
2+
display: inline-block;
3+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
hx-file-tile {
2+
background-color: $gray-50;
3+
border-radius: 2px;
4+
border: 2px solid transparent;
5+
color: $gray-900;
6+
display: block;
7+
height: 3.75rem;
8+
width: 25rem; // 400px
9+
10+
&[progress] {
11+
color: $gray-600;
12+
}
13+
14+
&[invalid] {
15+
border-color: $red-900;
16+
}
17+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@import "./config";
2+
3+
/// ========== PARTIALS ========== ///
4+
@import "./hx-drop-fence";
5+
@import "./hx-drop-zone";
6+
@import "./hx-file-control";
7+
@import "./hx-file-icon";
8+
@import "./hx-file-tile";

0 commit comments

Comments
 (0)