Browse Source

无JIRA 删掉

research/test
翠屏山最速下山传说 1 year ago
parent
commit
803d574527
  1. 112
      packages/fineui/src/less/base/single/button/button.less
  2. 2
      packages/fineui/src/less/visual.less

112
packages/fineui/src/less/base/single/button/button.less

@ -1,4 +1,5 @@
@import "../../../index.less"; @import "../../../index.less";
@hoverVal: opacity .3s ease; @hoverVal: opacity .3s ease;
@activeVal: transform .5s ease, opacity 1s ease; @activeVal: transform .5s ease, opacity 1s ease;
@activeStopVal: transform 0s; @activeStopVal: transform 0s;
@ -6,6 +7,7 @@ body .bi-button, #body .bi-button {
&.hack { &.hack {
.border-radius(0px); .border-radius(0px);
} }
.border-radius(2px); .border-radius(2px);
outline: 0; outline: 0;
border: 1px solid @color-bi-border-button; border: 1px solid @color-bi-border-button;
@ -14,41 +16,51 @@ body .bi-button, #body .bi-button {
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
cursor: pointer; cursor: pointer;
&.loading { &.loading {
cursor: not-allowed; cursor: not-allowed;
} }
&.block { &.block {
font-size: inherit; font-size: inherit;
border-width: 0; border-width: 0;
.border-radius(0px); .border-radius(0px);
} }
&.clear { &.clear {
font-size: inherit; font-size: inherit;
border-width: 0; border-width: 0;
background-color: transparent; background-color: transparent;
&:hover, &:focus { &:hover, &:focus {
.opacity(0.8); .opacity(0.8);
} }
&:active { &:active {
.opacity(1); .opacity(1);
} }
&:after { &:after {
display: none; display: none;
} }
} }
&.plain { &.plain {
font-size: inherit; font-size: inherit;
border-width: 0; border-width: 0;
background-color: transparent; background-color: transparent;
} }
&.ghost { &.ghost {
font-size: inherit; font-size: inherit;
background-color: transparent; background-color: transparent;
} }
&.button-common { &.button-common {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-common-button; color: @color-bi-text-common-button;
} }
&.light { &.light {
border-width: 0; border-width: 0;
background-color: @color-bi-background-common-light-button; background-color: @color-bi-background-common-light-button;
@ -65,81 +77,101 @@ body .bi-button, #body .bi-button {
background-color: @color-bi-background-active-common-light-button; background-color: @color-bi-background-active-common-light-button;
} }
} }
&.clear, &.clear .b-font:before { &.clear, &.clear .b-font:before {
color: @color-bi-text-common-clear-button; color: @color-bi-text-common-clear-button;
} }
&.plain, &.plain .b-font:before { &.plain, &.plain .b-font:before {
background-color: transparent; background-color: transparent;
color: @color-bi-text-common-plain-button; color: @color-bi-text-common-plain-button;
} }
&.plain { &.plain {
&:hover { &:hover {
background-color: @color-bi-background-hover-plain-button; background-color: @color-bi-background-hover-plain-button;
} }
&:focus { &:focus {
background-color: @color-bi-background-active-plain-button; background-color: @color-bi-background-active-plain-button;
} }
} }
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-common-ghost-button; color: @color-bi-text-common-ghost-button;
} }
&:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before { &:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before {
color: @color-bi-text; color: @color-bi-text;
background-color: @color-bi-background-hover-common-ghost-button; background-color: @color-bi-background-hover-common-ghost-button;
} }
&:active { &:active {
background-color: @color-bi-background-active-common-ghost-button; background-color: @color-bi-background-active-common-ghost-button;
} }
} }
} }
&.button-ignore { &.button-ignore {
& { & {
background-color: @color-bi-background-ignore-button; background-color: @color-bi-background-ignore-button;
&:not(.clear, .ghost) { &:not(.clear, .ghost) {
border-color: @color-bi-border-ignore-button; border-color: @color-bi-border-ignore-button;
} }
} }
&:not(.clear, .ghost) { &:not(.clear, .ghost) {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-ignore-button; color: @color-bi-text-ignore-button;
} }
} }
&.clear { &.clear {
background-color: transparent; background-color: transparent;
border-width: 0; border-width: 0;
} }
&.ghost { &.ghost {
&:hover, &:focus { &:hover, &:focus {
border-color: @color-bi-border-ignore-button; border-color: @color-bi-border-ignore-button;
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-ignore-button; color: @color-bi-text-ignore-button;
} }
} }
background-color: transparent; background-color: transparent;
border-color: @color-bi-border-dark-gray-line; border-color: @color-bi-border-dark-gray-line;
} }
&.plain, &.plain .b-font:before { &.plain, &.plain .b-font:before {
background-color: transparent; background-color: transparent;
color: @color-bi-text-ignore-plain-button; color: @color-bi-text-ignore-plain-button;
} }
&.plain { &.plain {
&:hover { &:hover {
background-color: @color-bi-background-hover-plain-button; background-color: @color-bi-background-hover-plain-button;
} }
&:focus { &:focus {
background-color: @color-bi-background-active-plain-button; background-color: @color-bi-background-active-plain-button;
} }
} }
} }
&.button-success { &.button-success {
& { & {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-success-button; color: @color-bi-text-success-button;
} }
background-color: @color-bi-background-success-button; background-color: @color-bi-background-success-button;
border-color: @color-bi-border-success-button; border-color: @color-bi-border-success-button;
} }
&.light { &.light {
border-width: 0; border-width: 0;
background-color: @color-bi-background-success-light-button; background-color: @color-bi-background-success-light-button;
@ -156,47 +188,59 @@ body .bi-button, #body .bi-button {
background-color: @color-bi-background-active-success-light-button; background-color: @color-bi-background-active-success-light-button;
} }
} }
&.clear { &.clear {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-success-clear-button; color: @color-bi-text-success-clear-button;
} }
background-color: transparent; background-color: transparent;
border-width: 0; border-width: 0;
} }
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-success-ghost-button; color: @color-bi-text-success-ghost-button;
} }
background-color: transparent; background-color: transparent;
&:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before { &:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before {
color: @color-bi-text; color: @color-bi-text;
background-color: @color-bi-background-success-button; background-color: @color-bi-background-success-button;
} }
&:active { &:active {
background-color: @color-bi-background-success-button; background-color: @color-bi-background-success-button;
} }
} }
&.plain, &.plain .b-font:before { &.plain, &.plain .b-font:before {
background-color: transparent; background-color: transparent;
color: @color-bi-text-success-plain-button; color: @color-bi-text-success-plain-button;
} }
&.plain { &.plain {
&:hover { &:hover {
background-color: @color-bi-background-hover-plain-button; background-color: @color-bi-background-hover-plain-button;
} }
&:focus { &:focus {
background-color: @color-bi-background-active-plain-button; background-color: @color-bi-background-active-plain-button;
} }
} }
} }
&.button-warning { &.button-warning {
& { & {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-warning-button; color: @color-bi-text-warning-button;
} }
background-color: @color-bi-background-warning-button; background-color: @color-bi-background-warning-button;
border-color: @color-bi-border-warning-button; border-color: @color-bi-border-warning-button;
} }
&.light { &.light {
border-width: 0; border-width: 0;
background-color: @color-bi-background-warning-light-button; background-color: @color-bi-background-warning-light-button;
@ -213,47 +257,59 @@ body .bi-button, #body .bi-button {
background-color: @color-bi-background-active-warning-light-button; background-color: @color-bi-background-active-warning-light-button;
} }
} }
&.clear { &.clear {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-warning-clear-button; color: @color-bi-text-warning-clear-button;
} }
background-color: transparent; background-color: transparent;
border-width: 0; border-width: 0;
} }
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-warning-ghost-button; color: @color-bi-text-warning-ghost-button;
} }
background-color: transparent; background-color: transparent;
&:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before { &:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before {
color: @color-bi-text; color: @color-bi-text;
background-color: @color-bi-background-warning-button; background-color: @color-bi-background-warning-button;
} }
&:active { &:active {
background-color: @color-bi-background-warning-button; background-color: @color-bi-background-warning-button;
} }
} }
&.plain, &.plain .b-font:before { &.plain, &.plain .b-font:before {
background-color: transparent; background-color: transparent;
color: @color-bi-text-warning-plain-button; color: @color-bi-text-warning-plain-button;
} }
&.plain { &.plain {
&:hover { &:hover {
background-color: @color-bi-background-hover-plain-button; background-color: @color-bi-background-hover-plain-button;
} }
&:focus { &:focus {
background-color: @color-bi-background-active-plain-button; background-color: @color-bi-background-active-plain-button;
} }
} }
} }
&.button-error { &.button-error {
& { & {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-error-button; color: @color-bi-text-error-button;
} }
background-color: @color-bi-background-error-button; background-color: @color-bi-background-error-button;
border-color: @color-bi-border-error-button; border-color: @color-bi-border-error-button;
} }
&.light { &.light {
border-width: 0; border-width: 0;
background-color: @color-bi-background-error-light-button; background-color: @color-bi-background-error-light-button;
@ -270,39 +326,49 @@ body .bi-button, #body .bi-button {
background-color: @color-bi-background-active-error-light-button; background-color: @color-bi-background-active-error-light-button;
} }
} }
&.clear { &.clear {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-error-clear-button; color: @color-bi-text-error-clear-button;
} }
background-color: transparent; background-color: transparent;
border-width: 0; border-width: 0;
} }
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-error-ghost-button; color: @color-bi-text-error-ghost-button;
} }
background-color: transparent; background-color: transparent;
&:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before { &:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before {
color: @color-bi-text; color: @color-bi-text;
background-color: @color-bi-background-error-button; background-color: @color-bi-background-error-button;
} }
&:active { &:active {
background-color: @color-bi-background-error-button; background-color: @color-bi-background-error-button;
} }
} }
&.plain, &.plain .b-font:before { &.plain, &.plain .b-font:before {
background-color: transparent; background-color: transparent;
color: @color-bi-text-error-plain-button; color: @color-bi-text-error-plain-button;
} }
&.plain { &.plain {
&:hover { &:hover {
background-color: @color-bi-background-hover-plain-button; background-color: @color-bi-background-hover-plain-button;
} }
&:focus { &:focus {
background-color: @color-bi-background-active-plain-button; background-color: @color-bi-background-active-plain-button;
} }
} }
} }
&.button-common.disabled, &.button-common.disabled,
&.button-success.disabled, &.button-success.disabled,
&.button-error.disabled, &.button-error.disabled,
@ -311,25 +377,30 @@ body .bi-button, #body .bi-button {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-button !important; color: @color-bi-text-disabled-button !important;
} }
background-color: fade(@color-bi-background-disabled-button, 20%) !important; background-color: fade(@color-bi-background-disabled-button, 20%) !important;
@ieColor: argb(fade(@color-bi-background-disabled-button, 20%)); @ieColor: argb(fade(@color-bi-background-disabled-button, 20%));
filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr=@{ieColor},endColorstr=@{ieColor})";
border-color: @color-bi-border-disabled-button !important; border-color: @color-bi-border-disabled-button !important;
} }
&:after { &:after {
display: none; display: none;
} }
} }
&.button-ignore.disabled { &.button-ignore.disabled {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-ignore-button !important; color: @color-bi-text-disabled-ignore-button !important;
} }
background: @color-bi-background-disabled-ignore-button !important; background: @color-bi-background-disabled-ignore-button !important;
border-color: @color-bi-border-disabled-ignore-button !important; border-color: @color-bi-border-disabled-ignore-button !important;
&:after { &:after {
display: none; display: none;
} }
} }
&.button-common.disabled, &.button-common.disabled,
&.button-success.disabled, &.button-success.disabled,
&.button-warning.disabled, &.button-warning.disabled,
@ -339,65 +410,81 @@ body .bi-button, #body .bi-button {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-ignore-clear-button !important; color: @color-bi-text-disabled-ignore-clear-button !important;
} }
background: transparent !important; background: transparent !important;
border-width: 0 !important; border-width: 0 !important;
&:hover, &:focus, &:active { &:hover, &:focus, &:active {
.opacity(1); .opacity(1);
} }
} }
&.plain { &.plain {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-plain-clear-button !important; color: @color-bi-text-disabled-plain-clear-button !important;
} }
background: transparent !important; background: transparent !important;
border-width: 0 !important; border-width: 0 !important;
&:hover, &:focus, &:active { &:hover, &:focus, &:active {
.opacity(1); .opacity(1);
} }
} }
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
// color: @color-bi-text-disabled-ignore-ghost-button !important; // color: @color-bi-text-disabled-ignore-ghost-button !important;
} }
background: transparent !important; background: transparent !important;
// border-color: @color-bi-border-disabled-ignore-ghost-button !important; // border-color: @color-bi-border-disabled-ignore-ghost-button !important;
.opacity(0.5); .opacity(0.5);
} }
} }
&.button-ignore.disabled { &.button-ignore.disabled {
&.ghost { &.ghost {
.opacity(1); .opacity(1);
} }
} }
&.button-common.disabled { &.button-common.disabled {
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-common-ghost-button !important; color: @color-bi-text-disabled-common-ghost-button !important;
} }
border-color: @color-bi-border-disabled-common-ghost-button !important; border-color: @color-bi-border-disabled-common-ghost-button !important;
} }
} }
&.button-success.disabled { &.button-success.disabled {
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-success-ghost-button !important; color: @color-bi-text-disabled-success-ghost-button !important;
} }
border-color: @color-bi-border-disabled-success-ghost-button !important; border-color: @color-bi-border-disabled-success-ghost-button !important;
} }
} }
&.button-warning.disabled { &.button-warning.disabled {
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-warning-ghost-button !important; color: @color-bi-text-disabled-warning-ghost-button !important;
} }
border-color: @color-bi-border-disabled-warning-ghost-button !important; border-color: @color-bi-border-disabled-warning-ghost-button !important;
} }
} }
&.button-error.disabled { &.button-error.disabled {
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-error-ghost-button !important; color: @color-bi-text-disabled-error-ghost-button !important;
} }
border-color: @color-bi-border-disabled-error-ghost-button !important; border-color: @color-bi-border-disabled-error-ghost-button !important;
} }
} }
@ -424,14 +511,17 @@ body .bi-button, #body .bi-button {
top: 0; top: 0;
pointer-events: none; pointer-events: none;
} }
&.hack:after { &.hack:after {
content: none; content: none;
} }
&:active:after { &:active:after {
transform: scale(0, 1); transform: scale(0, 1);
.opacity(0.1); .opacity(0.1);
.transition(@activeStopVal) .transition(@activeStopVal)
} }
&:hover, &:focus { &:hover, &:focus {
& .bi-button-mask { & .bi-button-mask {
.opacity(0.1); .opacity(0.1);
@ -440,6 +530,7 @@ body .bi-button, #body .bi-button {
} }
} }
} }
&.button-ignore { &.button-ignore {
&:after { &:after {
content: ""; content: "";
@ -456,24 +547,30 @@ body .bi-button, #body .bi-button {
top: 0; top: 0;
pointer-events: none; pointer-events: none;
} }
&.hack:after { &.hack:after {
content: none; content: none;
} }
&:active:after { &:active:after {
transform: scale(0, 1); transform: scale(0, 1);
.opacity(0.1); .opacity(0.1);
.transition(@activeStopVal) .transition(@activeStopVal)
} }
&:hover, &:focus { &:hover, &:focus {
&:not(.clear, .ghost) { &:not(.clear, .ghost) {
background-color: @color-bi-background-hover-ignore-button-mask; background-color: @color-bi-background-hover-ignore-button-mask;
} }
.transition(@hoverVal); .transition(@hoverVal);
} }
} }
& .popup-content{
& .popup-content {
font-size: @font-size-14; font-size: @font-size-14;
} }
.bi-button-mask { .bi-button-mask {
pointer-events: none; pointer-events: none;
} }
@ -483,15 +580,19 @@ body .bi-button, #body .bi-button {
.bi-button { .bi-button {
&.button-ignore { &.button-ignore {
background-color: @color-bi-background-ignore-button-theme-dark; background-color: @color-bi-background-ignore-button-theme-dark;
&:hover, &:focus { &:hover, &:focus {
background-color: @color-bi-background-hover-ignore-button-theme-dark; background-color: @color-bi-background-hover-ignore-button-theme-dark;
} }
&:active { &:active {
background-color: @color-bi-background-active-ignore-button-theme-dark; background-color: @color-bi-background-active-ignore-button-theme-dark;
} }
&.clear { &.clear {
background-color: transparent; background-color: transparent;
} }
&.ghost { &.ghost {
border-color: @color-bi-border-dark-gray-line-theme-dark; border-color: @color-bi-border-dark-gray-line-theme-dark;
} }
@ -506,31 +607,36 @@ body .bi-button, #body .bi-button {
border-color: @color-bi-border-dark-gray-line-theme-dark !important; border-color: @color-bi-border-dark-gray-line-theme-dark !important;
background-color: fade(@color-bi-background-disabled-button-theme-dark, 20%) !important; background-color: fade(@color-bi-background-disabled-button-theme-dark, 20%) !important;
@ieColor: argb(fade(@color-bi-background-disabled-button-theme-dark, 20%)); @ieColor: argb(fade(@color-bi-background-disabled-button-theme-dark, 20%));
filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr=@{ieColor},endColorstr=@{ieColor})";
&.clear { &.clear {
background-color: transparent !important; background-color: transparent !important;
} }
&.ghost { &.ghost {
// 深色系下灰化就统一用灰化色 // 深色系下灰化就统一用灰化色
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-theme-dark !important; color: @color-bi-text-disabled-theme-dark !important;
} }
background: transparent !important; background: transparent !important;
.opacity(1); .opacity(1);
} }
} }
} }
&.button-ignore.disabled { &.button-ignore.disabled {
&, &.base-disabled { &, &.base-disabled {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-theme-dark !important; color: @color-bi-text-disabled-theme-dark !important;
} }
border-color: @color-bi-border-dark-gray-line-theme-dark !important; border-color: @color-bi-border-dark-gray-line-theme-dark !important;
background-color: @color-bi-background-ignore-button-theme-dark !important; background-color: @color-bi-background-ignore-button-theme-dark !important;
&.clear { &.clear {
background-color: transparent !important; background-color: transparent !important;
} }
&.ghost { &.ghost {
background: transparent !important; background: transparent !important;
.opacity(1); .opacity(1);

2
packages/fineui/src/less/visual.less

@ -43,13 +43,11 @@
.background-color(@color, @alpha) { .background-color(@color, @alpha) {
background-color: fade(@color, @alpha); background-color: fade(@color, @alpha);
@ieColor: argb(fade(@color, @alpha)); @ieColor: argb(fade(@color, @alpha));
filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr=@{ieColor},endColorstr=@{ieColor})";
} }
.opacity(@opa) { .opacity(@opa) {
opacity: @opa; opacity: @opa;
@opa-ie: @opa*100; @opa-ie: @opa*100;
filter: ~'alpha(opacity=@{opa-ie})';
} }
.transition(@transition) { .transition(@transition) {

Loading…
Cancel
Save