naive-ui/styles/Button.scss

165 lines
3.4 KiB
SCSS
Raw Normal View History

2019-06-18 14:53:24 +08:00
@import './mixins/mixins.scss';
@import './theme/default.scss';
@include b(button) {
display: inline-flex;
align-items: center;
justify-content: center;
2019-06-25 14:59:26 +08:00
box-shadow: inset 0 0 0 1.5px $button-default-border-color;
2019-06-18 14:53:24 +08:00
cursor: pointer;
user-select: none;
font-weight: 700;
text-align: center;
2019-06-25 14:59:26 +08:00
.n-button__icon {
margin-right: 2px;
2019-07-04 10:41:59 +08:00
&.n-button__icon--right {
margin-right: 0px;
margin-left: 4px;
}
2019-06-25 14:59:26 +08:00
}
2019-07-22 12:57:15 +08:00
.n-button__content {
white-space: nowrap;
}
2019-06-25 14:59:26 +08:00
border-radius: $button-border-radius;
&.n-button--disabled {
cursor: not-allowed;
opacity: .43;
}
&.n-button--tiny-size {
font-size: $button-tiny-font-size;
height: $tiny-height;
padding: 0 14px;
&.is-round {
border-radius: $tiny-height / 2;
}
.n-button__content {
line-height: $tiny-height;
}
.n-button__icon {
2019-07-22 12:57:15 +08:00
height: 16px;
width: 16px;
.n-icon {
2019-07-22 12:57:15 +08:00
font-size: 16px;
display: block;
}
}
2019-07-22 12:57:15 +08:00
.n-button__icon--slot {
height: 14px;
width: 14px;
line-height: 14px;
2019-07-22 12:57:15 +08:00
.n-icon-slot {
height: 14px;
width: 14px;
font-size: 14px;
}
}
}
2019-06-25 14:59:26 +08:00
&.n-button--small-size {
font-size: $button-small-font-size;
height: $small-height;
padding: 0 18px;
2019-06-18 16:53:16 +08:00
&.is-round {
2019-06-25 14:59:26 +08:00
border-radius: $small-height / 2;
}
.n-button__content {
line-height: $small-height;
2019-06-18 16:53:16 +08:00
}
.n-button__icon {
2019-06-25 14:59:26 +08:00
height: 18px;
width: 18px;
.n-icon {
2019-06-26 14:20:13 +08:00
font-size: 18px;
2019-06-28 13:50:15 +08:00
display: block;
2019-06-18 16:53:16 +08:00
}
}
2019-07-22 12:57:15 +08:00
.n-button__icon--slot {
height: 16px;
line-height: 16px;
2019-07-22 12:57:15 +08:00
width: 16px;
.n-icon-slot {
height: 16px;
width: 16px;
font-size: 16px;
}
}
2019-06-18 16:12:33 +08:00
}
2019-06-25 14:59:26 +08:00
&.n-button--default-size, &.n-button--medium-size {
font-size: $button-default-font-size;
height: $default-height;
padding: 0 24px;
2019-06-18 16:53:16 +08:00
&.is-round {
2019-06-25 14:59:26 +08:00
border-radius: $default-height / 2;
}
.n-button__content {
line-height: $default-height;
2019-06-18 16:53:16 +08:00
}
.n-button__icon {
2019-06-25 14:59:26 +08:00
height: 20px;
width: 20px;
.n-icon {
2019-06-26 14:20:13 +08:00
font-size: 20px;
2019-06-18 16:53:16 +08:00
}
}
2019-07-22 12:57:15 +08:00
.n-button__icon--slot {
height: 18px;
line-height: 18px;
2019-07-22 12:57:15 +08:00
width: 18px;
.n-icon-slot {
height: 18px;
width: 18px;
font-size: 18px;
}
}
2019-06-18 16:12:33 +08:00
}
2019-06-25 14:59:26 +08:00
&.n-button--large-size {
font-size: $button-large-font-size;
height: $large-height;
2019-06-18 16:53:16 +08:00
padding: 0 24px;
&.is-round {
2019-06-25 14:59:26 +08:00
border-radius: $large-height / 2;
}
.n-button__content {
line-height: $large-height;
2019-06-18 16:53:16 +08:00
}
.n-button__icon {
height: 20px;
2019-06-25 14:59:26 +08:00
width: 20px;
.n-icon {
2019-06-26 14:20:13 +08:00
font-size: 20px;
2019-06-18 16:53:16 +08:00
}
}
2019-07-22 12:57:15 +08:00
.n-button__icon--slot {
line-height: 18px;
2019-07-22 12:57:15 +08:00
height: 18px;
width: 18px;
.n-icon-slot {
height: 18px;
width: 18px;
font-size: 18px;
}
}
2019-06-18 14:53:24 +08:00
}
2019-06-18 16:53:16 +08:00
2019-06-25 14:59:26 +08:00
2019-06-18 14:53:24 +08:00
&.is-default {
2019-06-25 14:59:26 +08:00
color: $button-default-text-color;
background-color: $button-default-background-color;
2019-06-18 14:53:24 +08:00
&:hover {
2019-06-25 14:59:26 +08:00
background-color: $button-default-background-color--hover;
2019-06-18 14:53:24 +08:00
}
&:active {
2019-06-25 14:59:26 +08:00
background-color: $button-default-background-color--active;
2019-06-18 14:53:24 +08:00
}
}
&.is-primary {
color: #1F263EFF;
2019-06-25 14:59:26 +08:00
background-color: $button-primary-background-color;
2019-06-18 14:53:24 +08:00
box-shadow: none;
&:hover {
2019-06-25 14:59:26 +08:00
background-color: $button-primary-background-color--hover;
2019-06-18 14:53:24 +08:00
}
&:active {
2019-06-25 14:59:26 +08:00
background-color: $button-primary-background-color--active;
2019-06-18 14:53:24 +08:00
}
}
}