Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

Commit 3fbef83

Browse files
author
Thimy Kieu
committed
improve: set padding in em so inputs resize with font-size
1 parent f146ff9 commit 3fbef83

2 files changed

Lines changed: 18 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
#### Enhancements
66

77
- Added a `required` class to `labels` to inform about _required_ fields
8+
- Change padding unit on inputs
89

910
#### Bug fixes
11+
1012
- Added a polyfill for Internet Explorer support
13+
- Fixed visual glitch on select arrow
1114

1215
## v1.2.0 (23/01/2019)
1316

src/css/elements/input.css

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ textarea,
33
select {
44
width: 100%;
55
outline: none;
6-
padding: 8px 14px;
6+
padding: 0.5em 0.875em;
77
font: inherit;
88
line-height: 1.6;
99
color: var(--black);
@@ -28,13 +28,13 @@ select:disabled {
2828

2929
input[type=radio],
3030
input[type=checkbox] {
31-
margin-right: 6px;
32-
margin-top: 0;
31+
margin: 0;
32+
margin-right: var(--space-xs);
3333
}
3434

3535
input[type=radio] {
36-
height: 20px;
37-
width: 20px;
36+
height: 1.25em;
37+
width: 1.25em;
3838
border-radius: 50%;
3939
display: inline-block;
4040
appearance: none;
@@ -46,10 +46,10 @@ input[type=radio]::before {
4646
border-color: var(--theme-primary);
4747
border-radius: 50%;
4848
position: absolute;
49-
top: 5px;
50-
left: 5px;
51-
width: 8px;
52-
height: 8px;
49+
top: 0.35em;
50+
left: 0.3em;
51+
width: 0.5em;
52+
height: 0.5em;
5353
transform: scale(0);
5454
}
5555

@@ -67,8 +67,8 @@ input[type=radio]:checked::before {
6767

6868
input[type="checkbox"] {
6969
appearance: none;
70-
height: 22px;
71-
width: 22px;
70+
height: 1.4em;
71+
width: 1.5em;
7272
padding: 0;
7373
}
7474

@@ -83,10 +83,10 @@ input[type="checkbox"]::before {
8383
transform: scale(0);
8484
content: '';
8585
position: absolute;
86-
top: 3px;
87-
left: 3px;
88-
height: 14px;
89-
width: 14px;
86+
top: 0.2em;
87+
left: 0.15em;
88+
height: 1em;
89+
width: 1em;
9090
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><path d="M14.23 1.304L6.112 9.501 2.767 6.117a1.029 1.029 0 0 0-1.464 0 1.054 1.054 0 0 0 0 1.479l4.055 4.101c.208.21.481.31.754.305.272.005.545-.095.753-.305l8.829-8.915a1.053 1.053 0 0 0 0-1.478 1.027 1.027 0 0 0-1.464 0z" fill="white" /></svg>') center center no-repeat;
9191
}
9292

0 commit comments

Comments
 (0)