fix: style

This commit is contained in:
MadCcc 2022-07-12 18:15:14 +08:00
parent 5bd221ad39
commit 1cbc37f7bc
6 changed files with 21 additions and 405 deletions

View File

@ -1,64 +0,0 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@breadcrumb-prefix-cls: ~'@{ant-prefix}-breadcrumb';
.@{breadcrumb-prefix-cls} {
.reset-component();
color: @breadcrumb-base-color;
font-size: @breadcrumb-font-size;
.@{iconfont-css-prefix} {
font-size: @breadcrumb-icon-font-size;
}
ol {
display: flex;
flex-wrap: wrap;
margin: 0;
padding: 0;
list-style: none;
}
a {
color: @breadcrumb-link-color;
transition: color 0.3s;
&:hover {
color: @breadcrumb-link-color-hover;
}
}
li:last-child {
color: @breadcrumb-last-item-color;
a {
color: @breadcrumb-last-item-color;
}
}
li:last-child > &-separator {
display: none;
}
&-separator {
margin: @breadcrumb-separator-margin;
color: @breadcrumb-separator-color;
}
&-link {
> .@{iconfont-css-prefix} + span,
> .@{iconfont-css-prefix} + a {
margin-left: 4px;
}
}
&-overlay-link {
> .@{iconfont-css-prefix} {
margin-left: 4px;
}
}
}
@import './rtl';

View File

@ -52,7 +52,7 @@ const genBreadcrumbStyle: GenerateStyle<BreadcrumbToken, CSSObject> = token => {
},
},
[`li:last-child ${componentCls}-separator`]: {
[`li:last-child > ${componentCls}-separator`]: {
display: 'none',
},

View File

@ -792,6 +792,10 @@ const genPickerStatusStyle: GenerateStyle<PickerToken> = token => {
}),
),
},
[`${componentCls}-active-bar`]: {
background: token.colorError,
},
},
'&-status-warning&': {
@ -809,6 +813,10 @@ const genPickerStatusStyle: GenerateStyle<PickerToken> = token => {
}),
),
},
[`${componentCls}-active-bar`]: {
background: token.colorWarning,
},
},
},
};

View File

@ -1,38 +0,0 @@
@import '../../input/style/mixin';
@picker-prefix-cls: ~'@{ant-prefix}-picker';
.picker-status-color(
@text-color: @input-color;
@border-color: @input-border-color;
@background-color: @input-bg;
@hoverBorderColor: @primary-color-hover;
@outlineColor: @primary-color-outline;
) {
&.@{picker-prefix-cls} {
&,
&:not([disabled]):hover {
background-color: @background-color;
border-color: @border-color;
}
&-focused,
&:focus {
.active(@text-color, @hoverBorderColor, @outlineColor);
}
.@{picker-prefix-cls}-active-bar {
background: @hoverBorderColor;
}
}
}
.@{picker-prefix-cls} {
&-status-error {
.picker-status-color(@error-color, @error-color, @input-bg, @error-color-hover, @error-color-outline);
}
&-status-warning {
.picker-status-color(@warning-color, @warning-color, @input-bg, @warning-color-hover, @warning-color-outline);
}
}

View File

@ -1,285 +0,0 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@skeleton-prefix-cls: ~'@{ant-prefix}-skeleton';
@skeleton-avatar-prefix-cls: ~'@{skeleton-prefix-cls}-avatar';
@skeleton-title-prefix-cls: ~'@{skeleton-prefix-cls}-title';
@skeleton-paragraph-prefix-cls: ~'@{skeleton-prefix-cls}-paragraph';
@skeleton-button-prefix-cls: ~'@{skeleton-prefix-cls}-button';
@skeleton-input-prefix-cls: ~'@{skeleton-prefix-cls}-input';
@skeleton-image-prefix-cls: ~'@{skeleton-prefix-cls}-image';
@skeleton-block-radius: @border-radius-base;
.@{skeleton-prefix-cls} {
display: table;
width: 100%;
&-header {
display: table-cell;
padding-right: @padding-md;
vertical-align: top;
// Avatar
.@{skeleton-avatar-prefix-cls} {
.skeleton-element-avatar();
}
}
&-content {
display: table-cell;
width: 100%;
vertical-align: top;
// Title
.@{skeleton-title-prefix-cls} {
width: 100%;
height: @skeleton-title-height;
background: @skeleton-color;
border-radius: @skeleton-block-radius;
+ .@{skeleton-paragraph-prefix-cls} {
margin-top: @skeleton-title-paragraph-margin-top;
}
}
// paragraph
.@{skeleton-paragraph-prefix-cls} {
padding: 0;
> li {
width: 100%;
height: @skeleton-paragraph-li-height;
list-style: none;
background: @skeleton-color;
border-radius: @skeleton-block-radius;
&:last-child:not(:first-child):not(:nth-child(2)) {
width: 61%;
}
+ li {
margin-top: @skeleton-paragraph-li-margin-top;
}
}
}
}
&-with-avatar &-content {
// Title
.@{skeleton-title-prefix-cls} {
margin-top: @margin-sm;
+ .@{skeleton-paragraph-prefix-cls} {
margin-top: @skeleton-paragraph-margin-top;
}
}
}
&-round &-content {
.@{skeleton-title-prefix-cls},
.@{skeleton-paragraph-prefix-cls} > li {
border-radius: 100px;
}
}
// With active animation
&-active {
.@{skeleton-title-prefix-cls},
.@{skeleton-paragraph-prefix-cls} > li,
.@{skeleton-avatar-prefix-cls},
.@{skeleton-button-prefix-cls},
.@{skeleton-input-prefix-cls},
.@{skeleton-image-prefix-cls} {
.skeleton-color();
}
}
// Skeleton Block Button, Input
&.@{skeleton-prefix-cls}-block {
width: 100%;
.@{skeleton-button-prefix-cls} {
width: 100%;
}
.@{skeleton-input-prefix-cls} {
width: 100%;
}
}
// Skeleton element
&-element {
display: inline-block;
width: auto;
.@{skeleton-button-prefix-cls} {
.skeleton-element-button();
}
.@{skeleton-avatar-prefix-cls} {
.skeleton-element-avatar();
}
.@{skeleton-input-prefix-cls} {
.skeleton-element-input();
}
.@{skeleton-image-prefix-cls} {
.skeleton-element-image();
}
}
}
// Button
.skeleton-element-button() {
display: inline-block;
vertical-align: top;
background: @skeleton-color;
border-radius: @border-radius-base;
.skeleton-element-button-size(@btn-height-base);
&-lg {
.skeleton-element-button-size(@btn-height-lg);
}
&-sm {
.skeleton-element-button-size(@btn-height-sm);
}
}
// Avatar
.skeleton-element-avatar() {
display: inline-block;
vertical-align: top;
background: @skeleton-color;
.skeleton-element-avatar-size(@avatar-size-base);
&-lg {
.skeleton-element-avatar-size(@avatar-size-lg);
}
&-sm {
.skeleton-element-avatar-size(@avatar-size-sm);
}
}
// Input
.skeleton-element-input() {
display: inline-block;
vertical-align: top;
background: @skeleton-color;
.skeleton-element-input-size(@input-height-base);
&-lg {
.skeleton-element-input-size(@input-height-lg);
}
&-sm {
.skeleton-element-input-size(@input-height-sm);
}
}
// Image
.skeleton-element-image() {
display: flex;
align-items: center;
justify-content: center;
vertical-align: top;
background: @skeleton-color;
.skeleton-element-image-size(@image-size-base*2);
&-path {
fill: #bfbfbf;
}
&-svg {
.skeleton-element-image-size(@image-size-base);
max-width: @image-size-base * 4;
max-height: @image-size-base * 4;
}
}
.skeleton-element-avatar-size(@size) {
width: @size;
.skeleton-element-common-size(@size);
&.@{skeleton-avatar-prefix-cls}-circle {
border-radius: 50%;
}
}
.skeleton-element-button-size(@size) {
width: @size * 2;
min-width: @size * 2;
.skeleton-element-common-size(@size);
&.@{skeleton-button-prefix-cls}-circle {
width: @size;
min-width: @size;
border-radius: 50%;
}
&.@{skeleton-button-prefix-cls}-round {
border-radius: @size;
}
}
.skeleton-element-input-size(@size) {
width: @size * 5;
min-width: @size * 5;
.skeleton-element-common-size(@size);
}
.skeleton-element-image-size(@size) {
width: @size;
.skeleton-element-common-size(@size);
&.@{skeleton-image-prefix-cls}-circle {
border-radius: 50%;
}
}
.skeleton-element-common-size(@size) {
height: @size;
line-height: @size;
}
.skeleton-color() {
position: relative;
// fix https://github.com/ant-design/ant-design/issues/36444
// https://monshin.github.io/202109/css/safari-border-radius-overflow-hidden/
/* stylelint-disable-next-line property-no-vendor-prefix,value-no-vendor-prefix */
z-index: 0;
overflow: hidden;
background: transparent;
&::after {
position: absolute;
top: 0;
right: -150%;
bottom: 0;
left: -150%;
background: linear-gradient(
90deg,
@skeleton-color 25%,
@skeleton-to-color 37%,
@skeleton-color 63%
);
animation: ~'@{skeleton-prefix-cls}-loading' 1.4s ease infinite;
content: '';
}
}
@keyframes ~"@{skeleton-prefix-cls}-loading" {
0% {
transform: translateX(-37.5%);
}
100% {
transform: translateX(37.5%);
}
}
@import './rtl';

View File

@ -46,6 +46,10 @@ const genSkeletonElementAvatarSize = (size: number): CSSObject => ({
const genSkeletonColor = (token: SkeletonToken): CSSObject => ({
position: 'relative',
// fix https://github.com/ant-design/ant-design/issues/36444
// https://monshin.github.io/202109/css/safari-border-radius-overflow-hidden/
/* stylelint-disable-next-line property-no-vendor-prefix,value-no-vendor-prefix */
zIndex: 0,
overflow: 'hidden',
background: 'transparent',
'&::after': {
@ -320,23 +324,14 @@ const genBaseStyle: GenerateStyle<SkeletonToken> = (token: SkeletonToken) => {
},
// With active animation
[`${componentCls}${componentCls}-active`]: {
[`${componentCls}-content`]: {
[`${skeletonTitleCls}, ${skeletonParagraphCls} > li`]: {
...genSkeletonColor(token),
},
},
[`${skeletonAvatarCls}`]: {
...genSkeletonColor(token),
},
[`${skeletonButtonCls}`]: {
...genSkeletonColor(token),
},
[`${skeletonInputCls}`]: {
...genSkeletonColor(token),
},
[`${skeletonImageCls}`]: {
[`
${skeletonTitleCls},
${skeletonParagraphCls} > li,
${skeletonAvatarCls},
${skeletonButtonCls},
${skeletonInputCls},
${skeletonImageCls}
`]: {
...genSkeletonColor(token),
},
},