Skip to content

Commit ec2febf

Browse files
committed
feat(styling): enhancement
1 parent 8c1ccdb commit ec2febf

22 files changed

+258
-195
lines changed

src/client/styles/base/last.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*************************
2+
* IMPORT THIS FILE LAST!
3+
*************************/
4+
:host([hidden]) {
5+
display: none;
6+
}
7+
8+
input[hidden] {
9+
display: none;
10+
}
11+
12+
.form-control {
13+
&[disabled] {
14+
opacity: .65;
15+
pointer-events: none;
16+
}
17+
}

src/client/styles/main/checkbox.scss renamed to src/client/styles/layout/checkbox.scss

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
***********/
44
.checkbox {
55
position: relative;
6-
top: remy(1);
7-
margin-right: remy(6);
8-
border: 1px solid mapGet($formControlColors, borders, checkbox, default);
9-
&::before,
10-
&::after {
6+
top: -1px;
7+
margin-right: 6px;
8+
&::before, &::after {
119
opacity: 0;
1210
position: absolute;
1311
transition: all .3s;
@@ -26,15 +24,15 @@
2624
height: $dim;
2725
min-width: $dim;
2826
min-height: $dim;
29-
&::before { // outer circle
27+
&::before { // outer square
3028
$dim: 220%;
3129
$coords: -61%;
3230
top: $coords;
3331
left: $coords;
3432
width: $dim;
3533
height: $dim;
3634
}
37-
&::after { // the dot
35+
&::after { // the check
3836
$dim: 50%;
3937
$coords: 28%;
4038
$width: remy(3.5);
@@ -51,25 +49,8 @@
5149
/* States
5250
*********/
5351
.sublabel {
54-
&:focus {
55-
outline: none;
56-
}
57-
&.active {
58-
font-weight: 400;
59-
letter-spacing: .025em;
60-
}
61-
&:focus .checkbox,
62-
&:hover .checkbox,
63-
&.active .checkbox {
64-
border-color: mapGet($formControlColors, borders, active, default);
65-
}
52+
&:focus { outline: none; }
6653
&:focus .checkbox::before,
67-
&:hover .checkbox::before {
68-
opacity: .1;
69-
background-color: mapGet($formControlColors, bg, active, default);
70-
}
71-
&.active .checkbox::after {
72-
opacity: 1;
73-
border-color: mapGet($formControlColors, bg, active, default);
74-
}
54+
&:hover .checkbox::before { opacity: .1; }
55+
&.active .checkbox::after { opacity: 1; }
7556
}

src/client/styles/layout/host.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*******
2+
* HOST
3+
*******/
4+
:host {
5+
all: initial; // reset all styles first
6+
contain: layout style; // paint cuts off the label above
7+
}
8+
9+
:host {
10+
width: 100%;
11+
margin-bottom: 25px;
12+
display: inline-block;
13+
}
14+
:host([inline]) {
15+
width: auto;
16+
margin-right: 15px;
17+
}
18+
:host([inline][right]) {
19+
margin-right: 0;
20+
margin-left: 15px;
21+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/********
2+
* LABEL
3+
********/
4+
.label {
5+
margin-bottom: 12px;
6+
cursor: text;
7+
}
8+
9+
.sublabel {
10+
display: flex;
11+
cursor: pointer;
12+
margin-bottom: 12px;
13+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**********
2+
* OPTIONS
3+
**********/
4+
.form-control {
5+
&.horizontal {
6+
flex-direction: row;
7+
.label {
8+
align-self: flex-start;
9+
margin-right: 15px;
10+
}
11+
}
12+
&.right {
13+
align-items: flex-end;
14+
justify-content: flex-end;
15+
.sublabel {
16+
flex-direction: row-reverse;
17+
}
18+
.checkbox {
19+
margin-right: 0;
20+
margin-left: 6px;
21+
}
22+
.subtext {
23+
text-align: right;
24+
}
25+
}
26+
}

src/client/styles/layout/root.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*****************
2+
* COMPONENT ROOT
3+
*****************/
4+
.form-control {
5+
display: flex;
6+
flex-direction: column;
7+
align-items: flex-start;
8+
flex-wrap: wrap;
9+
margin-bottom: -12px;
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**********
2+
* SUBTEXT
3+
**********/
4+
.subtext {
5+
margin: -6px 0 12px; // 4px
6+
padding: 0 0 0 1px;
7+
width: 100%;
8+
}

src/client/styles/main/common.scss

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/client/styles/main/disabled.scss

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/client/styles/main/host.scss

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)