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

150 lines
2.3 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;
2020-01-15 23:46:01 +08:00
box-shadow: none;
2019-12-02 01:42:43 +08:00
height: 36px;
outline: 0;
padding: 0 0 0 10px;
transition: .3s;
width: 100%;
&:focus {
border: $border-focus;
}
&:disabled {
background: transparent;
}
2020-03-03 16:50:44 +08:00
&::placeholder {
color: $color-alto;
}
2019-12-02 01:42:43 +08:00
}
.fas {
line-height: 36px;
position: absolute;
text-align: center;
2020-01-29 18:41:47 +08:00
bottom: 0;
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 {
&::after {
@include font-awesome;
2020-01-23 20:12:58 +08:00
top: 0;
2019-12-02 01:42:43 +08:00
line-height: 36px;
position: absolute;
right: 5px;
text-align: center;
width: 25px;
}
}
&.error {
padding-bottom: 6px;
2019-12-02 01:42:43 +08:00
.sci-input-field {
border: $border-danger;
}
2020-01-29 18:41:47 +08:00
.fas {
bottom: 6px;
}
2019-12-02 01:42:43 +08:00
&::before {
@include font-small;
bottom: -9px;
2019-12-02 01:42:43 +08:00
color: $brand-danger;
content: attr(data-error-text);
left: 0;
line-height: 15px;
position: absolute;
white-space: nowrap;
2019-12-02 01:42:43 +08:00
width: 100%;
}
&.success-icon {
&::after {
color: $brand-success;
content: $font-fas-check;
}
}
&.error-icon {
&::after {
color: $brand-danger;
content: $font-fas-exclamation-triangle;
}
}
2020-01-23 20:12:58 +08:00
&.success-icon,
&.error-icon {
.sci-input-field {
padding: 0 30px 0 10px;
}
&.right-icon {
.sci-input-field {
padding: 0 60px 0 10px;
}
&::after {
right: 35px;
}
}
}
2019-12-02 01:42:43 +08:00
}
&.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
}