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

176 lines
2.8 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;
2020-03-27 16:43:49 +08:00
width: 100%;
2019-12-02 01:42:43 +08:00
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;
2023-09-18 21:32:53 +08:00
border: 1px solid var(--sn-light-grey);
2020-03-27 16:43:49 +08:00
border-radius: $border-radius-default !important;
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%;
&:hover {
border: 1px solid var(--sn-science-blue-hover);
}
2019-12-02 01:42:43 +08:00
&:focus {
border: $border-focus;
}
&:disabled {
background-color: var(--sn-super-light-grey);
color: var(--sn-light-grey);
border: 1px solid var(--sn-light-grey);
2019-12-02 01:42:43 +08:00
}
2020-03-03 16:50:44 +08:00
&::placeholder {
color: $color-alto;
}
2023-07-03 17:11:51 +08:00
&.textarea {
height: unset;
min-height: 36px;
padding: 10px;
resize: vertical;
}
2019-12-02 01:42:43 +08:00
}
.sci-input-field[type=password] {
font-family: "SN Inter", "Open Sans", Arial, Helvetica, sans-serif;
letter-spacing: .075em;
&::placeholder {
letter-spacing: initial;
}
}
2023-06-08 23:33:50 +08:00
.sn-icon {
2023-08-10 21:38:49 +08:00
bottom: 6px;
2019-12-02 01:42:43 +08:00
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;
}
2023-06-08 23:33:50 +08:00
.sn-icon {
2019-12-02 01:42:43 +08:00
left: 5px;
}
}
&.right-icon {
.sci-input-field {
padding: 0 30px 0 10px;
}
2023-06-08 23:33:50 +08:00
.sn-icon {
2019-12-02 01:42:43 +08:00
right: 5px;
}
}
&.success,
&.error {
&::after {
@include font-awesome;
2023-08-10 21:38:49 +08:00
bottom: 6px;
2019-12-02 01:42:43 +08:00
position: absolute;
right: 5px;
text-align: center;
2023-08-10 21:38:49 +08:00
top: 6px;
2019-12-02 01:42:43 +08:00
width: 25px;
}
}
&.error {
padding-bottom: 6px;
label {
color: $brand-danger;
}
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
}