Skip to content

Commit 4e73906

Browse files
committed
Fix linter errors in input scss
1 parent d516ff2 commit 4e73906

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

components/input/index.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,12 @@ export default React.createClass({
7575

7676
render () {
7777
let className = style.root;
78+
let labelClassName = style.label;
7879
if (this.props.error) className += ` ${style.errored}`;
7980
if (this.props.disabled) className += ` ${style.disabled}`;
8081
if (this.props.className) className += ` ${this.props.className}`;
8182
if (this.props.type === 'hidden') className += ` ${style.hidden}`;
82-
if (this.props.icon) className += ` ${style.with_icon}`;
83-
84-
let labelClassName = style.label;
83+
if (this.props.icon) className += ` ${style['with-icon']}`;
8584
if (!this.props.floating) labelClassName += ` ${style.fixed}`;
8685

8786
return (

components/input/style.scss

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import "../variables";
22
@import "../mixins";
3+
34
$input-padding: 2 * $unit;
45
$input-field-height: 1.6 * $unit;
56
$input-field-padding: .8 * $unit;
@@ -19,14 +20,15 @@ $input-icon-size: 2 * $input-icon-font-size;
1920
.root {
2021
position: relative;
2122
padding: $input-padding 0;
22-
&.with_icon {
23+
24+
&.with-icon {
2325
margin-left: $input-icon-size;
2426
}
2527
}
2628

2729
.icon {
2830
position: absolute;
29-
top: $offset ;
31+
top: $offset;
3032
left: -$input-icon-size;
3133
display: block;
3234
width: $input-icon-size;
@@ -48,23 +50,28 @@ $input-icon-size: 2 * $input-icon-font-size;
4850
border: 0;
4951
border-bottom: 1px solid $input-text-bottom-border-color;
5052
outline: none;
53+
5154
&:focus {
5255
~ .bar:before, ~ .bar:after {
5356
width: 50%;
5457
}
58+
5559
~ .label:not(.fixed) {
5660
color: $input-text-highlight-color;
5761
}
62+
5863
~ .icon {
5964
color: $input-text-highlight-color;
6065
}
6166
}
67+
6268
&:focus, &.filled {
6369
~ .label:not(.fixed) {
6470
top: $input-focus-label-top;
6571
font-size: $input-label-font-size;
6672
}
6773
}
74+
6875
&.filled ~ .label.fixed {
6976
display: none;
7077
}
@@ -87,6 +94,7 @@ $input-icon-size: 2 * $input-icon-font-size;
8794
position: relative;
8895
display: block;
8996
width: 100%;
97+
9098
&:before, &:after {
9199
@include material-animation-default();
92100
position: absolute;
@@ -97,9 +105,11 @@ $input-icon-size: 2 * $input-icon-font-size;
97105
background-color: $input-text-highlight-color;
98106
transition-property: width, background-color;
99107
}
108+
100109
&:before {
101110
left: 50%;
102111
}
112+
103113
&:after {
104114
right: 50%;
105115
}
@@ -118,12 +128,15 @@ $input-icon-size: 2 * $input-icon-font-size;
118128

119129
.errored {
120130
padding-bottom: 0;
131+
121132
> .input {
122133
border-bottom-color: $input-text-error-color;
134+
123135
&:focus {
124136
~ .label:not(.fixed) {
125137
color: $input-text-error-color;
126138
}
139+
127140
~ .bar:before, ~ .bar:after {
128141
background-color: $input-text-error-color;
129142
}

0 commit comments

Comments
 (0)