naive-ui/styles/Input.scss

108 lines
2.8 KiB
SCSS
Raw Normal View History

2019-06-14 14:46:13 +08:00
@import './mixins/mixins.scss';
@import './theme/default.scss';
@include b(input) {
position: relative;
2019-06-24 15:11:27 +08:00
width: 100%;
2019-06-17 19:58:09 +08:00
&.is-disabled {
2019-06-18 18:09:42 +08:00
cursor: not-allowed;
2019-06-17 19:58:09 +08:00
.n-input__input, .n-input__textarea {
2019-06-18 18:09:42 +08:00
cursor: not-allowed;
2019-06-25 11:09:11 +08:00
background-color: $disabled-input-background-color;
color: $disabled-input-text-color;
box-shadow: none;
&::placeholder {
color: $disabled-input-placeholder-color;
}
2019-06-17 19:58:09 +08:00
}
}
.n-input__icon {
position: absolute;
height: 18px;
width: 18px;
left: 0;
top: calc(50% - 8px);
2019-06-25 11:09:11 +08:00
margin-left: 12px;
i::before {
font-size: 20px;
line-height: 17px;
2019-06-25 11:09:11 +08:00
color: $input-icon-color;
}
}
2019-06-21 10:57:07 +08:00
.n-input__input, .n-input__textarea {
-webkit-appearance: none;
2019-06-14 14:46:13 +08:00
box-sizing: border-box;
border: none;
2019-06-25 11:09:11 +08:00
border-radius: $input-border-radius;
2019-06-14 14:46:13 +08:00
outline: none;
color: #fff;
font-family: $default-font-family;
2019-06-25 11:09:11 +08:00
background-color: $input-background-color;
width: 100%;
2019-06-25 11:09:11 +08:00
caret-color: $input-caret-color;
box-shadow: none;
2019-06-24 18:05:00 +08:00
transition: box-shadow .3s $default-cubic-bezier, background-color .3s $default-cubic-bezier;
&:focus:hover {
2019-06-25 11:09:11 +08:00
box-shadow: inset 0 0 0px 1px $main-color, 0px 0px 10px 1px #366555;
2019-06-24 18:05:00 +08:00
}
&:hover {
2019-06-25 11:09:11 +08:00
box-shadow: inset 0 0 0px 1px $main-color;
2019-06-24 18:05:00 +08:00
}
2019-06-21 10:57:07 +08:00
&:focus {
2019-06-25 11:09:11 +08:00
box-shadow: inset 0 0 0px 1px $main-color;
2019-06-25 14:59:26 +08:00
background-color: $focus-input-background-color;
2019-06-25 11:09:11 +08:00
}
&::placeholder {
color: $input-placeholder-color;
opacity: 1;
2019-06-21 10:57:07 +08:00
}
}
.n-input__input {
2019-06-18 18:09:42 +08:00
&.n-input__input--small-size {
height: $small-height;
line-height: $small-height;
2019-06-25 11:09:11 +08:00
padding: 0 14px;
2019-06-18 18:09:42 +08:00
font-size: $small-input-font-size;
}
&.n-input__input--default-size, &.n-input__input--medium-size {
height: $default-height;
line-height: $default-height;
2019-06-25 11:09:11 +08:00
padding: 0 14px;
2019-06-18 18:09:42 +08:00
font-size: $default-input-font-size;
}
&.n-input__input--large-size {
height: $large-height;
line-height: $large-height;
2019-06-25 11:09:11 +08:00
padding: 0 14px;
2019-06-18 18:09:42 +08:00
font-size: $large-input-font-size;
}
2019-06-25 11:09:11 +08:00
2019-06-14 14:46:13 +08:00
}
.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 {
2019-06-25 11:09:11 +08:00
padding-left: 40px;
}
2019-06-17 19:58:09 +08:00
.n-input__textarea {
padding: 10px 14px;
2019-06-14 15:25:50 +08:00
resize: vertical;
2019-06-18 18:09:42 +08:00
&.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;
}
2019-06-14 14:46:13 +08:00
}
}