123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388 |
- /**Variable**/
- @import './helpers/mixin.scss';
- $btnThemeList: (
- (
- name: "primary",
- textColor: $vxe-primary-color,
- btnColor: #fff,
- btnBackground: $vxe-primary-color
- ),
- (
- name: "success",
- textColor: $vxe-success-color,
- btnColor: #fff,
- btnBackground: $vxe-success-color
- ),
- (
- name: "info",
- textColor: $vxe-info-color,
- btnColor: #fff,
- btnBackground: $vxe-info-color
- ),
- (
- name: "warning",
- textColor: $vxe-warning-color,
- btnColor: #fff,
- btnBackground: $vxe-warning-color
- ),
- (
- name: "danger",
- textColor: $vxe-danger-color,
- btnColor: #fff,
- btnBackground: $vxe-danger-color
- ),
- (
- name: "perfect",
- textColor: $vxe-table-header-background-color,
- btnColor: $vxe-font-color,
- btnBackground: $vxe-table-header-background-color
- )
- );
- .vxe-button {
- position: relative;
- text-align: center;
- background-color: $vxe-button-default-background-color;
- outline: 0;
- font-size: $vxe-font-size;
- max-width: $vxe-button-max-width;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- white-space: nowrap;
- user-select: none;
- appearance: none;
- @include animatTransition(border, .2s);
- &.is--disabled {
- color: $vxe-disabled-color;
- .vxe-button--icon {
- &.vxe-icon--zoomin {
- border-color: $vxe-disabled-color;
- }
- }
- &:not(.is--loading) {
- cursor: no-drop;
- }
- }
- &:not(.is--disabled) {
- color: $vxe-font-color;
- cursor: pointer;
- .vxe-button--icon {
- &.vxe-icon--zoomin {
- border-color: $vxe-font-color;
- }
- }
- }
- &.is--loading {
- &:before {
- content: "";
- position: absolute;
- left: -1px;
- top: -1px;
- right: -1px;
- bottom: -1px;
- border-radius: inherit;
- background-color: hsla(0,0%,100%,.35);
- pointer-events: none;
- }
- }
- &.type--text {
- text-decoration: none;
- border: 0;
- padding: 0.1em 0.5em;
- background-color: transparent;
- &:not(.is--disabled) {
- &:focus {
- box-shadow: 0 0 0.25em 0 $vxe-primary-color;
- }
- &:hover {
- color: lighten($vxe-primary-color, 10%);
- }
- }
- @for $index from 0 to length($btnThemeList) {
- $item: nth($btnThemeList, $index + 1);
- $textColor: map-get($item, textColor);
- &.theme--#{map-get($item, name)} {
- color: $textColor;
- &:not(.is--disabled) {
- &:hover {
- color: lighten($textColor, 10%);
- }
- }
- &.is--disabled {
- color: lighten($textColor, 20%);
- }
- }
- }
- }
- &.type--button {
- font-family: inherit;
- line-height: inherit;
- &.is--round {
- border-radius: $vxe-button-height-default / 2;
- }
- &:not(.is--round) {
- border-radius: $vxe-border-radius;
- }
- &.is--circle {
- padding: 0 0.5em;
- min-width: $vxe-button-height-default;
- border-radius: 50%;
- }
- &:not(.is--circle) {
- padding: 0 1em;
- }
- height: $vxe-button-height-default;
- line-height: 1;
- border: 1px solid $vxe-input-border-color;
- &:not(.is--disabled) {
- &:hover {
- color: lighten($vxe-primary-color, 6%);
- .vxe-button--icon {
- &.vxe-icon--zoomin {
- border-color: lighten($vxe-primary-color, 6%);
- }
- }
- }
- &:focus {
- border-color: $vxe-primary-color;
- box-shadow: 0 0 0.25em 0 $vxe-primary-color;
- }
- &:active {
- color: darken($vxe-primary-color, 3%);
- border-color: darken($vxe-primary-color, 3%);
- background-color: darken($vxe-button-default-background-color, 3%);
- .vxe-button--icon {
- &.vxe-icon--zoomin {
- background-color: darken($vxe-button-default-background-color, 3%);
- }
- &.vxe-icon--zoomout {
- &:after {
- background-color: darken($vxe-button-default-background-color, 3%);
- }
- }
- }
- }
- }
- @for $index from 0 to length($btnThemeList) {
- $item: nth($btnThemeList, $index + 1);
- $btnColor: map-get($item, btnColor);
- $btnBackground: map-get($item, btnBackground);
- &.theme--#{map-get($item, name)} {
- color: $btnColor;
- .vxe-button--icon {
- &.vxe-icon--zoomin {
- border-color: $btnColor;
- }
- }
- &:not(.is--disabled) {
- border-color: $btnBackground;
- background-color: $btnBackground;
- &:hover {
- color: $btnColor;
- background-color: lighten($btnBackground, 6%);
- border-color: lighten($btnBackground, 6%);
- .vxe-button--icon {
- &.vxe-icon--zoomin {
- border-color: lighten($btnBackground, 6%);
- }
- }
- }
- &:active {
- color: $btnColor;
- background-color: darken($btnBackground, 3%);
- border-color: darken($btnBackground, 3%);
- &.vxe-icon--zoomin {
- background-color: darken($btnBackground, 3%);
- }
- &.vxe-icon--zoomout {
- &:after {
- background-color: darken($btnBackground, 3%);
- }
- }
- }
- }
- &.is--disabled {
- border-color: lighten($btnBackground, 20%);
- background-color: lighten($btnBackground, 20%);
- }
- &.is--loading {
- border-color: $btnBackground;
- background-color: $btnBackground;
- }
- }
- }
- }
- &.size--medium {
- font-size: $vxe-font-size-medium;
- &.type--button {
- height: $vxe-button-height-medium;
- &.is--circle {
- min-width: $vxe-button-height-medium;
- }
- &.is--round {
- border-radius: $vxe-button-height-medium / 2;
- }
- }
- .vxe-button--loading-icon,
- .vxe-button--icon {
- min-width: $vxe-font-size-medium;
- }
- }
- &.size--small {
- font-size: $vxe-font-size-small;
- &.type--button {
- height: $vxe-button-height-small;
- &.is--circle {
- min-width: $vxe-button-height-small;
- }
- &.is--round {
- border-radius: $vxe-button-height-small / 2;
- }
- }
- .vxe-button--loading-icon,
- .vxe-button--icon {
- min-width: $vxe-font-size-small;
- }
- }
- &.size--mini {
- font-size: $vxe-font-size-mini;
- &.type--button {
- height: $vxe-button-height-mini;
- &.is--circle {
- min-width: $vxe-button-height-mini;
- }
- &.is--round {
- border-radius: $vxe-button-height-mini / 2;
- }
- }
- .vxe-button--loading-icon,
- .vxe-button--icon {
- min-width: $vxe-font-size-mini;
- }
- }
- }
- .vxe-input,
- .vxe-button {
- &+.vxe-button,
- &+.vxe-button--dropdown {
- margin-left: 12px;
- }
- }
- .vxe-button--loading-icon,
- .vxe-button--icon,
- .vxe-button--content {
- vertical-align: middle;
- }
- .vxe-button--loading-icon,
- .vxe-button--icon {
- min-width: $vxe-font-size;
- &+.vxe-button--content {
- margin-left: 4px;
- }
- }
- .vxe-button--wrapper,
- .vxe-button--dropdown {
- display: inline-block;
- }
- .vxe-button--dropdown {
- position: relative;
- &+.vxe-button,
- &+.vxe-button--dropdown {
- margin-left: 12px;
- }
- & > .vxe-button {
- &.type--button {
- @for $index from 0 to length($btnThemeList) {
- $item: nth($btnThemeList, $index + 1);
- $btnColor: map-get($item, btnColor);
- &.theme--#{map-get($item, name)} {
- color: $btnColor;
- }
- }
- }
- }
- &.is--active {
- & > .vxe-button {
- &:not(.is--disabled) {
- color: lighten($vxe-primary-color, 6%);
- }
- &.type--text {
- @for $index from 0 to length($btnThemeList) {
- $item: nth($btnThemeList, $index + 1);
- $textColor: map-get($item, textColor);
- &.theme--#{map-get($item, name)} {
- color: lighten($textColor, 10%);
- }
- }
- }
- &.type--button {
- @for $index from 0 to length($btnThemeList) {
- $item: nth($btnThemeList, $index + 1);
- $btnColor: map-get($item, btnColor);
- $btnBackground: map-get($item, btnBackground);
- &.theme--#{map-get($item, name)} {
- color: $btnColor;
- background-color: lighten($btnBackground, 6%);
- border-color: lighten($btnBackground, 6%);
- }
- }
- }
- }
- .vxe-button--dropdown-arrow {
- transform: rotate(180deg);
- }
- }
- }
- .vxe-button--dropdown-arrow {
- font-size: 12px;
- margin-left: 4px;
- @include animatTransition(transform, .2s);
- }
- .vxe-button--dropdown-panel {
- display: none;
- position: absolute;
- right: 0;
- padding: 4px 0;
- &.animat--leave {
- display: block;
- opacity: 0;
- transform: scaleY(0.5);
- transition: transform .3s cubic-bezier(.23,1,.32,1), opacity .3s cubic-bezier(.23,1,.32,1);
- transform-origin: center top;
- backface-visibility: hidden;
- transform-style: preserve-3d;
- &[placement="top"] {
- transform-origin: center bottom;
- }
- }
- &.animat--enter {
- opacity: 1;
- transform: scaleY(1);
- }
- }
- .vxe-button--dropdown-wrapper {
- padding: 5px;
- background-color: #fff;
- border-radius: $vxe-border-radius;
- border: 1px solid $vxe-input-border-color;
- box-shadow: 0 1px 6px rgba(0,0,0,.2);
- & > .vxe-button {
- margin: 2px 0;
- display: block;
- width: 100%;
- border: 0;
- &.type--text {
- padding: 2px 8px;
- }
- &:first-child {
- margin-top: 0;
- }
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
|