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

Commit 3a92889

Browse files
committed
Input: Added initial styling for :focus
1 parent 398e46f commit 3a92889

File tree

3 files changed

+30
-13
lines changed

3 files changed

+30
-13
lines changed

demos/inputs/inputs.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
<link rel="stylesheet" href="../../dist/css/chassis.css">
99
<link rel="stylesheet" href="../demos.css">
1010
<link rel="stylesheet" href="./inputs.css">
11-
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,400italic,700italic" rel="stylesheet">
11+
<!-- <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,400italic,700italic" rel="stylesheet"> -->
1212
</head>
1313
<body>
1414
<h1>Inputs</h1>
15-
<input type="text" placeholder="Enter your name" disabled>
16-
<input type="text" placeholder="Enter your name">
15+
<input type="text" placeholder="Can't change this really" disabled>
16+
<input type="text" placeholder="Enter your Name">
17+
<input type="email" placeholder="Enter your Email">
18+
<input type="password" placeholder="Choose a password">
1719
</body>
1820
</html>

scss/atoms/inputs/_mixins.scss

+7-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@
1111
border: map-get($inputs-single-line, border);
1212
box-shadow: map-get($inputs-shadows, normal);
1313
border-radius: em(map-get($inputs-single-line, border-radius));
14-
font-size: em(16px);
15-
width: 100%;
14+
transition: map-get($inputs-transitions, blur);
15+
font-size: em(map-get($inputs-single-line, font-size));
16+
width: map-get($inputs-single-line, width);
1617
}
1718

1819
@mixin input-focus() {
19-
box-shadow: map-get($inputs-shadows, focus);
20+
border: map-get($inputs-focus, border);
21+
transition: map-get($inputs-transitions, focus);
22+
outline: map-get($inputs-focus, outline);
23+
box-shadow: map-get($inputs-shadows, focus-base), map-get($inputs-shadows, focus-spread);
2024
}
2125

2226
@mixin input-disabled() {

scss/variables/inputs.js

+18-7
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,29 @@ chassis.inputs = {
1212
"shadows": {
1313
name: "Styles for input shadows",
1414
value: {
15-
"disabled": "none",
16-
"normal": "none",
17-
"focus": "0px 0px 4px 0px rgba(0,0,0,0.24)",
15+
"disabled": "0px 0px 2px 0px rgba(0, 0, 0, 0.12)",
16+
"normal": "0px 2px 2px 0px rgba(0, 0, 0, 0.12)",
17+
"focus-base": "0px 0px 8px 0px rgba(0, 0, 0, 0.08)",
18+
"focus-spread": "0px 8px 8px 0px rgba(0, 0, 0, 0.18)"
19+
}
20+
},
21+
"transitions": {
22+
name: "Transition animations",
23+
value: {
24+
"focus": "all .25s",
25+
"blur": "all .1s"
1826
}
1927
},
2028
"single-line": {
2129
name: "Generic styles for single line inputs",
2230
value: {
23-
"padding": "10px",
31+
"padding": "15px",
2432
"margin": "8px",
2533
"border": "1px solid " + chassis.colors.grey.value.black,
2634
"background": chassis.colors.background.value.base,
27-
"border-radius": "3px"
35+
"border-radius": "3px",
36+
"font-size": "18px",
37+
"width": "100%"
2838
}
2939
},
3040
"disabled": {
@@ -38,8 +48,9 @@ chassis.inputs = {
3848
"focus": {
3949
name: "Styles for in focus inputs",
4050
value: {
41-
"border": "1px solid " + chassis.colors.primary.value.base,
42-
"background": chassis.colors.background.value.base
51+
"border": "1px solid " + chassis.colors.info.value.light,
52+
"background": chassis.colors.background.value.base,
53+
"outline": "none"
4354
}
4455
}
4556
};

0 commit comments

Comments
 (0)