mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-06 02:15:35 +08:00
8e27cf986f
* chore: rm component less file * refactor: less file * refactor: rm less * refactor: rm page-header and comment * chore: rm less in components * chore: update dist config * chore: update image test * chore: update dekko * chore: rm lib dekko * chore: update dist dekko * chore: udpate bundle size * test: update snapshot * test: rm theme test * test: update snapshot * test: update snapshot * chore: copy reset.css * test: update image test * chore: copy reset.css to es * chore: update site script
101 lines
2.6 KiB
TypeScript
101 lines
2.6 KiB
TypeScript
import type { CSSObject } from '@ant-design/cssinjs';
|
|
import type { FullToken, GenerateStyle } from '../../theme';
|
|
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme';
|
|
|
|
interface BreadcrumbToken extends FullToken<'Breadcrumb'> {
|
|
breadcrumbBaseColor: string;
|
|
breadcrumbFontSize: number;
|
|
breadcrumbIconFontSize: number;
|
|
breadcrumbLinkColor: string;
|
|
breadcrumbLinkColorHover: string;
|
|
breadcrumbLastItemColor: string;
|
|
breadcrumbSeparatorMargin: number;
|
|
breadcrumbSeparatorColor: string;
|
|
}
|
|
|
|
const genBreadcrumbStyle: GenerateStyle<BreadcrumbToken, CSSObject> = token => {
|
|
const { componentCls, iconCls } = token;
|
|
|
|
return {
|
|
[componentCls]: {
|
|
...resetComponent(token),
|
|
color: token.breadcrumbBaseColor,
|
|
fontSize: token.breadcrumbFontSize,
|
|
|
|
[iconCls]: {
|
|
fontSize: token.breadcrumbIconFontSize,
|
|
},
|
|
|
|
ol: {
|
|
display: 'flex',
|
|
flexWrap: 'wrap',
|
|
margin: 0,
|
|
padding: 0,
|
|
listStyle: 'none',
|
|
},
|
|
|
|
a: {
|
|
color: token.breadcrumbLinkColor,
|
|
transition: `color ${token.motionDurationSlow}`,
|
|
|
|
'&:hover': {
|
|
color: token.breadcrumbLinkColorHover,
|
|
},
|
|
},
|
|
|
|
'li:last-child': {
|
|
color: token.breadcrumbLastItemColor,
|
|
|
|
a: {
|
|
color: token.breadcrumbLastItemColor,
|
|
},
|
|
},
|
|
|
|
[`li:last-child ${componentCls}-separator`]: {
|
|
display: 'none',
|
|
},
|
|
|
|
[`${componentCls}-separator`]: {
|
|
marginInline: token.breadcrumbSeparatorMargin,
|
|
color: token.breadcrumbSeparatorColor,
|
|
},
|
|
|
|
[`${componentCls}-link`]: {
|
|
[`
|
|
> ${iconCls} + span,
|
|
> ${iconCls} + a
|
|
`]: {
|
|
marginInlineStart: token.marginXXS,
|
|
},
|
|
},
|
|
|
|
[`${componentCls}-overlay-link`]: {
|
|
[`> ${iconCls}`]: {
|
|
marginInlineStart: token.marginXXS,
|
|
},
|
|
},
|
|
|
|
// rtl style
|
|
[`&${token.componentCls}-rtl`]: {
|
|
direction: 'rtl',
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
// ============================== Export ==============================
|
|
export default genComponentStyleHook('Breadcrumb', token => {
|
|
const BreadcrumbToken = mergeToken<BreadcrumbToken>(token, {
|
|
breadcrumbBaseColor: token.colorTextSecondary,
|
|
breadcrumbFontSize: token.fontSizeBase,
|
|
breadcrumbIconFontSize: token.fontSizeBase,
|
|
breadcrumbLinkColor: token.colorTextSecondary,
|
|
breadcrumbLinkColorHover: token.colorText,
|
|
breadcrumbLastItemColor: token.colorText,
|
|
breadcrumbSeparatorMargin: token.paddingXS,
|
|
breadcrumbSeparatorColor: token.colorTextSecondary,
|
|
});
|
|
|
|
return [genBreadcrumbStyle(BreadcrumbToken)];
|
|
});
|