convertLegacyToken.js 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992
  1. import formatToken from './util/alias';
  2. export default function convertLegacyToken(mapToken) {
  3. const token = formatToken(mapToken);
  4. const raw = {
  5. theme: 'default',
  6. 'ant-prefix': 'ant',
  7. 'html-selector': 'html',
  8. // -------- Colors -----------
  9. // >>> Primary
  10. 'primary-color': token.colorPrimary,
  11. 'primary-color-hover': token.colorPrimaryHover,
  12. 'primary-color-active': token.colorPrimaryActive,
  13. 'primary-color-outline': 'fade(@primary-color, @outline-fade)',
  14. 'processing-color': token.colorPrimary,
  15. // >>> Info
  16. 'info-color': token.colorInfo,
  17. 'info-color-deprecated-bg': token.colorInfoBg,
  18. 'info-color-deprecated-border': token.colorInfoBorder,
  19. // >>> Success
  20. 'success-color': token.colorSuccess,
  21. 'success-color-hover': token.colorSuccessBgHover,
  22. 'success-color-active': token.colorSuccessActive,
  23. 'success-color-outline': 'fade(@success-color, @outline-fade)',
  24. 'success-color-deprecated-bg': token.colorSuccessBg,
  25. 'success-color-deprecated-border': token.colorSuccessBorder,
  26. // >>> Warning
  27. 'warning-color': token.colorWarning,
  28. 'warning-color-hover': token.colorWarningHover,
  29. 'warning-color-active': token.colorWarningActive,
  30. 'warning-color-outline': 'fade(@warning-color, @outline-fade)',
  31. 'warning-color-deprecated-bg': token.colorWarningBg,
  32. 'warning-color-deprecated-border': token.colorWarningBorder,
  33. // >>> Error
  34. 'error-color': token.colorError,
  35. 'error-color-hover': token.colorErrorHover,
  36. 'error-color-active': token.colorErrorActive,
  37. 'error-color-outline': 'fade(@error-color, @outline-fade)',
  38. 'error-color-deprecated-bg': token.colorErrorBg,
  39. 'error-color-deprecated-border': token.colorErrorBorder,
  40. 'highlight-color': token.colorHighlight,
  41. 'normal-color': '#d9d9d9',
  42. white: token.colorWhite,
  43. black: '#000',
  44. // Color used by default to control hover and active backgrounds and for
  45. // alert info backgrounds.
  46. 'primary-1': token.colorPrimaryBg,
  47. 'primary-2': token.colorPrimaryBgHover,
  48. 'primary-3': token.colorPrimaryBorder,
  49. 'primary-4': token.colorPrimaryBorderHover,
  50. 'primary-5': token.colorPrimaryHover,
  51. 'primary-6': token.colorPrimary,
  52. 'primary-7': token.colorPrimaryActive,
  53. 'primary-8': token.colorPrimaryTextHover,
  54. 'primary-9': token.colorPrimaryText,
  55. 'primary-10': token.colorPrimaryTextActive,
  56. // Base Scaffolding Variables
  57. // ---
  58. // Background color for `<body>`
  59. 'body-background': token.colorBgBase,
  60. // Base background color for most components
  61. 'component-background': token.colorBgContainer,
  62. // Popover background color
  63. 'popover-background': token.colorBgElevated,
  64. 'popover-customize-border-color': token.colorSplit,
  65. 'font-family': token.fontFamily,
  66. 'code-family': "'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",
  67. 'text-color': token.colorText,
  68. 'text-color-secondary': token.colorTextSecondary,
  69. 'text-color-inverse': token.colorWhite,
  70. 'icon-color': token.colorIcon,
  71. 'icon-color-hover': token.colorIconHover,
  72. 'heading-color': token.colorTextHeading,
  73. 'text-color-dark': 'fade(@white, 85%)',
  74. 'text-color-secondary-dark': 'fade(@white, 65%)',
  75. 'text-selection-bg': token.colorPrimary,
  76. 'font-variant-base': 'tabular-nums',
  77. 'font-feature-settings-base': 'tnum',
  78. 'font-size-base': token.fontSize,
  79. 'font-size-lg': token.fontSizeLG,
  80. 'font-size-sm': token.fontSizeSM,
  81. 'heading-1-size': token.fontSizeHeading1,
  82. 'heading-2-size': token.fontSizeHeading2,
  83. 'heading-3-size': token.fontSizeHeading3,
  84. 'heading-4-size': token.fontSizeHeading4,
  85. 'heading-5-size': token.fontSizeHeading5,
  86. // https://github.com/ant-design/ant-design/issues/20210
  87. 'line-height-base': token.lineHeight,
  88. 'border-radius-base': token.borderRadius,
  89. 'border-radius-sm': token.borderRadiusSM,
  90. // control border
  91. 'control-border-radius': token.borderRadius,
  92. // arrow border
  93. 'arrow-border-radius': token.borderRadiusSM,
  94. // vertical paddings
  95. 'padding-lg': token.paddingLG,
  96. 'padding-md': token.padding,
  97. 'padding-sm': token.paddingSM,
  98. 'padding-xs': token.paddingXS,
  99. 'padding-xss': token.paddingXXS,
  100. // vertical padding for all form controls
  101. 'control-padding-horizontal': token.paddingSM,
  102. 'control-padding-horizontal-sm': token.paddingXS,
  103. // vertical margins
  104. 'margin-lg': token.marginLG,
  105. 'margin-md': token.margin,
  106. 'margin-sm': token.marginSM,
  107. 'margin-xs': token.marginXS,
  108. 'margin-xss': token.marginXXS,
  109. // height rules
  110. 'height-base': token.controlHeight,
  111. 'height-lg': token.controlHeightLG,
  112. 'height-sm': token.controlHeightSM,
  113. // The background colors for active and hover states for things like
  114. // list items or table cells.
  115. 'item-active-bg': token.controlItemBgActive,
  116. 'item-hover-bg': token.controlItemBgHover,
  117. // ICONFONT
  118. 'iconfont-css-prefix': 'anticon',
  119. // LINK
  120. 'link-color': token.colorLink,
  121. 'link-hover-color': token.colorLinkHover,
  122. 'link-active-color': token.colorLinkActive,
  123. 'link-decoration': 'none',
  124. 'link-hover-decoration': 'none',
  125. 'link-focus-decoration': 'none',
  126. 'link-focus-outline': 0,
  127. // Animation
  128. 'ease-base-out': token.motionEaseOut,
  129. 'ease-base-in': 'cubic-bezier(0.9, 0, 0.3, 0.7)',
  130. 'ease-out': token.motionEaseOut,
  131. 'ease-in': 'cubic-bezier(0.55, 0.055, 0.675, 0.19)',
  132. 'ease-in-out': token.motionEaseInOut,
  133. 'ease-out-back': token.motionEaseOutBack,
  134. 'ease-in-back': 'cubic-bezier(0.71, -0.46, 0.88, 0.6)',
  135. 'ease-in-out-back': 'cubic-bezier(0.71, -0.46, 0.29, 1.46)',
  136. 'ease-out-circ': token.motionEaseOutCirc,
  137. 'ease-in-circ': 'cubic-bezier(0.6, 0.04, 0.98, 0.34)',
  138. 'ease-in-out-circ': token.motionEaseInOutCirc,
  139. 'ease-out-quint': token.motionEaseOutQuint,
  140. 'ease-in-quint': token.motionEaseInQuint,
  141. 'ease-in-out-quint': 'cubic-bezier(0.86, 0, 0.07, 1)',
  142. // Border color
  143. 'border-color-base': token.colorBorder,
  144. 'border-color-split': token.colorSplit,
  145. 'border-color-inverse': token.colorWhite,
  146. 'border-width-base': token.lineWidth,
  147. 'border-style-base': 'solid',
  148. // Outline
  149. 'outline-blur-size': 0,
  150. 'outline-width': token.controlOutlineWidth,
  151. 'outline-color': token.controlOutline,
  152. 'outline-fade': '20%',
  153. 'background-color-light': 'hsv(0, 0, 98%)',
  154. 'background-color-base': 'hsv(0, 0, 96%)',
  155. // Disabled states
  156. 'disabled-color': token.colorTextDisabled,
  157. 'disabled-bg': token.colorBgContainerDisabled,
  158. 'disabled-active-bg': token.colorBgContainerDisabled,
  159. 'disabled-color-dark': 'fade(#fff, 35%)',
  160. // Shadow
  161. 'shadow-color': 'rgba(0, 0, 0, 0.15)',
  162. 'shadow-color-inverse': token.colorBgContainer,
  163. 'box-shadow-base': token.boxShadow,
  164. 'shadow-1-up': token.boxShadowDrawerUp,
  165. 'shadow-1-down': token.boxShadowDrawerDown,
  166. 'shadow-1-left': token.boxShadowDrawerLeft,
  167. 'shadow-1-right': token.boxShadowDrawerRight,
  168. 'shadow-2': token.boxShadowSecondary,
  169. // ==========================================================================
  170. // == Components ==
  171. // ==========================================================================
  172. // Buttons
  173. 'btn-font-weight': '400',
  174. 'btn-border-radius-base': '@border-radius-base',
  175. 'btn-border-radius-sm': '@border-radius-base',
  176. 'btn-border-width': '@border-width-base',
  177. 'btn-border-style': '@border-style-base',
  178. 'btn-shadow': '0 2px 0 rgba(0, 0, 0, 0.015)',
  179. 'btn-primary-shadow': '0 2px 0 rgba(0, 0, 0, 0.045)',
  180. 'btn-text-shadow': '0 -1px 0 rgba(0, 0, 0, 0.12)',
  181. 'btn-primary-color': '#fff',
  182. 'btn-primary-bg': '@primary-color',
  183. 'btn-default-color': '@text-color',
  184. 'btn-default-bg': '@component-background',
  185. 'btn-default-border': '@border-color-base',
  186. 'btn-danger-color': '#fff',
  187. 'btn-danger-bg': '@error-color',
  188. 'btn-danger-border': '@error-color',
  189. 'btn-disable-color': '@disabled-color',
  190. 'btn-disable-bg': '@disabled-bg',
  191. 'btn-disable-border': '@border-color-base',
  192. 'btn-default-ghost-color': '@component-background',
  193. 'btn-default-ghost-bg': 'transparent',
  194. 'btn-default-ghost-border': '@component-background',
  195. 'btn-font-size-lg': '@font-size-lg',
  196. 'btn-font-size-sm': '@font-size-base',
  197. 'btn-padding-horizontal-base': '@padding-md - 1px',
  198. 'btn-padding-horizontal-lg': '@btn-padding-horizontal-base',
  199. 'btn-padding-horizontal-sm': '@padding-xs - 1px',
  200. 'btn-height-base': '@height-base',
  201. 'btn-height-lg': '@height-lg',
  202. 'btn-height-sm': '@height-sm',
  203. 'btn-line-height': '@line-height-base',
  204. 'btn-circle-size': '@btn-height-base',
  205. 'btn-circle-size-lg': '@btn-height-lg',
  206. 'btn-circle-size-sm': '@btn-height-sm',
  207. 'btn-square-size': '@btn-height-base',
  208. 'btn-square-size-lg': '@btn-height-lg',
  209. 'btn-square-size-sm': '@btn-height-sm',
  210. 'btn-square-only-icon-size': '@font-size-base + 2px',
  211. 'btn-square-only-icon-size-sm': '@font-size-base',
  212. 'btn-square-only-icon-size-lg': '@btn-font-size-lg + 2px',
  213. 'btn-group-border': '@primary-5',
  214. 'btn-link-hover-bg': 'transparent',
  215. 'btn-text-hover-bg': 'rgba(0, 0, 0, 0.018)',
  216. // Checkbox
  217. 'checkbox-size': '16px',
  218. 'checkbox-color': '@primary-color',
  219. 'checkbox-check-color': '#fff',
  220. 'checkbox-check-bg': '@checkbox-check-color',
  221. 'checkbox-border-width': '@border-width-base',
  222. 'checkbox-border-radius': '@border-radius-base',
  223. 'checkbox-group-item-margin-right': '8px',
  224. // Descriptions
  225. 'descriptions-bg': '#fafafa',
  226. 'descriptions-title-margin-bottom': '20px',
  227. 'descriptions-default-padding': '@padding-md @padding-lg',
  228. 'descriptions-middle-padding': '@padding-sm @padding-lg',
  229. 'descriptions-small-padding': '@padding-xs @padding-md',
  230. 'descriptions-item-padding-bottom': '@padding-md',
  231. 'descriptions-item-trailing-colon': 'true',
  232. 'descriptions-item-label-colon-margin-right': '8px',
  233. 'descriptions-item-label-colon-margin-left': '2px',
  234. 'descriptions-extra-color': '@text-color',
  235. // Divider
  236. 'divider-text-padding': '1em',
  237. 'divider-orientation-margin': '5%',
  238. 'divider-color': 'rgba(0, 0, 0, 6%)',
  239. 'divider-vertical-gutter': '8px',
  240. // Dropdown
  241. 'dropdown-selected-color': '@primary-color',
  242. 'dropdown-menu-submenu-disabled-bg': '@component-background',
  243. 'dropdown-selected-bg': '@item-active-bg',
  244. // Empty
  245. 'empty-font-size': '@font-size-base',
  246. // Radio
  247. 'radio-size': '16px',
  248. 'radio-top': '0.2em',
  249. 'radio-border-width': '1px',
  250. 'radio-dot-size': '@radio-size - 8px',
  251. 'radio-dot-color': '@primary-color',
  252. 'radio-dot-disabled-color': 'fade(@black, 20%)',
  253. 'radio-solid-checked-color': '@component-background',
  254. // Radio buttons
  255. 'radio-button-bg': '@btn-default-bg',
  256. 'radio-button-checked-bg': '@btn-default-bg',
  257. 'radio-button-color': '@btn-default-color',
  258. 'radio-button-hover-color': '@primary-5',
  259. 'radio-button-active-color': '@primary-7',
  260. 'radio-button-padding-horizontal': '@padding-md - 1px',
  261. 'radio-disabled-button-checked-bg': '@disabled-active-bg',
  262. 'radio-disabled-button-checked-color': '@disabled-color',
  263. 'radio-wrapper-margin-right': '8px',
  264. // Media queries breakpoints
  265. // @screen-xs and @screen-xs-min is not used in Grid
  266. // smallest break point is @screen-md
  267. 'screen-xs': '480px',
  268. 'screen-xs-min': '@screen-xs',
  269. // 👆 Extra small screen / phone
  270. // 👇 Small screen / tablet
  271. 'screen-sm': '576px',
  272. 'screen-sm-min': '@screen-sm',
  273. // Medium screen / desktop
  274. 'screen-md': '768px',
  275. 'screen-md-min': '@screen-md',
  276. // Large screen / wide desktop
  277. 'screen-lg': '992px',
  278. 'screen-lg-min': '@screen-lg',
  279. // Extra large screen / full hd
  280. 'screen-xl': '1200px',
  281. 'screen-xl-min': '@screen-xl',
  282. // Extra extra large screen / large desktop
  283. 'screen-xxl': '1600px',
  284. 'screen-xxl-min': '@screen-xxl',
  285. // provide a maximum
  286. 'screen-xs-max': '(@screen-sm-min - 1px)',
  287. 'screen-sm-max': '(@screen-md-min - 1px)',
  288. 'screen-md-max': '(@screen-lg-min - 1px)',
  289. 'screen-lg-max': '(@screen-xl-min - 1px)',
  290. 'screen-xl-max': '(@screen-xxl-min - 1px)',
  291. // Grid system
  292. 'grid-columns': '24',
  293. // Layout
  294. 'layout-body-background': '#f0f2f5',
  295. 'layout-header-background': '#001529',
  296. 'layout-header-height': '64px',
  297. 'layout-header-padding': '0 50px',
  298. 'layout-header-color': '@text-color',
  299. 'layout-footer-padding': '24px 50px',
  300. 'layout-footer-background': '@layout-body-background',
  301. 'layout-sider-background': '@layout-header-background',
  302. 'layout-trigger-height': '48px',
  303. 'layout-trigger-background': '#002140',
  304. 'layout-trigger-color': '#fff',
  305. 'layout-zero-trigger-width': '36px',
  306. 'layout-zero-trigger-height': '42px',
  307. // Layout light theme
  308. 'layout-sider-background-light': '#fff',
  309. 'layout-trigger-background-light': '#fff',
  310. 'layout-trigger-color-light': '@text-color',
  311. // z-index list, order by `z-index`
  312. 'zindex-badge': 'auto',
  313. 'zindex-table-fixed': '2',
  314. 'zindex-affix': '10',
  315. 'zindex-back-top': '10',
  316. 'zindex-picker-panel': '10',
  317. 'zindex-popup-close': '10',
  318. 'zindex-modal': '1000',
  319. 'zindex-modal-mask': '1000',
  320. 'zindex-message': '1010',
  321. 'zindex-notification': '1010',
  322. 'zindex-popover': '1030',
  323. 'zindex-dropdown': '1050',
  324. 'zindex-picker': '1050',
  325. 'zindex-popoconfirm': '1060',
  326. 'zindex-tooltip': '1070',
  327. 'zindex-image': '1080',
  328. // Animation
  329. 'animation-duration-slow': '0.3s',
  330. 'animation-duration-base': '0.2s',
  331. 'animation-duration-fast': '0.1s',
  332. //CollapsePanel
  333. 'collapse-panel-border-radius': '@border-radius-base',
  334. //Dropdown
  335. 'dropdown-menu-bg': '@component-background',
  336. 'dropdown-vertical-padding': '5px',
  337. 'dropdown-edge-child-vertical-padding': '4px',
  338. 'dropdown-font-size': '@font-size-base',
  339. 'dropdown-line-height': '22px',
  340. // Form
  341. // ---
  342. 'label-required-color': '@highlight-color',
  343. 'label-color': '@heading-color',
  344. 'form-warning-input-bg': '@input-bg',
  345. 'form-item-margin-bottom': '24px',
  346. 'form-item-trailing-colon': 'true',
  347. 'form-vertical-label-padding': '0 0 8px',
  348. 'form-vertical-label-margin': '0',
  349. 'form-item-label-font-size': '@font-size-base',
  350. 'form-item-label-height': '@input-height-base',
  351. 'form-item-label-colon-margin-right': '8px',
  352. 'form-item-label-colon-margin-left': '2px',
  353. 'form-error-input-bg': '@input-bg',
  354. // Input
  355. // ---
  356. 'input-height-base': '@height-base',
  357. 'input-height-lg': '@height-lg',
  358. 'input-height-sm': '@height-sm',
  359. 'input-padding-horizontal': '@control-padding-horizontal - 1px',
  360. 'input-padding-horizontal-base': '@input-padding-horizontal',
  361. 'input-padding-horizontal-sm': '@control-padding-horizontal-sm - 1px',
  362. 'input-padding-horizontal-lg': '@input-padding-horizontal',
  363. 'input-padding-vertical-base': `max(
  364. (round(((@input-height-base - @font-size-base * @line-height-base) / 2) * 10) / 10) -
  365. @border-width-base,
  366. 3px
  367. )`,
  368. 'input-padding-vertical-sm': `max(
  369. (round(((@input-height-sm - @font-size-base * @line-height-base) / 2) * 10) / 10) -
  370. @border-width-base,
  371. 0
  372. )`,
  373. 'input-padding-vertical-lg': `(
  374. ceil(((@input-height-lg - @font-size-lg * @line-height-base) / 2) * 10) / 10
  375. ) - @border-width-base`,
  376. 'input-placeholder-color': 'hsv(0, 0, 75%)',
  377. 'input-color': '@text-color',
  378. 'input-icon-color': '@input-color',
  379. 'input-border-color': '@border-color-base',
  380. 'input-bg': '@component-background',
  381. 'input-number-hover-border-color': '@input-hover-border-color',
  382. 'input-number-handler-active-bg': '#f4f4f4',
  383. 'input-number-handler-hover-bg': '@primary-5',
  384. 'input-number-handler-bg': '@component-background',
  385. 'input-number-handler-border-color': '@border-color-base',
  386. 'input-addon-bg': '@background-color-light',
  387. 'input-hover-border-color': '@primary-5',
  388. 'input-disabled-bg': '@disabled-bg',
  389. 'input-outline-offset': '0 0',
  390. 'input-icon-hover-color': 'fade(@black, 85%)',
  391. 'input-disabled-color': '@disabled-color',
  392. // Mentions
  393. // ---
  394. 'mentions-dropdown-bg': '@component-background',
  395. 'mentions-dropdown-menu-item-hover-bg': '@mentions-dropdown-bg',
  396. // Select
  397. // ---
  398. 'select-border-color': '@border-color-base',
  399. 'select-item-selected-color': '@text-color',
  400. 'select-item-selected-font-weight': '600',
  401. 'select-dropdown-bg': '@component-background',
  402. 'select-item-selected-bg': '@primary-1',
  403. 'select-item-active-bg': '@item-hover-bg',
  404. 'select-dropdown-vertical-padding': '@dropdown-vertical-padding',
  405. 'select-dropdown-font-size': '@dropdown-font-size',
  406. 'select-dropdown-line-height': '@dropdown-line-height',
  407. 'select-dropdown-height': '32px',
  408. 'select-background': '@component-background',
  409. 'select-clear-background': '@select-background',
  410. 'select-selection-item-bg': '@background-color-base',
  411. 'select-selection-item-border-color': '@border-color-split',
  412. 'select-single-item-height-lg': '40px',
  413. 'select-multiple-item-height': '@input-height-base - @input-padding-vertical-base * 2',
  414. 'select-multiple-item-height-lg': '32px',
  415. 'select-multiple-item-spacing-half': 'ceil((@input-padding-vertical-base / 2))',
  416. 'select-multiple-disabled-background': '@input-disabled-bg',
  417. 'select-multiple-item-disabled-color': '#bfbfbf',
  418. 'select-multiple-item-disabled-border-color': '@select-border-color',
  419. // Cascader
  420. // ---
  421. 'cascader-bg': '@component-background',
  422. 'cascader-item-selected-bg': '@primary-1',
  423. 'cascader-menu-bg': '@component-background',
  424. 'cascader-menu-border-color-split': '@border-color-split',
  425. // Cascader
  426. // ----
  427. 'cascader-dropdown-vertical-padding': '@dropdown-vertical-padding',
  428. 'cascader-dropdown-edge-child-vertical-padding': '@dropdown-edge-child-vertical-padding',
  429. 'cascader-dropdown-font-size': '@dropdown-font-size',
  430. 'cascader-dropdown-line-height': '@dropdown-line-height',
  431. // Anchor
  432. // ---
  433. 'anchor-bg': 'transparent',
  434. 'anchor-border-color': '@border-color-split',
  435. 'anchor-link-top': '4px',
  436. 'anchor-link-left': '16px',
  437. 'anchor-link-padding': '@anchor-link-top 0 @anchor-link-top @anchor-link-left',
  438. // Tooltip
  439. // ---
  440. // Tooltip max width
  441. 'tooltip-max-width': '250px',
  442. // Tooltip text color
  443. 'tooltip-color': '#fff',
  444. // Tooltip background color
  445. 'tooltip-bg': 'rgba(0, 0, 0, 0.75)',
  446. // Tooltip arrow width
  447. 'tooltip-arrow-width': '8px * sqrt(2)',
  448. // Tooltip distance with trigger
  449. 'tooltip-distance': '@tooltip-arrow-width - 1px + 4px',
  450. // Tooltip arrow color
  451. 'tooltip-arrow-color': '@tooltip-bg',
  452. 'tooltip-border-radius': '@border-radius-base',
  453. // Popover
  454. // ---
  455. // Popover body background color
  456. 'popover-bg': '@component-background',
  457. // Popover text color
  458. 'popover-color': '@text-color',
  459. // Popover maximum width
  460. 'popover-min-width': '177px',
  461. 'popover-min-height': '32px',
  462. // Popover arrow width
  463. 'popover-arrow-width': '@tooltip-arrow-width',
  464. // Popover arrow color
  465. 'popover-arrow-color': '@popover-bg',
  466. // Popover outer arrow width
  467. // Popover outer arrow color
  468. 'popover-arrow-outer-color': '@popover-bg',
  469. // Popover distance with trigger
  470. 'popover-distance': '@popover-arrow-width + 4px',
  471. 'popover-padding-horizontal': '@padding-md',
  472. // Modal
  473. // --
  474. 'modal-header-padding-vertical': '@padding-md',
  475. 'modal-header-padding-horizontal': '@padding-lg',
  476. 'modal-body-padding': '@padding-lg',
  477. 'modal-header-bg': '@component-background',
  478. 'modal-header-padding': '@modal-header-padding-vertical @modal-header-padding-horizontal',
  479. 'modal-header-border-width': '@border-width-base',
  480. 'modal-header-border-style': '@border-style-base',
  481. 'modal-header-title-line-height': '22px',
  482. 'modal-header-title-font-size': '@font-size-lg',
  483. 'modal-header-border-color-split': '@border-color-split',
  484. 'modal-header-close-size': '@modal-header-title-line-height + 2 * @modal-header-padding-vertical',
  485. 'modal-content-bg': '@component-background',
  486. 'modal-heading-color': '@heading-color',
  487. 'modal-close-color': '@text-color-secondary',
  488. 'modal-footer-bg': 'transparent',
  489. 'modal-footer-border-color-split': '@border-color-split',
  490. 'modal-footer-border-style': '@border-style-base',
  491. 'modal-footer-padding-vertical': '10px',
  492. 'modal-footer-padding-horizontal': '16px',
  493. 'modal-footer-border-width': '@border-width-base',
  494. 'modal-mask-bg': 'fade(@black, 45%)',
  495. 'modal-confirm-body-padding': '32px 32px 24px',
  496. 'modal-confirm-title-font-size': '@font-size-lg',
  497. 'modal-border-radius': '@border-radius-base',
  498. // Progress
  499. // --
  500. 'progress-default-color': '@processing-color',
  501. 'progress-remaining-color': '@background-color-base',
  502. 'progress-info-text-color': '@progress-text-color',
  503. 'progress-radius': '100px',
  504. 'progress-steps-item-bg': '#f3f3f3',
  505. 'progress-text-font-size': '1em',
  506. 'progress-text-color': '@text-color',
  507. 'progress-circle-text-font-size': '1em',
  508. // Menu
  509. // ---
  510. 'menu-inline-toplevel-item-height': '40px',
  511. 'menu-item-height': '40px',
  512. 'menu-item-group-height': '@line-height-base',
  513. 'menu-collapsed-width': '80px',
  514. 'menu-bg': '@component-background',
  515. 'menu-popup-bg': '@component-background',
  516. 'menu-item-color': '@text-color',
  517. 'menu-inline-submenu-bg': '@background-color-light',
  518. 'menu-highlight-color': '@primary-color',
  519. 'menu-highlight-danger-color': '@error-color',
  520. 'menu-item-active-bg': '@primary-1',
  521. 'menu-item-active-danger-bg': '@red-1',
  522. 'menu-item-active-border-width': '3px',
  523. 'menu-item-group-title-color': '@text-color-secondary',
  524. 'menu-item-vertical-margin': '4px',
  525. 'menu-item-font-size': '@font-size-base',
  526. 'menu-item-boundary-margin': '8px',
  527. 'menu-item-padding-horizontal': '20px',
  528. 'menu-item-padding': '0 @menu-item-padding-horizontal',
  529. 'menu-horizontal-line-height': '46px',
  530. 'menu-icon-margin-right': '10px',
  531. 'menu-icon-size': '@menu-item-font-size',
  532. 'menu-icon-size-lg': '@font-size-lg',
  533. 'menu-item-group-title-font-size': '@menu-item-font-size',
  534. // dark theme
  535. 'menu-dark-color': '@text-color-secondary-dark',
  536. 'menu-dark-danger-color': '@error-color',
  537. 'menu-dark-bg': '@layout-header-background',
  538. 'menu-dark-arrow-color': '#fff',
  539. 'menu-dark-inline-submenu-bg': '#000c17',
  540. 'menu-dark-highlight-color': '#fff',
  541. 'menu-dark-item-active-bg': '@primary-color',
  542. 'menu-dark-item-active-danger-bg': '@error-color',
  543. 'menu-dark-selected-item-icon-color': '@white',
  544. 'menu-dark-selected-item-text-color': '@white',
  545. 'menu-dark-item-hover-bg': 'transparent',
  546. // Spin
  547. // ---
  548. 'spin-dot-size-sm': '14px',
  549. 'spin-dot-size': '20px',
  550. 'spin-dot-size-lg': '32px',
  551. // Table
  552. // --
  553. 'table-bg': '@component-background',
  554. 'table-header-bg': '@background-color-light',
  555. 'table-header-color': '@heading-color',
  556. 'table-header-sort-bg': '@background-color-base',
  557. 'table-body-sort-bg': '#fafafa',
  558. 'table-row-hover-bg': '@background-color-light',
  559. 'table-selected-row-color': 'inherit',
  560. 'table-selected-row-bg': '@primary-1',
  561. 'table-body-selected-sort-bg': '@table-selected-row-bg',
  562. 'table-selected-row-hover-bg': 'darken(@table-selected-row-bg, 2%)',
  563. 'table-expanded-row-bg': '#fbfbfb',
  564. 'table-padding-vertical': '16px',
  565. 'table-padding-horizontal': '16px',
  566. 'table-padding-vertical-md': '(@table-padding-vertical * 3 / 4)',
  567. 'table-padding-horizontal-md': '(@table-padding-horizontal / 2)',
  568. 'table-padding-vertical-sm': '(@table-padding-vertical / 2)',
  569. 'table-padding-horizontal-sm': '(@table-padding-horizontal / 2)',
  570. 'table-border-color': '@border-color-split',
  571. 'table-border-radius-base': '@border-radius-base',
  572. 'table-footer-bg': '@background-color-light',
  573. 'table-footer-color': '@heading-color',
  574. 'table-header-bg-sm': '@table-header-bg',
  575. 'table-font-size': '@font-size-base',
  576. 'table-font-size-md': '@table-font-size',
  577. 'table-font-size-sm': '@table-font-size',
  578. 'table-header-cell-split-color': 'rgba(0, 0, 0, 0.06)',
  579. // Sorter
  580. // Legacy: `table-header-sort-active-bg` is used for hover not real active
  581. 'table-header-sort-active-bg': 'rgba(0, 0, 0, 0.04)',
  582. 'table-fixed-header-sort-active-bg': 'hsv(0, 0, 96%)',
  583. // Filter
  584. 'table-header-filter-active-bg': 'rgba(0, 0, 0, 0.04)',
  585. 'table-filter-btns-bg': 'inherit',
  586. 'table-filter-dropdown-bg': '@component-background',
  587. 'table-expand-icon-bg': '@component-background',
  588. 'table-selection-column-width': '32px',
  589. // Sticky
  590. 'table-sticky-scroll-bar-bg': 'fade(#000, 35%)',
  591. 'table-sticky-scroll-bar-radius': '4px',
  592. // Tag
  593. // --
  594. 'tag-border-radius': '@border-radius-base',
  595. 'tag-default-bg': '@background-color-light',
  596. 'tag-default-color': '@text-color',
  597. 'tag-font-size': '@font-size-sm',
  598. 'tag-line-height': '20px',
  599. // TimePicker
  600. // ---
  601. 'picker-bg': '@component-background',
  602. 'picker-basic-cell-hover-color': '@item-hover-bg',
  603. 'picker-basic-cell-active-with-range-color': '@primary-1',
  604. 'picker-basic-cell-hover-with-range-color': 'lighten(@primary-color, 35%)',
  605. 'picker-basic-cell-disabled-bg': 'rgba(0, 0, 0, 0.04)',
  606. 'picker-border-color': '@border-color-split',
  607. 'picker-date-hover-range-border-color': 'lighten(@primary-color, 20%)',
  608. 'picker-date-hover-range-color': '@picker-basic-cell-hover-with-range-color',
  609. 'picker-time-panel-column-width': '56px',
  610. 'picker-time-panel-column-height': '224px',
  611. 'picker-time-panel-cell-height': '28px',
  612. 'picker-panel-cell-height': '24px',
  613. 'picker-panel-cell-width': '36px',
  614. 'picker-text-height': '40px',
  615. 'picker-panel-without-time-cell-height': '66px',
  616. // Calendar
  617. // ---
  618. 'calendar-bg': '@component-background',
  619. 'calendar-input-bg': '@input-bg',
  620. 'calendar-border-color': '@border-color-inverse',
  621. 'calendar-item-active-bg': '@item-active-bg',
  622. 'calendar-column-active-bg': 'fade(@calendar-item-active-bg, 20%)',
  623. 'calendar-full-bg': '@calendar-bg',
  624. 'calendar-full-panel-bg': '@calendar-full-bg',
  625. // Carousel
  626. // ---
  627. 'carousel-dot-width': '16px',
  628. 'carousel-dot-height': '3px',
  629. 'carousel-dot-active-width': '24px',
  630. // Badge
  631. // ---
  632. 'badge-height': '20px',
  633. 'badge-height-sm': '14px',
  634. 'badge-dot-size': '6px',
  635. 'badge-font-size': '@font-size-sm',
  636. 'badge-font-size-sm': '@font-size-sm',
  637. 'badge-font-weight': 'normal',
  638. 'badge-status-size': '6px',
  639. 'badge-text-color': '@component-background',
  640. 'badge-color': '@highlight-color',
  641. // Rate
  642. // ---
  643. 'rate-star-color': '@yellow-6',
  644. 'rate-star-bg': '@border-color-split',
  645. 'rate-star-size': '20px',
  646. 'rate-star-hover-scale': 'scale(1.1)',
  647. // Card
  648. // ---
  649. 'card-head-color': '@heading-color',
  650. 'card-head-background': 'transparent',
  651. 'card-head-font-size': '@font-size-lg',
  652. 'card-head-font-size-sm': '@font-size-base',
  653. 'card-head-padding': '16px',
  654. 'card-head-padding-sm': '(@card-head-padding / 2)',
  655. 'card-head-height': '48px',
  656. 'card-head-height-sm': '36px',
  657. 'card-inner-head-padding': '12px',
  658. 'card-padding-base': '24px',
  659. 'card-padding-base-sm': '(@card-padding-base / 2)',
  660. 'card-actions-background': '@component-background',
  661. 'card-actions-li-margin': '12px 0',
  662. 'card-skeleton-bg': '#cfd8dc',
  663. 'card-background': '@component-background',
  664. 'card-shadow': `0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12),
  665. 0 5px 12px 4px rgba(0, 0, 0, 0.09)`,
  666. 'card-radius': '@border-radius-base',
  667. 'card-head-tabs-margin-bottom': '-17px',
  668. 'card-head-extra-color': '@text-color',
  669. // Comment
  670. // ---
  671. 'comment-bg': 'inherit',
  672. 'comment-padding-base': '@padding-md 0',
  673. 'comment-nest-indent': '44px',
  674. 'comment-font-size-base': '@font-size-base',
  675. 'comment-font-size-sm': '@font-size-sm',
  676. 'comment-author-name-color': '@text-color-secondary',
  677. 'comment-author-time-color': '#ccc',
  678. 'comment-action-color': '@text-color-secondary',
  679. 'comment-action-hover-color': '#595959',
  680. 'comment-actions-margin-bottom': 'inherit',
  681. 'comment-actions-margin-top': '@margin-sm',
  682. 'comment-content-detail-p-margin-bottom': 'inherit',
  683. // Tabs
  684. // ---
  685. 'tabs-card-head-background': '@background-color-light',
  686. 'tabs-card-height': '40px',
  687. 'tabs-card-active-color': '@primary-color',
  688. 'tabs-card-horizontal-padding': `(
  689. (@tabs-card-height - floor(@font-size-base * @line-height-base)) / 2
  690. ) - @border-width-base @padding-md`,
  691. 'tabs-card-horizontal-padding-sm': '6px @padding-md',
  692. 'tabs-card-horizontal-padding-lg': '7px @padding-md 6px',
  693. 'tabs-title-font-size': '@font-size-base',
  694. 'tabs-title-font-size-lg': '@font-size-lg',
  695. 'tabs-title-font-size-sm': '@font-size-base',
  696. 'tabs-ink-bar-color': '@primary-color',
  697. 'tabs-bar-margin': '0 0 @margin-md 0',
  698. 'tabs-horizontal-gutter': '32px',
  699. 'tabs-horizontal-margin': '0 0 0 @tabs-horizontal-gutter',
  700. 'tabs-horizontal-margin-rtl': '0 0 0 32px',
  701. 'tabs-horizontal-padding': '@padding-sm 0',
  702. 'tabs-horizontal-padding-lg': '@padding-md 0',
  703. 'tabs-horizontal-padding-sm': '@padding-xs 0',
  704. 'tabs-vertical-padding': '@padding-xs @padding-lg',
  705. 'tabs-vertical-margin': '@margin-md 0 0 0',
  706. 'tabs-scrolling-size': '32px',
  707. 'tabs-highlight-color': '@primary-color',
  708. 'tabs-hover-color': '@primary-5',
  709. 'tabs-active-color': '@primary-7',
  710. 'tabs-card-gutter': '2px',
  711. 'tabs-card-tab-active-border-top': '2px solid transparent',
  712. // BackTop
  713. // ---
  714. 'back-top-color': '#fff',
  715. 'back-top-bg': '@text-color-secondary',
  716. 'back-top-hover-bg': '@text-color',
  717. // Avatar
  718. // ---
  719. 'avatar-size-base': '32px',
  720. 'avatar-size-lg': '40px',
  721. 'avatar-size-sm': '24px',
  722. 'avatar-font-size-base': '18px',
  723. 'avatar-font-size-lg': '24px',
  724. 'avatar-font-size-sm': '14px',
  725. 'avatar-bg': '#ccc',
  726. 'avatar-color': '#fff',
  727. 'avatar-border-radius': '@border-radius-base',
  728. 'avatar-group-overlapping': '-8px',
  729. 'avatar-group-space': '3px',
  730. 'avatar-group-border-color': '#fff',
  731. // Switch
  732. // ---
  733. 'switch-height': '22px',
  734. 'switch-sm-height': '16px',
  735. 'switch-min-width': '44px',
  736. 'switch-sm-min-width': '28px',
  737. 'switch-disabled-opacity': '0.4',
  738. 'switch-color': '@primary-color',
  739. 'switch-bg': '@component-background',
  740. 'switch-shadow-color': 'fade(#00230b, 20%)',
  741. 'switch-padding': '2px',
  742. 'switch-inner-margin-min': 'ceil(@switch-height * 0.3)',
  743. 'switch-inner-margin-max': 'ceil(@switch-height * 1.1)',
  744. 'switch-sm-inner-margin-min': 'ceil(@switch-sm-height * 0.3)',
  745. 'switch-sm-inner-margin-max': 'ceil(@switch-sm-height * 1.1)',
  746. // Pagination
  747. // ---
  748. 'pagination-item-bg': '@component-background',
  749. 'pagination-item-size': '@height-base',
  750. 'pagination-item-size-sm': '24px',
  751. 'pagination-font-family': '@font-family',
  752. 'pagination-font-weight-active': '500',
  753. 'pagination-item-bg-active': '@component-background',
  754. 'pagination-item-link-bg': '@component-background',
  755. 'pagination-item-disabled-color-active': '@disabled-color',
  756. 'pagination-item-disabled-bg-active': '@disabled-active-bg',
  757. 'pagination-item-input-bg': '@component-background',
  758. 'pagination-mini-options-size-changer-top': '0px',
  759. // PageHeader
  760. // ---
  761. 'page-header-padding': '@padding-lg',
  762. 'page-header-padding-vertical': '@padding-md',
  763. 'page-header-padding-breadcrumb': '@padding-sm',
  764. 'page-header-content-padding-vertical': '@padding-sm',
  765. 'page-header-back-color': '#000',
  766. 'page-header-ghost-bg': 'inherit',
  767. 'page-header-heading-title': '@heading-4-size',
  768. 'page-header-heading-sub-title': '14px',
  769. 'page-header-tabs-tab-font-size': '16px',
  770. // Breadcrumb
  771. // ---
  772. 'breadcrumb-base-color': '@text-color-secondary',
  773. 'breadcrumb-last-item-color': '@text-color',
  774. 'breadcrumb-font-size': '@font-size-base',
  775. 'breadcrumb-icon-font-size': '@font-size-base',
  776. 'breadcrumb-link-color': '@text-color-secondary',
  777. 'breadcrumb-link-color-hover': '@text-color',
  778. 'breadcrumb-separator-color': '@text-color-secondary',
  779. 'breadcrumb-separator-margin': '0 @padding-xs',
  780. // Slider
  781. // ---
  782. 'slider-margin': '10px 6px 10px',
  783. 'slider-rail-background-color': '@background-color-base',
  784. 'slider-rail-background-color-hover': '#e1e1e1',
  785. 'slider-track-background-color': '@primary-3',
  786. 'slider-track-background-color-hover': '@primary-4',
  787. 'slider-handle-border-width': '2px',
  788. 'slider-handle-background-color': '@component-background',
  789. 'slider-handle-color': '@primary-3',
  790. 'slider-handle-color-hover': '@primary-4',
  791. 'slider-handle-color-focus': 'tint(@primary-color, 20%)',
  792. 'slider-handle-color-focus-shadow': 'fade(@primary-color, 12%)',
  793. 'slider-handle-color-tooltip-open': '@primary-color',
  794. 'slider-handle-size': '14px',
  795. 'slider-handle-margin-top': '-5px',
  796. 'slider-handle-margin-left': '-5px',
  797. 'slider-handle-shadow': '0',
  798. 'slider-dot-border-color': '@border-color-split',
  799. 'slider-dot-border-color-active': 'tint(@primary-color, 50%)',
  800. 'slider-disabled-color': '@disabled-color',
  801. 'slider-disabled-background-color': '@component-background',
  802. // Tree
  803. // ---
  804. 'tree-bg': '@component-background',
  805. 'tree-title-height': '24px',
  806. 'tree-child-padding': '18px',
  807. 'tree-directory-selected-color': '#fff',
  808. 'tree-directory-selected-bg': '@primary-color',
  809. 'tree-node-hover-bg': '@item-hover-bg',
  810. 'tree-node-selected-bg': '@primary-2',
  811. // Collapse
  812. // ---
  813. 'collapse-header-padding': '@padding-sm @padding-md',
  814. 'collapse-header-padding-extra': '40px',
  815. 'collapse-header-bg': '@background-color-light',
  816. 'collapse-content-padding': '@padding-md',
  817. 'collapse-content-bg': '@component-background',
  818. 'collapse-header-arrow-left': '16px',
  819. // Skeleton
  820. // ---
  821. 'skeleton-color': 'rgba(190, 190, 190, 0.2)',
  822. 'skeleton-to-color': 'shade(@skeleton-color, 5%)',
  823. 'skeleton-paragraph-margin-top': '28px',
  824. 'skeleton-paragraph-li-margin-top': '@margin-md',
  825. 'skeleton-paragraph-li-height': '16px',
  826. 'skeleton-title-height': '16px',
  827. 'skeleton-title-paragraph-margin-top': '@margin-lg',
  828. // Transfer
  829. // ---
  830. 'transfer-header-height': '40px',
  831. 'transfer-item-height': '@height-base',
  832. 'transfer-disabled-bg': '@disabled-bg',
  833. 'transfer-list-height': '200px',
  834. 'transfer-item-hover-bg': '@item-hover-bg',
  835. 'transfer-item-selected-hover-bg': 'darken(@item-active-bg, 2%)',
  836. 'transfer-item-padding-vertical': '6px',
  837. 'transfer-list-search-icon-top': '12px',
  838. // Message
  839. // ---
  840. 'message-notice-content-padding': '10px 16px',
  841. 'message-notice-content-bg': '@component-background',
  842. // Motion
  843. // ---
  844. 'wave-animation-width': '6px',
  845. // Alert
  846. // ---
  847. 'alert-success-border-color': token.colorSuccessBorder,
  848. 'alert-success-bg-color': token.colorSuccessBg,
  849. 'alert-success-icon-color': token.colorSuccess,
  850. 'alert-info-border-color': token.colorInfoBorder,
  851. 'alert-info-bg-color': token.colorInfoBg,
  852. 'alert-info-icon-color': token.colorInfo,
  853. 'alert-warning-border-color': token.colorWarningBorder,
  854. 'alert-warning-bg-color': token.colorWarningBg,
  855. 'alert-warning-icon-color': token.colorWarning,
  856. 'alert-error-border-color': token.colorErrorBorder,
  857. 'alert-error-bg-color': token.colorErrorBg,
  858. 'alert-error-icon-color': '@error-color',
  859. 'alert-message-color': '@heading-color',
  860. 'alert-text-color': '@text-color',
  861. 'alert-close-color': '@text-color-secondary',
  862. 'alert-close-hover-color': '@icon-color-hover',
  863. 'alert-padding-vertical': '@padding-xs',
  864. 'alert-padding-horizontal': '@padding-md - 1px',
  865. 'alert-no-icon-padding-vertical': '@padding-xs',
  866. 'alert-with-description-no-icon-padding-vertical': '@padding-md - 1px',
  867. 'alert-with-description-padding-vertical': '@padding-md - 1px',
  868. 'alert-with-description-padding': `@alert-with-description-padding-vertical 15px
  869. @alert-with-description-no-icon-padding-vertical @alert-with-description-icon-size`,
  870. 'alert-icon-top': '8px + @font-size-base * (@line-height-base / 2) - (@font-size-base / 2)',
  871. 'alert-with-description-icon-size': '24px',
  872. // List
  873. // ---
  874. 'list-header-background': 'transparent',
  875. 'list-footer-background': 'transparent',
  876. 'list-empty-text-padding': '@padding-md',
  877. 'list-item-padding': '@padding-sm 0',
  878. 'list-item-padding-sm': '@padding-xs @padding-md',
  879. 'list-item-padding-lg': '16px 24px',
  880. 'list-item-meta-margin-bottom': '@padding-md',
  881. 'list-item-meta-avatar-margin-right': '@padding-md',
  882. 'list-item-meta-title-margin-bottom': '@padding-sm',
  883. 'list-customize-card-bg': '@component-background',
  884. 'list-item-meta-description-font-size': '@font-size-base',
  885. // Statistic
  886. // ---
  887. 'statistic-title-font-size': '@font-size-base',
  888. 'statistic-content-font-size': '24px',
  889. 'statistic-unit-font-size': '24px',
  890. 'statistic-font-family': '@font-family',
  891. // Drawer
  892. // ---
  893. 'drawer-header-padding': '@padding-md @padding-lg',
  894. 'drawer-body-padding': '@padding-lg',
  895. 'drawer-bg': '@component-background',
  896. 'drawer-footer-padding-vertical': '@modal-footer-padding-vertical',
  897. 'drawer-footer-padding-horizontal': '@modal-footer-padding-horizontal',
  898. 'drawer-header-close-size': '56px',
  899. 'drawer-title-font-size': '@font-size-lg',
  900. 'drawer-title-line-height': '22px',
  901. // Timeline
  902. // ---
  903. 'timeline-width': '2px',
  904. 'timeline-color': '@border-color-split',
  905. 'timeline-dot-border-width': '2px',
  906. 'timeline-dot-color': '@primary-color',
  907. 'timeline-dot-bg': '@component-background',
  908. 'timeline-item-padding-bottom': '20px',
  909. // Typography
  910. // ---
  911. 'typography-title-font-weight': '600',
  912. 'typography-title-margin-top': '1.2em',
  913. 'typography-title-margin-bottom': '0.5em',
  914. // Upload
  915. // ---
  916. 'upload-actions-color': '@text-color-secondary',
  917. // Steps
  918. // ---
  919. 'process-tail-color': '@border-color-split',
  920. 'steps-nav-arrow-color': 'fade(@black, 25%)',
  921. 'steps-background': '@component-background',
  922. 'steps-icon-size': '32px',
  923. 'steps-icon-custom-size': '@steps-icon-size',
  924. 'steps-icon-custom-top': '0px',
  925. 'steps-icon-custom-font-size': '24px',
  926. 'steps-icon-top': '-0.5px',
  927. 'steps-icon-font-size': '@font-size-lg',
  928. 'steps-icon-margin': '0 8px 0 0',
  929. 'steps-title-line-height': '@height-base',
  930. 'steps-small-icon-size': '24px',
  931. 'steps-small-icon-margin': '0 8px 0 0',
  932. 'steps-dot-size': '8px',
  933. 'steps-dot-top': '2px',
  934. 'steps-current-dot-size': '10px',
  935. 'steps-description-max-width': '140px',
  936. 'steps-nav-content-max-width': 'auto',
  937. 'steps-vertical-icon-width': '16px',
  938. 'steps-vertical-tail-width': '16px',
  939. 'steps-vertical-tail-width-sm': '12px',
  940. // Notification
  941. // ---
  942. 'notification-bg': '@component-background',
  943. 'notification-padding-vertical': '16px',
  944. 'notification-padding-horizontal': '24px',
  945. // Result
  946. // ---
  947. 'result-title-font-size': '24px',
  948. 'result-subtitle-font-size': '@font-size-base',
  949. 'result-icon-font-size': '72px',
  950. 'result-extra-margin': '24px 0 0 0',
  951. // Image
  952. // ---
  953. 'image-size-base': '48px',
  954. 'image-font-size-base': '24px',
  955. 'image-bg': '#f5f5f5',
  956. 'image-color': '#fff',
  957. 'image-mask-font-size': '16px',
  958. 'image-preview-operation-size': '18px',
  959. 'image-preview-operation-color': '@text-color-dark',
  960. 'image-preview-operation-disabled-color': 'fade(@image-preview-operation-color, 25%)',
  961. // Segmented
  962. // ---
  963. 'segmented-bg': 'fade(@black, 4%)',
  964. 'segmented-hover-bg': 'fade(@black, 6%)',
  965. 'segmented-selected-bg': '@white',
  966. 'segmented-label-color': 'fade(@black, 65%)',
  967. 'segmented-label-hover-color': '#262626'
  968. };
  969. // Fill colors. e.g. '@red-1', '@yellow-6'
  970. Object.keys(token).forEach(key => {
  971. if (key !== key.toLowerCase()) {
  972. return;
  973. }
  974. const value = token[key];
  975. if (typeof value === 'string') {
  976. raw[key] = value;
  977. }
  978. });
  979. // Convert to string
  980. const returnData = {};
  981. Object.keys(raw).forEach(key => {
  982. const value = raw[key];
  983. if (typeof value === 'function') {
  984. returnData[key] = value(raw);
  985. } else if (typeof value === 'number' && !key.includes('line-height')) {
  986. returnData[key] = `${value}px`;
  987. } else {
  988. returnData[key] = `${value}`;
  989. }
  990. });
  991. return returnData;
  992. }