scinote-web/app/assets/stylesheets/shared_styles/elements/input_fields.scss

133 lines
2 KiB
SCSS
Raw Normal View History

2019-12-04 22:17:59 +08:00
// scss-lint:disable NestingDepth
2019-12-02 01:42:43 +08:00
.sci-input-container {
display: inline-block;
position: relative;
label {
@include font-small;
display: inline-block;
font-weight: bold;
margin-bottom: 5px;
}
.sci-input-field {
@include font-button;
animation-timing-function: $timing-function-sharp;
border: $border-default;
border-radius: $border-radius-default;
height: 36px;
outline: 0;
padding: 0 0 0 10px;
transition: .3s;
width: 100%;
&:focus {
border: $border-focus;
}
&:disabled {
background: transparent;
}
}
.fas {
2019-12-04 22:17:59 +08:00
bottom: 0;
2019-12-02 01:42:43 +08:00
line-height: 36px;
position: absolute;
text-align: center;
2019-12-04 22:17:59 +08:00
width: 25px;
2019-12-02 01:42:43 +08:00
}
&.left-icon {
.sci-input-field {
padding: 0 0 0 30px;
}
.fas {
left: 5px;
}
}
&.right-icon {
.sci-input-field {
padding: 0 30px 0 10px;
}
.fas {
right: 5px;
}
}
&.success,
&.error {
.sci-input-field {
padding: 0 30px 0 10px;
}
&::after {
@include font-awesome;
2019-12-04 22:17:59 +08:00
bottom: 0;
2019-12-02 01:42:43 +08:00
line-height: 36px;
position: absolute;
right: 5px;
text-align: center;
width: 25px;
}
&.right-icon {
.sci-input-field {
padding: 0 60px 0 10px;
}
&::after {
right: 35px;
}
}
}
&.success {
&::after {
color: $brand-success;
content: $font-fas-check;
2019-12-02 01:42:43 +08:00
}
}
&.error {
.sci-input-field {
border: $border-danger;
}
&::after {
color: $brand-danger;
content: $font-fas-exclamation-triangle;
2019-12-02 01:42:43 +08:00
}
&::before {
@include font-small;
2019-12-04 22:17:59 +08:00
bottom: -15px;
2019-12-02 01:42:43 +08:00
color: $brand-danger;
content: attr(data-error-text);
left: 0;
line-height: 15px;
position: absolute;
width: 100%;
}
}
&.disabled {
label {
color: $color-alto;
}
.sci-input-field {
border: $border-tertiary;
color: $color-alto;
&::placeholder {
color: inherit;
}
}
}
2019-12-04 22:17:59 +08:00
}