mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
93ee695c08
Someone can't reproduce the bug that input shows [Object object]. So I will roll back it.
113 lines
2.9 KiB
SCSS
113 lines
2.9 KiB
SCSS
@import './mixins/mixins.scss';
|
|
@import './theme/default.scss';
|
|
|
|
@include b(input) {
|
|
position: relative;
|
|
width: 100%;
|
|
&.is-disabled {
|
|
cursor: not-allowed;
|
|
.n-input__input, .n-input__textarea {
|
|
cursor: not-allowed;
|
|
background-color: $disabled-input-background-color;
|
|
color: $disabled-input-text-color;
|
|
box-shadow: none;
|
|
&::placeholder {
|
|
color: $disabled-input-placeholder-color;
|
|
}
|
|
}
|
|
}
|
|
.n-input__icon {
|
|
position: absolute;
|
|
height: 18px;
|
|
width: 18px;
|
|
i {
|
|
height: 18px;
|
|
width: 18px;
|
|
&::before {
|
|
font-size: 20px;
|
|
line-height: 18px;
|
|
height: 18px;
|
|
width: 18px;
|
|
color: $input-icon-color;
|
|
}
|
|
}
|
|
left: 0;
|
|
top: calc(50% - 9px);
|
|
margin-left: 12px;
|
|
}
|
|
& .n-input__input, .n-input__textarea {
|
|
-webkit-appearance: none;
|
|
box-sizing: border-box;
|
|
border: none;
|
|
border-radius: $input-border-radius;
|
|
outline: none;
|
|
color: #fff;
|
|
font-family: $default-font-family;
|
|
background-color: $input-background-color;
|
|
width: 100%;
|
|
caret-color: $input-caret-color;
|
|
box-shadow: none;
|
|
transition: box-shadow .3s $default-cubic-bezier, background-color .3s $default-cubic-bezier;
|
|
&:focus:hover {
|
|
box-shadow: inset 0 0 0px 1px $main-color, 0px 0px 10px 1px #366555;
|
|
}
|
|
&:hover {
|
|
box-shadow: inset 0 0 0px 1px $main-color;
|
|
}
|
|
&:focus {
|
|
box-shadow: inset 0 0 0px 1px $main-color;
|
|
background-color: $focus-input-background-color;
|
|
}
|
|
&::placeholder {
|
|
color: $input-placeholder-color;
|
|
opacity: 1;
|
|
}
|
|
}
|
|
.n-input__input {
|
|
&.n-input__input--small-size {
|
|
height: $small-height;
|
|
line-height: $small-height;
|
|
padding: 0 14px;
|
|
font-size: $small-input-font-size;
|
|
}
|
|
&.n-input__input--default-size, &.n-input__input--medium-size {
|
|
height: $default-height;
|
|
line-height: $default-height;
|
|
padding: 0 14px;
|
|
font-size: $default-input-font-size;
|
|
}
|
|
&.n-input__input--large-size {
|
|
height: $large-height;
|
|
line-height: $large-height;
|
|
padding: 0 14px;
|
|
font-size: $large-input-font-size;
|
|
}
|
|
}
|
|
.n-input__input.n-input__input--round {
|
|
&.n-input__input--small-size {
|
|
border-radius: $small-height / 2;
|
|
}
|
|
&.n-input__input--default-size, &.n-input__input--medium-size {
|
|
border-radius: $default-height / 2;
|
|
}
|
|
&.n-input__input--large-size {
|
|
border-radius: $large-height / 2;
|
|
}
|
|
}
|
|
.n-input__input.n-input__input--icon {
|
|
padding-left: 40px;
|
|
}
|
|
.n-input__textarea {
|
|
padding: 10px 14px;
|
|
resize: vertical;
|
|
&.n-input__textarea--small-size {
|
|
font-size: $small-input-font-size;
|
|
}
|
|
&.n-input__textarea--default-size, &.n-input__input--medium-size {
|
|
font-size: $default-input-font-size;
|
|
}
|
|
&.n-input__textarea--large-size {
|
|
font-size: $large-input-font-size;
|
|
}
|
|
}
|
|
} |