feat: generate anchor style for all components (#36460)

* test: fix lint

* chore: code clean

* doc: anchor color

* chore: style order
This commit is contained in:
MadCcc 2022-07-11 15:35:58 +08:00 committed by GitHub
parent 1bf275fa9a
commit cdbfe45df1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
62 changed files with 160 additions and 102 deletions

View File

@ -1,6 +1,7 @@
import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs'; import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
export interface ComponentToken {} export interface ComponentToken {}

View File

@ -1,6 +1,7 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
export interface ComponentToken {} export interface ComponentToken {}

View File

@ -1,6 +1,7 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
export interface ComponentToken {} export interface ComponentToken {}

View File

@ -1,6 +1,7 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
/** Component only token. Which will handle additional calculation of alias token */ /** Component only token. Which will handle additional calculation of alias token */
export interface ComponentToken { export interface ComponentToken {

View File

@ -1,7 +1,8 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import { Keyframes } from '@ant-design/cssinjs'; import { Keyframes } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle, PresetColorType } from '../../theme'; import type { FullToken, GenerateStyle, PresetColorType } from '../../theme';
import { genComponentStyleHook, mergeToken, PresetColors, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken, PresetColors } from '../../theme';
import { resetComponent } from '../../style';
interface BadgeToken extends FullToken<'Badge'> { interface BadgeToken extends FullToken<'Badge'> {
badgeFontHeight: number; badgeFontHeight: number;

View File

@ -1,6 +1,7 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
interface BreadcrumbToken extends FullToken<'Breadcrumb'> { interface BreadcrumbToken extends FullToken<'Breadcrumb'> {
breadcrumbBaseColor: string; breadcrumbBaseColor: string;

View File

@ -1,10 +1,11 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import { resetComponent } from '../../style';
import type { PickerPanelToken } from '../../date-picker/style'; import type { PickerPanelToken } from '../../date-picker/style';
import { genPanelStyle, initPickerPanelToken } from '../../date-picker/style'; import { genPanelStyle, initPickerPanelToken } from '../../date-picker/style';
import type { InputToken } from '../../input/style'; import type { InputToken } from '../../input/style';
import { initInputToken } from '../../input/style'; import { initInputToken } from '../../input/style';
import type { FullToken } from '../../theme'; import type { FullToken } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
export interface ComponentToken { export interface ComponentToken {
yearControlWidth: number; yearControlWidth: number;

View File

@ -1,7 +1,8 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { clearFix, genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { clearFix, resetComponent } from '../../style';
interface CardToken extends FullToken<'Card'> { interface CardToken extends FullToken<'Card'> {
cardShadow: string; cardShadow: string;

View File

@ -1,5 +1,6 @@
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
export interface ComponentToken { export interface ComponentToken {
dotWidth: number; dotWidth: number;

View File

@ -1,6 +1,7 @@
import { Keyframes } from '@ant-design/cssinjs'; import { Keyframes } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
export interface ComponentToken {} export interface ComponentToken {}

View File

@ -1,5 +1,6 @@
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent, resetIcon } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent, resetIcon } from '../../style';
type CollapseToken = FullToken<'Collapse'> & { type CollapseToken = FullToken<'Collapse'> & {
collapseContentBg: string; collapseContentBg: string;

View File

@ -9,9 +9,10 @@ import {
} from '../../input/style'; } from '../../input/style';
import { slideDownIn, slideDownOut, slideUpIn, slideUpOut } from '../../style/motion'; import { slideDownIn, slideDownOut, slideUpIn, slideUpOut } from '../../style/motion';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent, roundedArrow } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import type { GlobalToken } from '../../theme/interface'; import type { GlobalToken } from '../../theme/interface';
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook'; import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
import { resetComponent, roundedArrow } from '../../style';
export interface ComponentToken { export interface ComponentToken {
zIndexPopup: number; zIndexPopup: number;

View File

@ -1,6 +1,7 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
interface DescriptionsToken extends FullToken<'Descriptions'> { interface DescriptionsToken extends FullToken<'Descriptions'> {
descriptionsTitleMarginBottom: number; descriptionsTitleMarginBottom: number;

View File

@ -1,6 +1,7 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
/** Component only token. Which will handle additional calculation of alias token */ /** Component only token. Which will handle additional calculation of alias token */
export interface ComponentToken { export interface ComponentToken {

View File

@ -7,9 +7,10 @@ import {
slideUpOut, slideUpOut,
} from '../../style/motion'; } from '../../style/motion';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent, roundedArrow } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import genButtonStyle from './button'; import genButtonStyle from './button';
import genStatusStyle from './status'; import genStatusStyle from './status';
import { resetComponent, roundedArrow } from '../../style';
export interface ComponentToken { export interface ComponentToken {
zIndexPopup: number; zIndexPopup: number;

View File

@ -1,7 +1,8 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import { zoomIn } from '../../style/motion'; import { zoomIn } from '../../style/motion';
import type { AliasToken, FullToken, GenerateStyle } from '../../theme'; import type { AliasToken, FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
interface FormToken extends FullToken<'Form'> { interface FormToken extends FullToken<'Form'> {
formItemCls: string; formItemCls: string;

View File

@ -3,7 +3,8 @@ import { TinyColor } from '@ctrl/tinycolor';
import { genModalMaskStyle } from '../../modal/style'; import { genModalMaskStyle } from '../../modal/style';
import { initZoomMotion } from '../../style/motion'; import { initZoomMotion } from '../../style/motion';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
export interface ComponentToken { export interface ComponentToken {
zIndexPopup: number; zIndexPopup: number;

View File

@ -10,7 +10,8 @@ import {
initInputToken, initInputToken,
} from '../../input/style'; } from '../../input/style';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, resetComponent, resetIcon } from '../../theme'; import { genComponentStyleHook } from '../../theme';
import { resetComponent, resetIcon } from '../../style';
export interface ComponentToken { export interface ComponentToken {
controlWidth: number; controlWidth: number;

View File

@ -1,7 +1,8 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { clearFix, genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import type { GlobalToken } from '../../theme/interface'; import type { GlobalToken } from '../../theme/interface';
import { clearFix, resetComponent } from '../../style';
export type InputToken<T extends GlobalToken = FullToken<'Input'>> = T & { export type InputToken<T extends GlobalToken = FullToken<'Input'>> = T & {
inputAffixPadding: number; inputAffixPadding: number;

View File

@ -1,6 +1,7 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
export interface ComponentToken { export interface ComponentToken {
contentWidth: number; contentWidth: number;

View File

@ -8,7 +8,8 @@ import {
initInputToken, initInputToken,
} from '../../input/style'; } from '../../input/style';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, resetComponent } from '../../theme'; import { genComponentStyleHook } from '../../theme';
import { resetComponent } from '../../style';
export interface ComponentToken { export interface ComponentToken {
zIndexPopup: number; zIndexPopup: number;

View File

@ -1,16 +1,11 @@
import { TinyColor } from '@ctrl/tinycolor'; import { TinyColor } from '@ctrl/tinycolor';
import type { FullToken, GenerateStyle, UseComponentStyleResult } from '../../theme'; import type { FullToken, GenerateStyle, UseComponentStyleResult } from '../../theme';
import { import { genComponentStyleHook, mergeToken } from '../../theme';
clearFix,
genComponentStyleHook,
mergeToken,
resetComponent,
resetIcon,
} from '../../theme';
import getHorizontalStyle from './horizontal'; import getHorizontalStyle from './horizontal';
import getRTLStyle from './rtl'; import getRTLStyle from './rtl';
import getThemeStyle from './theme'; import getThemeStyle from './theme';
import getVerticalStyle from './vertical'; import getVerticalStyle from './vertical';
import { clearFix, resetComponent, resetIcon } from '../../style';
/** Component only token. Which will handle additional calculation of alias token */ /** Component only token. Which will handle additional calculation of alias token */
export interface ComponentToken { export interface ComponentToken {

View File

@ -1,7 +1,8 @@
// deps-lint-skip-all // deps-lint-skip-all
import { Keyframes } from '@ant-design/cssinjs'; import { Keyframes } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
/** Component only token. Which will handle additional calculation of alias token */ /** Component only token. Which will handle additional calculation of alias token */
export interface ComponentToken { export interface ComponentToken {

View File

@ -1,8 +1,9 @@
import type React from 'react'; import type React from 'react';
import { initFadeMotion, initZoomMotion } from '../../style/motion'; import { initFadeMotion, initZoomMotion } from '../../style/motion';
import type { AliasToken, FullToken, GenerateStyle } from '../../theme'; import type { AliasToken, FullToken, GenerateStyle } from '../../theme';
import { clearFix, genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook'; import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
import { clearFix, resetComponent } from '../../style';
/** Component only token. Which will handle additional calculation of alias token */ /** Component only token. Which will handle additional calculation of alias token */
export interface ComponentToken { export interface ComponentToken {

View File

@ -1,7 +1,8 @@
import { Keyframes } from '@ant-design/cssinjs'; import { Keyframes } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import genNotificationPlacementStyle from './placement'; import genNotificationPlacementStyle from './placement';
import { resetComponent } from '../../style';
/** Component only token. Which will handle additional calculation of alias token */ /** Component only token. Which will handle additional calculation of alias token */
export interface ComponentToken { export interface ComponentToken {

View File

@ -6,7 +6,8 @@ import {
type InputToken, type InputToken,
} from '../../input/style'; } from '../../input/style';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
interface PaginationToken extends InputToken<FullToken<'Pagination'>> { interface PaginationToken extends InputToken<FullToken<'Pagination'>> {
paginationItemSize: number; paginationItemSize: number;

View File

@ -1,12 +1,8 @@
import { initZoomMotion } from '../../style/motion'; import { initZoomMotion } from '../../style/motion';
import type { FullToken, GenerateStyle, PresetColorType } from '../../theme'; import type { FullToken, GenerateStyle, PresetColorType } from '../../theme';
import { import { genComponentStyleHook, mergeToken, PresetColors } from '../../theme';
genComponentStyleHook, import { resetComponent } from '../../style';
getArrowStyle, import getArrowStyle from '../../style/placementArrow';
mergeToken,
PresetColors,
resetComponent,
} from '../../theme';
export interface ComponentToken { export interface ComponentToken {
zIndexPopup: number; zIndexPopup: number;

View File

@ -1,7 +1,8 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import { Keyframes } from '@ant-design/cssinjs'; import { Keyframes } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
export interface ComponentToken {} export interface ComponentToken {}

View File

@ -1,6 +1,7 @@
import { Keyframes } from '@ant-design/cssinjs'; import { Keyframes } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
// ============================== Tokens ============================== // ============================== Tokens ==============================
export interface ComponentToken {} export interface ComponentToken {}

View File

@ -1,6 +1,7 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
export type ComponentToken = {}; export type ComponentToken = {};

View File

@ -1,6 +1,7 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
export interface ComponentToken { export interface ComponentToken {
// FIXME: need to be removed // FIXME: need to be removed

View File

@ -9,7 +9,7 @@ import {
slideUpOut, slideUpOut,
} from '../../style/motion'; } from '../../style/motion';
import type { GenerateStyle } from '../../theme'; import type { GenerateStyle } from '../../theme';
import { resetComponent } from '../../theme'; import { resetComponent } from '../../style';
const genItemStyle: GenerateStyle<SelectToken, CSSObject> = token => { const genItemStyle: GenerateStyle<SelectToken, CSSObject> = token => {
const { controlPaddingHorizontal } = token; const { controlPaddingHorizontal } = token;

View File

@ -1,9 +1,10 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent, resetIcon } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import genDropdownStyle from './dropdown'; import genDropdownStyle from './dropdown';
import genMultipleStyle from './multiple'; import genMultipleStyle from './multiple';
import genSingleStyle from './single'; import genSingleStyle from './single';
import { resetComponent, resetIcon } from '../../style';
export interface ComponentToken { export interface ComponentToken {
zIndexPopup: number; zIndexPopup: number;

View File

@ -1,6 +1,7 @@
import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs'; import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
import type { SelectToken } from '.'; import type { SelectToken } from '.';
import { mergeToken, resetIcon } from '../../theme'; import { mergeToken } from '../../theme';
import { resetIcon } from '../../style';
const FIXED_ITEM_MARGIN = 2; const FIXED_ITEM_MARGIN = 2;

View File

@ -2,7 +2,8 @@ import type { CSSObject } from '@ant-design/cssinjs';
import { TinyColor } from '@ctrl/tinycolor'; import { TinyColor } from '@ctrl/tinycolor';
import type * as React from 'react'; import type * as React from 'react';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
// Direction naming standard: // Direction naming standard:
// Horizontal base: // Horizontal base:

View File

@ -1,7 +1,8 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import { Keyframes } from '@ant-design/cssinjs'; import { Keyframes } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
export interface ComponentToken { export interface ComponentToken {
contentHeight: number; contentHeight: number;

View File

@ -1,6 +1,7 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
interface StatisticToken extends FullToken<'Statistic'> { interface StatisticToken extends FullToken<'Statistic'> {
statisticTitleFontSize: number; statisticTitleFontSize: number;

View File

@ -1,6 +1,6 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import genStepsCustomIconStyle from './custom-icon'; import genStepsCustomIconStyle from './custom-icon';
import genStepsLabelPlacementStyle from './label-placement'; import genStepsLabelPlacementStyle from './label-placement';
import genStepsNavStyle from './nav'; import genStepsNavStyle from './nav';
@ -9,6 +9,7 @@ import genStepsProgressDotStyle from './progress-dot';
import genStepsRTLStyle from './rtl'; import genStepsRTLStyle from './rtl';
import genStepsSmallStyle from './small'; import genStepsSmallStyle from './small';
import genStepsVerticalStyle from './vertical'; import genStepsVerticalStyle from './vertical';
import { resetComponent } from '../../style';
export interface ComponentToken { export interface ComponentToken {
descriptionWidth: number; descriptionWidth: number;

View File

@ -1,6 +1,6 @@
/* eslint-disable import/prefer-default-export */ /* eslint-disable import/prefer-default-export */
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { DerivativeToken } from '..'; import type { DerivativeToken } from '../theme';
export { operationUnit } from './operationUnit'; export { operationUnit } from './operationUnit';
export { roundedArrow } from './roundedArrow'; export { roundedArrow } from './roundedArrow';
@ -15,9 +15,6 @@ export const resetComponent = (token: DerivativeToken): CSSObject => ({
lineHeight: token.lineHeight, lineHeight: token.lineHeight,
listStyle: 'none', listStyle: 'none',
// font-feature-settings: @font-feature-settings-base; // font-feature-settings: @font-feature-settings-base;
a: {
textDecoration: 'none',
},
}); });
export const resetIcon = (): CSSObject => ({ export const resetIcon = (): CSSObject => ({
@ -61,3 +58,40 @@ export const clearFix = (): CSSObject => ({
content: '""', content: '""',
}, },
}); });
export const genLinkStyle = (token: DerivativeToken): CSSObject => ({
a: {
color: token.colorLink,
textDecoration: token.linkDecoration,
backgroundColor: 'transparent', // remove the gray background on active links in IE 10.
outline: 'none',
cursor: 'pointer',
transition: `color ${token.motionDurationSlow}`,
'-webkit-text-decoration-skip': 'objects', // remove gaps in links underline in iOS 8+ and Safari 8+.
'&:hover': {
color: token.colorLinkHover,
},
'&:active': {
color: token.colorLinkActive,
},
[`&:active,
&:hover`]: {
textDecoration: token.linkHoverDecoration,
outline: 0,
},
// https://github.com/ant-design/ant-design/issues/22503
'&:focus': {
textDecoration: token.linkFocusDecoration,
outline: 0,
},
'&[disabled]': {
color: token.colorTextDisabled,
cursor: 'not-allowed',
},
},
});

View File

@ -1,5 +1,5 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { DerivativeToken } from '..'; import type { DerivativeToken } from '../theme';
// eslint-disable-next-line import/prefer-default-export // eslint-disable-next-line import/prefer-default-export
export const operationUnit = (token: DerivativeToken): CSSObject => ({ export const operationUnit = (token: DerivativeToken): CSSObject => ({

View File

@ -1,6 +1,6 @@
import type { CSSInterpolation } from '@ant-design/cssinjs'; import type { CSSInterpolation } from '@ant-design/cssinjs';
import type { AliasToken } from '../interface'; import type { AliasToken } from '../theme';
import type { TokenWithCommonCls } from './genComponentStyleHook'; import type { TokenWithCommonCls } from '../theme/util/genComponentStyleHook';
import { roundedArrow } from './roundedArrow'; import { roundedArrow } from './roundedArrow';
function connectArrowCls(classList: string[], showArrowCls: string = '') { function connectArrowCls(classList: string[], showArrowCls: string = '') {

View File

@ -1,10 +1,9 @@
/* eslint-disable import/prefer-default-export */ /* eslint-disable import/prefer-default-export */
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import seedToken from '../themes/seed';
export const roundedArrow = (width: number, outerRadius: number, bgColor: string): CSSObject => { export const roundedArrow = (width: number, outerRadius: number, bgColor: string): CSSObject => {
const cornerHeight = outerRadius * (1 - 1 / Math.sqrt(2)); const cornerHeight = outerRadius * (1 - 1 / Math.sqrt(2));
const { radiusBase } = seedToken; const radiusBase = 2;
const ax = width - cornerHeight; const ax = width - cornerHeight;
const ay = 2 * width + cornerHeight; const ay = 2 * width + cornerHeight;

View File

@ -1,7 +1,8 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import { TinyColor } from '@ctrl/tinycolor'; import { TinyColor } from '@ctrl/tinycolor';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
interface SwitchToken extends FullToken<'Switch'> { interface SwitchToken extends FullToken<'Switch'> {
switchMinWidth: number; switchMinWidth: number;

View File

@ -1,7 +1,7 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { GenerateStyle } from '../../theme'; import type { GenerateStyle } from '../../theme';
import { operationUnit } from '../../theme';
import type { TableToken } from './index'; import type { TableToken } from './index';
import { operationUnit } from '../../style';
const genExpandStyle: GenerateStyle<TableToken, CSSObject> = token => { const genExpandStyle: GenerateStyle<TableToken, CSSObject> = token => {
const { const {

View File

@ -1,9 +1,8 @@
import type { CSSInterpolation } from '@ant-design/cssinjs';
import type { GenerateStyle } from '../../theme'; import type { GenerateStyle } from '../../theme';
import { resetComponent } from '../../theme';
import type { TableToken } from './index'; import type { TableToken } from './index';
import { resetComponent } from '../../style';
const genFilterStyle: GenerateStyle<TableToken, CSSInterpolation> = token => { const genFilterStyle: GenerateStyle<TableToken> = token => {
const { const {
componentCls, componentCls,
antCls, antCls,

View File

@ -1,7 +1,7 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import { TinyColor } from '@ctrl/tinycolor'; import { TinyColor } from '@ctrl/tinycolor';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { clearFix, genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import genBorderedStyle from './bordered'; import genBorderedStyle from './bordered';
import genEllipsisStyle from './ellipsis'; import genEllipsisStyle from './ellipsis';
import genEmptyStyle from './empty'; import genEmptyStyle from './empty';
@ -16,6 +16,7 @@ import genSizeStyle from './size';
import genSorterStyle from './sorter'; import genSorterStyle from './sorter';
import genStickyStyle from './sticky'; import genStickyStyle from './sticky';
import genSummaryStyle from './summary'; import genSummaryStyle from './summary';
import { clearFix, resetComponent } from '../../style';
export interface ComponentToken {} export interface ComponentToken {}

View File

@ -1,6 +1,7 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
export interface ComponentToken { export interface ComponentToken {
zIndexPopup: number; zIndexPopup: number;

View File

@ -1,7 +1,9 @@
import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs'; import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
import type React from 'react';
import type { FullToken, PresetColorType } from '../../theme'; import type { FullToken, PresetColorType } from '../../theme';
import { genComponentStyleHook, mergeToken, PresetColors, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken, PresetColors } from '../../theme';
import capitalize from '../../_util/capitalize'; import capitalize from '../../_util/capitalize';
import { resetComponent } from '../../style';
interface TagToken extends FullToken<'Tag'> { interface TagToken extends FullToken<'Tag'> {
tagFontSize: number; tagFontSize: number;

View File

@ -13,22 +13,14 @@ import type {
import { PresetColors } from './interface'; import { PresetColors } from './interface';
import defaultDerivative from './themes/default'; import defaultDerivative from './themes/default';
import defaultSeedToken from './themes/seed'; import defaultSeedToken from './themes/seed';
import { clearFix, operationUnit, resetComponent, resetIcon, roundedArrow } from './util';
import formatToken from './util/alias'; import formatToken from './util/alias';
import type { FullToken } from './util/genComponentStyleHook'; import type { FullToken } from './util/genComponentStyleHook';
import genComponentStyleHook from './util/genComponentStyleHook'; import genComponentStyleHook from './util/genComponentStyleHook';
import getArrowStyle from './util/placementArrow';
import statisticToken, { merge as mergeToken, statistic } from './util/statistic'; import statisticToken, { merge as mergeToken, statistic } from './util/statistic';
const defaultTheme = createTheme(defaultDerivative); const defaultTheme = createTheme(defaultDerivative);
export { export {
resetComponent,
resetIcon,
clearFix,
roundedArrow,
getArrowStyle,
operationUnit,
// colors // colors
PresetColors, PresetColors,
// Statistic // Statistic

View File

@ -2,6 +2,7 @@
import type { CSSInterpolation } from '@ant-design/cssinjs'; import type { CSSInterpolation } from '@ant-design/cssinjs';
import { useStyleRegister } from '@ant-design/cssinjs'; import { useStyleRegister } from '@ant-design/cssinjs';
import { useContext } from 'react'; import { useContext } from 'react';
import { genLinkStyle } from '../../style';
import { ConfigContext } from '../../config-provider/context'; import { ConfigContext } from '../../config-provider/context';
import type { UseComponentStyleResult } from '../index'; import type { UseComponentStyleResult } from '../index';
import { mergeToken, statisticToken, useToken } from '../index'; import { mergeToken, statisticToken, useToken } from '../index';
@ -74,12 +75,14 @@ export default function genComponentStyleHook<ComponentName extends OverrideComp
mergedComponentToken[key] = overrideComponentToken[key] ?? mergedComponentToken[key]; mergedComponentToken[key] = overrideComponentToken[key] ?? mergedComponentToken[key];
}); });
} }
const componentCls = `.${prefixCls}`;
const mergedToken = mergeToken< const mergedToken = mergeToken<
TokenWithCommonCls<GlobalTokenWithComponent<OverrideComponent>> TokenWithCommonCls<GlobalTokenWithComponent<OverrideComponent>>
>( >(
proxyToken, proxyToken,
{ {
componentCls: `.${prefixCls}`, componentCls,
prefixCls, prefixCls,
iconCls: `.${iconPrefixCls}`, iconCls: `.${iconPrefixCls}`,
antCls: `.${rootPrefixCls}`, antCls: `.${rootPrefixCls}`,
@ -94,7 +97,11 @@ export default function genComponentStyleHook<ComponentName extends OverrideComp
iconPrefixCls, iconPrefixCls,
}); });
flush(component, mergedComponentToken); flush(component, mergedComponentToken);
return styleInterpolation; return [
// Generate style for all a tags in antd component
{ [componentCls]: genLinkStyle(token) },
styleInterpolation,
];
}), }),
hashId, hashId,
]; ];

View File

@ -1,6 +1,7 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
export interface ComponentToken {} export interface ComponentToken {}

View File

@ -6,13 +6,9 @@ import type {
PresetColorType, PresetColorType,
UseComponentStyleResult, UseComponentStyleResult,
} from '../../theme'; } from '../../theme';
import { import { genComponentStyleHook, mergeToken, PresetColors } from '../../theme';
genComponentStyleHook, import { resetComponent } from '../../style';
getArrowStyle, import getArrowStyle from '../../style/placementArrow';
mergeToken,
PresetColors,
resetComponent,
} from '../../theme';
export interface ComponentToken { export interface ComponentToken {
zIndexPopup: number; zIndexPopup: number;

View File

@ -1,13 +1,8 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { import { genComponentStyleHook, mergeToken } from '../../theme';
genComponentStyleHook, import { operationUnit, resetComponent, resetIcon } from '../../style';
mergeToken,
operationUnit,
resetComponent,
resetIcon,
} from '../../theme';
export interface ComponentToken { export interface ComponentToken {
listWidth: number; listWidth: number;

View File

@ -6,7 +6,8 @@ import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
import { Keyframes } from '@ant-design/cssinjs'; import { Keyframes } from '@ant-design/cssinjs';
import { getStyle as getCheckboxStyle } from '../../checkbox/style'; import { getStyle as getCheckboxStyle } from '../../checkbox/style';
import type { DerivativeToken } from '../../theme'; import type { DerivativeToken } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import { resetComponent } from '../../style';
// ============================ Keyframes ============================= // ============================ Keyframes =============================
const treeNodeFX = new Keyframes('ant-tree-node-fx-do-not-use', { const treeNodeFX = new Keyframes('ant-tree-node-fx-do-not-use', {

View File

@ -1,5 +1,5 @@
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, operationUnit } from '../../theme'; import { genComponentStyleHook } from '../../theme';
import { import {
getCopiableStyles, getCopiableStyles,
getEditableStyles, getEditableStyles,
@ -8,6 +8,7 @@ import {
getResetStyles, getResetStyles,
getTitleStyles, getTitleStyles,
} from './mixins'; } from './mixins';
import { operationUnit } from '../../style';
/** Component only token. Which will handle additional calculation of alias token */ /** Component only token. Which will handle additional calculation of alias token */
export interface ComponentToken { export interface ComponentToken {

View File

@ -12,7 +12,7 @@ import type { CSSObject } from '@ant-design/cssinjs';
import type { TypographyToken } from '.'; import type { TypographyToken } from '.';
import { initInputToken } from '../../input/style'; import { initInputToken } from '../../input/style';
import type { GenerateStyle } from '../../theme'; import type { GenerateStyle } from '../../theme';
import { operationUnit } from '../../theme'; import { operationUnit } from '../../style';
// eslint-disable-next-line import/prefer-default-export // eslint-disable-next-line import/prefer-default-export
const getTitleStyle = ( const getTitleStyle = (

View File

@ -1,10 +1,11 @@
import type { FullToken, GenerateStyle } from '../../theme'; import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook, mergeToken, resetComponent } from '../../theme'; import { genComponentStyleHook, mergeToken } from '../../theme';
import genDraggerStyle from './dragger'; import genDraggerStyle from './dragger';
import genListStyle from './list'; import genListStyle from './list';
import genMotionStyle from './motion'; import genMotionStyle from './motion';
import { genPictureCardStyle, genPictureStyle } from './picture'; import { genPictureCardStyle, genPictureStyle } from './picture';
import genRtlStyle from './rtl'; import genRtlStyle from './rtl';
import { resetComponent } from '../../style';
export interface ComponentToken {} export interface ComponentToken {}

View File

@ -1,6 +1,6 @@
import type { UploadToken } from '.'; import type { UploadToken } from '.';
import type { GenerateStyle } from '../../theme'; import type { GenerateStyle } from '../../theme';
import { clearFix } from '../../theme'; import { clearFix } from '../../style';
const genListStyle: GenerateStyle<UploadToken> = token => { const genListStyle: GenerateStyle<UploadToken> = token => {
const { componentCls, antCls, iconCls, fontSizeBase, lineHeight } = token; const { componentCls, antCls, iconCls, fontSizeBase, lineHeight } = token;

View File

@ -1,7 +1,7 @@
import { TinyColor } from '@ctrl/tinycolor'; import { TinyColor } from '@ctrl/tinycolor';
import type { UploadToken } from '.'; import type { UploadToken } from '.';
import type { GenerateStyle } from '../../theme'; import type { GenerateStyle } from '../../theme';
import { clearFix } from '../../theme'; import { clearFix } from '../../style';
const genPictureStyle: GenerateStyle<UploadToken> = token => { const genPictureStyle: GenerateStyle<UploadToken> = token => {
const { componentCls, iconCls, uploadThumbnailSize, uploadProgressOffset } = token; const { componentCls, iconCls, uploadThumbnailSize, uploadProgressOffset } = token;

View File

@ -19,7 +19,7 @@
.code-box-title { .code-box-title {
&, &,
a { a {
color: @site-text-color; color: @site-text-color !important;
background: @component-background; background: @component-background;
} }
} }

View File

@ -43,7 +43,7 @@ ul.toc > li {
margin-left: -1px; margin-left: -1px;
padding-left: 16px; padding-left: 16px;
overflow: hidden; overflow: hidden;
color: @site-text-color; color: @site-text-color !important;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
border-left: 1px solid transparent; border-left: 1px solid transparent;
@ -60,11 +60,11 @@ ul.toc > li {
} }
.toc a:hover { .toc a:hover {
color: @primary-color; color: @primary-color !important;
} }
.toc a.current { .toc a.current {
color: @primary-color; color: @primary-color !important;
border-color: @primary-color; border-color: @primary-color;
} }

View File

@ -26,6 +26,7 @@
.gh-count { .gh-count {
height: auto; height: auto;
padding: 4px 8px; padding: 4px 8px;
color: #000;
font-weight: normal; font-weight: normal;
background: #fff; background: #fff;