diff --git a/.eslintrc.js b/.eslintrc.js index c0d2c19f91..8b675f955c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,5 +1,5 @@ const eslintrc = { - extends: ['eslint-config-airbnb'], + extends: ['airbnb', 'prettier'], env: { browser: true, node: true, @@ -8,18 +8,27 @@ const eslintrc = { es6: true, }, parser: 'babel-eslint', - plugins: [ - 'markdown', - 'react', - 'babel', - ], + plugins: ['markdown', 'react', 'babel'], rules: { 'react/jsx-one-expression-per-line': 0, 'react/prop-types': 0, 'react/forbid-prop-types': 0, - 'import/no-extraneous-dependencies': ['error', { - devDependencies: ['site/**', 'tests/**', 'scripts/**', '**/*.test.js', '**/__tests__/*', '*.config.js', '**/*.md'], - }], + 'react/jsx-indent': 0, + 'react/jsx-wrap-multilines': ['error', { declaration: false, assignment: false }], + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: [ + 'site/**', + 'tests/**', + 'scripts/**', + '**/*.test.js', + '**/__tests__/*', + '*.config.js', + '**/*.md', + ], + }, + ], 'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx', '.md'] }], 'jsx-a11y/no-static-element-interactions': 0, 'jsx-a11y/anchor-has-content': 0, diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..b50172d492 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,7 @@ +**/*.md +**/*.svg +**/*.ejs +**/*.html +package.json +.umi +.umi-production \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..9f5ab919f7 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,19 @@ +{ + "singleQuote": true, + "trailingComma": "all", + "printWidth": 100, + "overrides": [ + { + "files": ".prettierrc", + "options": { + "parser": "json" + } + }, + { + "files": ".stylelintrc", + "options": { + "parser": "json" + } + } + ] +} diff --git a/.stylelintrc b/.stylelintrc index 1e5e8983f4..9d422fb7ca 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,5 +1,5 @@ { - "extends": "stylelint-config-standard", + "extends": ["stylelint-config-standard", "stylelint-config-prettier"], "rules": { "comment-empty-line-before": null, "declaration-empty-line-before": null, diff --git a/components/__tests__/index.test.js b/components/__tests__/index.test.js index 5082b7f6b1..1716b3502c 100644 --- a/components/__tests__/index.test.js +++ b/components/__tests__/index.test.js @@ -14,7 +14,7 @@ describe('antd', () => { it('should hint when import all components in dev mode', () => { expect(warnSpy).toBeCalledWith( - 'You are using a whole package of antd, please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.' + 'You are using a whole package of antd, please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.', ); warnSpy.mockRestore(); }); diff --git a/components/_util/__tests__/util.test.js b/components/_util/__tests__/util.test.js index 584258e709..21a67d4cd5 100644 --- a/components/_util/__tests__/util.test.js +++ b/components/_util/__tests__/util.test.js @@ -88,7 +88,7 @@ describe('Test utils function', () => { }); }); - it('delayRaf', (done) => { + it('delayRaf', done => { jest.useRealTimers(); let bamboo = false; @@ -118,9 +118,13 @@ describe('Test utils function', () => { it('triggerEvent', () => { const button = document.createElement('button'); - button.addEventListener('click', () => { - button.style.width = '100px'; - }, true); + button.addEventListener( + 'click', + () => { + button.style.width = '100px'; + }, + true, + ); triggerEvent(button, 'click'); expect(button.style.width).toBe('100px'); }); diff --git a/components/_util/isFlexSupported.tsx b/components/_util/isFlexSupported.tsx index 78b9babed7..dd6a5ae7ed 100644 --- a/components/_util/isFlexSupported.tsx +++ b/components/_util/isFlexSupported.tsx @@ -1,10 +1,12 @@ export default function isFlexSupported() { if (typeof window !== 'undefined' && window.document && window.document.documentElement) { const { documentElement } = window.document; - return 'flex' in documentElement.style || + return ( + 'flex' in documentElement.style || 'webkitFlex' in documentElement.style || 'Flex' in documentElement.style || - 'msFlex' in documentElement.style; + 'msFlex' in documentElement.style + ); } return false; } diff --git a/components/_util/raf.ts b/components/_util/raf.ts index e70e2e640b..7d3e12dc8b 100644 --- a/components/_util/raf.ts +++ b/components/_util/raf.ts @@ -1,7 +1,7 @@ import raf from 'raf'; interface RafMap { - [id: number]: number, + [id: number]: number; } let id: number = 0; @@ -31,4 +31,4 @@ export default function wrapperRaf(callback: () => void, delayFrames: number = 1 wrapperRaf.cancel = function(id: number) { raf.cancel(ids[id]); delete ids[id]; -} \ No newline at end of file +}; diff --git a/components/_util/warning.tsx b/components/_util/warning.tsx index 144130e529..6a9f7a59c6 100644 --- a/components/_util/warning.tsx +++ b/components/_util/warning.tsx @@ -1,6 +1,6 @@ import warning from 'warning'; -const warned: { [msg: string]: boolean} = {}; +const warned: { [msg: string]: boolean } = {}; export default (valid: boolean, message: string): void => { if (!valid && !warned[message]) { warning(false, message); diff --git a/components/_util/wave.tsx b/components/_util/wave.tsx index aa89247701..63d284ba7e 100644 --- a/components/_util/wave.tsx +++ b/components/_util/wave.tsx @@ -13,7 +13,7 @@ function isHidden(element: HTMLElement) { return !element || element.offsetParent === null; } -export default class Wave extends React.Component<{insertExtraNode?: boolean}> { +export default class Wave extends React.Component<{ insertExtraNode?: boolean }> { private instance?: { cancel: () => void; }; @@ -22,7 +22,7 @@ export default class Wave extends React.Component<{insertExtraNode?: boolean}> { private clickWaveTimeoutId: number; private animationStartId: number; private animationStart: boolean = false; - private destroy: boolean = false + private destroy: boolean = false; isNotGrey(color: string) { const match = (color || '').match(/rgba?\((\d*), (\d*), (\d*)(, [\.\d]*)?\)/); @@ -45,15 +45,16 @@ export default class Wave extends React.Component<{insertExtraNode?: boolean}> { node.setAttribute(attributeName, 'true'); // Not white or transparnt or grey styleForPesudo = styleForPesudo || document.createElement('style'); - if (waveColor && - waveColor !== '#ffffff' && - waveColor !== 'rgb(255, 255, 255)' && - this.isNotGrey(waveColor) && - !/rgba\(\d*, \d*, \d*, 0\)/.test(waveColor) && // any transparent rgba color - waveColor !== 'transparent') { + if ( + waveColor && + waveColor !== '#ffffff' && + waveColor !== 'rgb(255, 255, 255)' && + this.isNotGrey(waveColor) && + !/rgba\(\d*, \d*, \d*, 0\)/.test(waveColor) && // any transparent rgba color + waveColor !== 'transparent' + ) { extraNode.style.borderColor = waveColor; - styleForPesudo.innerHTML = - `[ant-click-animating-without-extra-node]:after { border-color: ${waveColor}; }`; + styleForPesudo.innerHTML = `[ant-click-animating-without-extra-node]:after { border-color: ${waveColor}; }`; if (!document.body.contains(styleForPesudo)) { document.body.appendChild(styleForPesudo); } @@ -63,13 +64,15 @@ export default class Wave extends React.Component<{insertExtraNode?: boolean}> { } TransitionEvents.addStartEventListener(node, this.onTransitionStart); TransitionEvents.addEndEventListener(node, this.onTransitionEnd); - } + }; bindAnimationEvent = (node: HTMLElement) => { - if (!node || - !node.getAttribute || - node.getAttribute('disabled') || - node.className.indexOf('disabled') >= 0) { + if ( + !node || + !node.getAttribute || + node.getAttribute('disabled') || + node.className.indexOf('disabled') >= 0 + ) { return; } const onClick = (e: MouseEvent) => { @@ -99,7 +102,7 @@ export default class Wave extends React.Component<{insertExtraNode?: boolean}> { node.removeEventListener('click', onClick, true); }, }; - } + }; getAttributeName() { const { insertExtraNode } = this.props; @@ -132,14 +135,14 @@ export default class Wave extends React.Component<{insertExtraNode?: boolean}> { if (!this.animationStart) { this.resetEffect(node); } - } + }; onTransitionEnd = (e: AnimationEvent) => { if (!e || e.animationName !== 'fadeEffect') { return; } this.resetEffect(e.target as HTMLElement); - } + }; removeExtraStyleNode() { if (styleForPesudo) { diff --git a/components/affix/__tests__/Affix.test.js b/components/affix/__tests__/Affix.test.js index b135454f32..be147e5353 100644 --- a/components/affix/__tests__/Affix.test.js +++ b/components/affix/__tests__/Affix.test.js @@ -12,7 +12,7 @@ class AffixMounter extends React.Component { }); } - getTarget = () => this.container + getTarget = () => this.container; render() { return ( @@ -21,7 +21,9 @@ class AffixMounter extends React.Component { height: 100, overflowY: 'scroll', }} - ref={(node) => { this.container = node; }} + ref={node => { + this.container = node; + }} >
{i % 10}
); + const currentClassName = position === i ? 'current' : ''; + childrenToReturn.push( ++ {i % 10} +
, + ); } return childrenToReturn; } renderCurrentNumber(num: number, i: number) { const position = this.getPositionByNum(num, i); - const removeTransition = this.state.animateStarted || - (getNumberArray(this.lastCount)[i] === undefined); - return createElement('span', { - className: `${this.props.prefixCls}-only`, - style: { - transition: removeTransition ? 'none' : undefined, - msTransform: `translateY(${-position * 100}%)`, - WebkitTransform: `translateY(${-position * 100}%)`, - transform: `translateY(${-position * 100}%)`, + const removeTransition = + this.state.animateStarted || getNumberArray(this.lastCount)[i] === undefined; + return createElement( + 'span', + { + className: `${this.props.prefixCls}-only`, + style: { + transition: removeTransition ? 'none' : undefined, + msTransform: `translateY(${-position * 100}%)`, + WebkitTransform: `translateY(${-position * 100}%)`, + transform: `translateY(${-position * 100}%)`, + }, + key: i, }, - key: i, - }, this.renderNumberList(position)); + this.renderNumberList(position), + ); } renderNumberElement() { @@ -122,7 +137,8 @@ export default class ScrollNumber extends ComponentCard content
-extends React.SFC
{
unstable_ChangeDefaultThemeOfIcons?: typeof unstable_ChangeDefaultThemeOfIcons;
}
-const Icon: IconComponent
- );
- expect(wrapper.find('div').first().props().locale).toBe(undefined);
+ const wrapper = mount(
);
+ expect(
+ wrapper
+ .find('div')
+ .first()
+ .props().locale,
+ ).toBe(undefined);
});
});
diff --git a/components/list/__tests__/loading.test.js b/components/list/__tests__/loading.test.js
index 244d820bd8..35011c06eb 100644
--- a/components/list/__tests__/loading.test.js
+++ b/components/list/__tests__/loading.test.js
@@ -9,7 +9,7 @@ describe('List', () => {
spinning: true,
};
const wrapper = render(
-
+
{rowList}
);
diff --git a/components/skeleton/Title.tsx b/components/skeleton/Title.tsx
index 507f4d697b..7383b9647d 100644
--- a/components/skeleton/Title.tsx
+++ b/components/skeleton/Title.tsx
@@ -16,12 +16,7 @@ class Title extends React.Component`-`
` all receive top and bottom margins. We nuke the top
// margin for easier control within type scales as it avoids margin collapsing.
-h1, h2, h3, h4, h5, h6 {
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
margin-top: 0;
- margin-bottom: .5em;
+ margin-bottom: 0.5em;
color: @heading-color;
font-weight: 500;
}
@@ -123,7 +142,8 @@ p {
// 4. Duplicate behavior to the data-* attribute for our tooltip plugin
abbr[title],
-abbr[data-original-title] { // 4
+abbr[data-original-title] {
+ // 4
text-decoration: underline; // 2
text-decoration: underline dotted; // 2
cursor: help; // 3
@@ -136,9 +156,9 @@ address {
line-height: inherit;
}
-input[type="text"],
-input[type="password"],
-input[type="number"],
+input[type='text'],
+input[type='password'],
+input[type='number'],
textarea {
-webkit-appearance: none;
}
@@ -162,7 +182,7 @@ dt {
}
dd {
- margin-bottom: .5em;
+ margin-bottom: 0.5em;
margin-left: 0; // Undo browser default
}
@@ -196,8 +216,12 @@ sup {
vertical-align: baseline;
}
-sub { bottom: -.25em; }
-sup { top: -.5em; }
+sub {
+ bottom: -0.25em;
+}
+sup {
+ top: -0.5em;
+}
//
// Links
@@ -209,7 +233,7 @@ a {
text-decoration: @link-decoration;
outline: none;
cursor: pointer;
- transition: color .3s;
+ transition: color 0.3s;
-webkit-text-decoration-skip: objects; // remove gaps in links underline in iOS 8+ and Safari 8+.
&:focus {
@@ -293,8 +317,8 @@ svg:not(:root) {
a,
area,
button,
-[role="button"],
-input:not([type=range]),
+[role='button'],
+input:not([type='range']),
label,
select,
summary,
@@ -311,8 +335,8 @@ table {
}
caption {
- padding-top: .75em;
- padding-bottom: .3em;
+ padding-top: 0.75em;
+ padding-bottom: 0.3em;
color: @text-color-secondary;
text-align: left;
caption-side: bottom;
@@ -362,23 +386,23 @@ html [type="button"], // 1
// remove inner border and padding from Firefox, but don't restore the outline like Normalize.
button::-moz-focus-inner,
-[type="button"]::-moz-focus-inner,
-[type="reset"]::-moz-focus-inner,
-[type="submit"]::-moz-focus-inner {
+[type='button']::-moz-focus-inner,
+[type='reset']::-moz-focus-inner,
+[type='submit']::-moz-focus-inner {
padding: 0;
border-style: none;
}
-input[type="radio"],
-input[type="checkbox"] {
+input[type='radio'],
+input[type='checkbox'] {
box-sizing: border-box; // 1. Add the correct box sizing in IE 10-
padding: 0; // 2. remove the padding in IE 10-
}
-input[type="date"],
-input[type="time"],
-input[type="datetime-local"],
-input[type="month"] {
+input[type='date'],
+input[type='time'],
+input[type='datetime-local'],
+input[type='month'] {
// remove the default appearance of temporal inputs to avoid a Mobile Safari
// bug where setting a custom line-height prevents text from being vertically
// centered within the input.
@@ -413,7 +437,7 @@ legend {
width: 100%;
max-width: 100%; // 1
padding: 0;
- margin-bottom: .5em;
+ margin-bottom: 0.5em;
font-size: 1.5em;
line-height: inherit;
color: inherit; // 2
@@ -425,12 +449,12 @@ progress {
}
// Correct the cursor style of incement and decement buttons in Chrome.
-[type="number"]::-webkit-inner-spin-button,
-[type="number"]::-webkit-outer-spin-button {
+[type='number']::-webkit-inner-spin-button,
+[type='number']::-webkit-outer-spin-button {
height: auto;
}
-[type="search"] {
+[type='search'] {
// This overrides the extra rounded corners on search inputs in iOS so that our
// `.form-control` class can properly style them. Note that this cannot simply
// be added to `.form-control` as it's not specific enough. For details, see
@@ -443,8 +467,8 @@ progress {
// remove the inner padding and cancel buttons in Chrome and Safari on macOS.
//
-[type="search"]::-webkit-search-cancel-button,
-[type="search"]::-webkit-search-decoration {
+[type='search']::-webkit-search-cancel-button,
+[type='search']::-webkit-search-decoration {
-webkit-appearance: none;
}
@@ -481,7 +505,7 @@ template {
}
mark {
- padding: .2em;
+ padding: 0.2em;
background-color: @yellow-1;
}
diff --git a/components/style/core/iconfont.less b/components/style/core/iconfont.less
index 1d236c8a26..3f1a9fbb9f 100644
--- a/components/style/core/iconfont.less
+++ b/components/style/core/iconfont.less
@@ -1,8 +1,8 @@
@import '../themes/default';
-@import "../mixins/iconfont";
+@import '../mixins/iconfont';
.@{iconfont-css-prefix} {
- .iconfont-mixin();
+ .iconfont-mixin();
}
.@{iconfont-css-prefix}-spin:before {
diff --git a/components/style/core/index.less b/components/style/core/index.less
index 4901d06128..bce88707da 100644
--- a/components/style/core/index.less
+++ b/components/style/core/index.less
@@ -1,4 +1,4 @@
-@import "../mixins/index";
-@import "base";
-@import "iconfont";
-@import "motion";
+@import '../mixins/index';
+@import 'base';
+@import 'iconfont';
+@import 'motion';
diff --git a/components/style/core/motion.less b/components/style/core/motion.less
index e47ce302a8..930182b238 100644
--- a/components/style/core/motion.less
+++ b/components/style/core/motion.less
@@ -1,15 +1,15 @@
-@import "../mixins/motion";
-@import "motion/fade";
-@import "motion/move";
-@import "motion/other";
-@import "motion/slide";
-@import "motion/swing";
-@import "motion/zoom";
+@import '../mixins/motion';
+@import 'motion/fade';
+@import 'motion/move';
+@import 'motion/other';
+@import 'motion/slide';
+@import 'motion/swing';
+@import 'motion/zoom';
// For common/openAnimation
.ant-motion-collapse {
overflow: hidden;
&-active {
- transition: height .15s @ease-in-out, opacity .15s @ease-in-out !important;
+ transition: height 0.15s @ease-in-out, opacity 0.15s @ease-in-out !important;
}
}
diff --git a/components/style/core/motion/other.less b/components/style/core/motion/other.less
index 6ad5a623d2..e11fe8f190 100644
--- a/components/style/core/motion/other.less
+++ b/components/style/core/motion/other.less
@@ -11,7 +11,7 @@
[ant-click-animating-without-extra-node]:after,
.ant-click-animating-node {
- content: "";
+ content: '';
position: absolute;
top: -1px;
left: -1px;
@@ -20,7 +20,7 @@
border-radius: inherit;
border: 0 solid @primary-color;
opacity: 0.2;
- animation: fadeEffect 2s @ease-out-circ, waveEffect .4s @ease-out-circ;
+ animation: fadeEffect 2s @ease-out-circ, waveEffect 0.4s @ease-out-circ;
animation-fill-mode: forwards;
display: block;
pointer-events: none;
diff --git a/components/style/core/motion/slide.less b/components/style/core/motion/slide.less
index 216cff0840..23420128e4 100644
--- a/components/style/core/motion/slide.less
+++ b/components/style/core/motion/slide.less
@@ -19,7 +19,7 @@
0% {
opacity: 0;
transform-origin: 0% 0%;
- transform: scaleY(.8);
+ transform: scaleY(0.8);
}
100% {
opacity: 1;
@@ -37,7 +37,7 @@
100% {
opacity: 0;
transform-origin: 0% 0%;
- transform: scaleY(.8);
+ transform: scaleY(0.8);
}
}
@@ -45,7 +45,7 @@
0% {
opacity: 0;
transform-origin: 100% 100%;
- transform: scaleY(.8);
+ transform: scaleY(0.8);
}
100% {
opacity: 1;
@@ -63,7 +63,7 @@
100% {
opacity: 0;
transform-origin: 100% 100%;
- transform: scaleY(.8);
+ transform: scaleY(0.8);
}
}
@@ -71,7 +71,7 @@
0% {
opacity: 0;
transform-origin: 0% 0%;
- transform: scaleX(.8);
+ transform: scaleX(0.8);
}
100% {
opacity: 1;
@@ -89,7 +89,7 @@
100% {
opacity: 0;
transform-origin: 0% 0%;
- transform: scaleX(.8);
+ transform: scaleX(0.8);
}
}
@@ -97,7 +97,7 @@
0% {
opacity: 0;
transform-origin: 100% 0%;
- transform: scaleX(.8);
+ transform: scaleX(0.8);
}
100% {
opacity: 1;
@@ -115,6 +115,6 @@
100% {
opacity: 0;
transform-origin: 100% 0%;
- transform: scaleX(.8);
+ transform: scaleX(0.8);
}
}
diff --git a/components/style/core/motion/swing.less b/components/style/core/motion/swing.less
index dcf299a015..8aac66c20b 100644
--- a/components/style/core/motion/swing.less
+++ b/components/style/core/motion/swing.less
@@ -6,7 +6,7 @@
}
.@{className}-enter.@{className}-enter-active,
.@{className}-appear.@{className}-appear-active {
- animation-name: ~"@{keyframeName}In";
+ animation-name: ~'@{keyframeName}In';
animation-play-state: running;
}
}
diff --git a/components/style/core/motion/zoom.less b/components/style/core/motion/zoom.less
index 420b42f8e9..2754360e04 100644
--- a/components/style/core/motion/zoom.less
+++ b/components/style/core/motion/zoom.less
@@ -46,7 +46,7 @@
@keyframes antZoomBigIn {
0% {
opacity: 0;
- transform: scale(.8);
+ transform: scale(0.8);
}
100% {
transform: scale(1);
@@ -59,7 +59,7 @@
}
100% {
opacity: 0;
- transform: scale(.8);
+ transform: scale(0.8);
}
}
@@ -67,7 +67,7 @@
0% {
opacity: 0;
transform-origin: 50% 0%;
- transform: scale(.8);
+ transform: scale(0.8);
}
100% {
transform-origin: 50% 0%;
@@ -83,7 +83,7 @@
100% {
opacity: 0;
transform-origin: 50% 0%;
- transform: scale(.8);
+ transform: scale(0.8);
}
}
@@ -91,7 +91,7 @@
0% {
opacity: 0;
transform-origin: 0% 50%;
- transform: scale(.8);
+ transform: scale(0.8);
}
100% {
transform-origin: 0% 50%;
@@ -107,7 +107,7 @@
100% {
opacity: 0;
transform-origin: 0% 50%;
- transform: scale(.8);
+ transform: scale(0.8);
}
}
@@ -115,7 +115,7 @@
0% {
opacity: 0;
transform-origin: 100% 50%;
- transform: scale(.8);
+ transform: scale(0.8);
}
100% {
transform-origin: 100% 50%;
@@ -131,7 +131,7 @@
100% {
opacity: 0;
transform-origin: 100% 50%;
- transform: scale(.8);
+ transform: scale(0.8);
}
}
@@ -139,7 +139,7 @@
0% {
opacity: 0;
transform-origin: 50% 100%;
- transform: scale(.8);
+ transform: scale(0.8);
}
100% {
transform-origin: 50% 100%;
@@ -155,6 +155,6 @@
100% {
opacity: 0;
transform-origin: 50% 100%;
- transform: scale(.8);
+ transform: scale(0.8);
}
}
diff --git a/components/style/index.less b/components/style/index.less
index a33fdfc3aa..0a1269031f 100644
--- a/components/style/index.less
+++ b/components/style/index.less
@@ -1,2 +1,2 @@
-@import "./themes/default";
-@import "./core/index";
+@import './themes/default';
+@import './core/index';
diff --git a/components/style/mixins/clearfix.less b/components/style/mixins/clearfix.less
index 8eefb38bed..c0c7a7e703 100644
--- a/components/style/mixins/clearfix.less
+++ b/components/style/mixins/clearfix.less
@@ -4,7 +4,7 @@
zoom: 1;
&:before,
&:after {
- content: "";
+ content: '';
display: table;
}
&:after {
diff --git a/components/style/mixins/iconfont.less b/components/style/mixins/iconfont.less
index a18f0c2713..b4dadb09c0 100644
--- a/components/style/mixins/iconfont.less
+++ b/components/style/mixins/iconfont.less
@@ -33,7 +33,7 @@
@font-scale: unit(@size / 12px);
font-size: 12px;
// IE9
- font-size: ~"@{size} \9";
+ font-size: ~'@{size} \9';
transform: scale(@font-scale) rotate(@rotate);
:root & {
font-size: @font-size-sm; // reset IE9 and above
diff --git a/components/style/mixins/index.less b/components/style/mixins/index.less
index ccf2212a67..44c88a764b 100644
--- a/components/style/mixins/index.less
+++ b/components/style/mixins/index.less
@@ -1,8 +1,8 @@
// Mixins
// --------------------------------------------------
-@import "size";
-@import "compatibility";
-@import "clearfix";
-@import "iconfont";
-@import "motion";
-@import "reset";
+@import 'size';
+@import 'compatibility';
+@import 'clearfix';
+@import 'iconfont';
+@import 'motion';
+@import 'reset';
diff --git a/components/style/mixins/motion.less b/components/style/mixins/motion.less
index 84b2c82eb1..50aff38f8f 100644
--- a/components/style/mixins/motion.less
+++ b/components/style/mixins/motion.less
@@ -22,11 +22,11 @@
}
.@{className}-enter.@{className}-enter-active,
.@{className}-appear.@{className}-appear-active {
- animation-name: ~"@{keyframeName}In";
+ animation-name: ~'@{keyframeName}In';
animation-play-state: running;
}
.@{className}-leave.@{className}-leave-active {
- animation-name: ~"@{keyframeName}Out";
+ animation-name: ~'@{keyframeName}Out';
animation-play-state: running;
pointer-events: none;
}
diff --git a/components/style/themes/default.less b/components/style/themes/default.less
index 8ec7838cf0..1dac261e0c 100644
--- a/components/style/themes/default.less
+++ b/components/style/themes/default.less
@@ -1,61 +1,63 @@
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
-@import "../color/colors";
+@import '../color/colors';
// The prefix to use on all css classes from ant.
-@ant-prefix : ant;
+@ant-prefix : ant;
// -------- Colors -----------
-@primary-color : @blue-6;
-@info-color : @blue-6;
-@success-color : @green-6;
-@processing-color : @blue-6;
-@error-color : @red-6;
-@highlight-color : @red-6;
-@warning-color : @gold-6;
-@normal-color : #d9d9d9;
+@primary-color : @blue-6;
+@info-color : @blue-6;
+@success-color : @green-6;
+@processing-color : @blue-6;
+@error-color : @red-6;
+@highlight-color : @red-6;
+@warning-color : @gold-6;
+@normal-color : #d9d9d9;
// Color used by default to control hover and active backgrounds and for
// alert info backgrounds.
-@primary-1: color(~`colorPalette("@{primary-color}", 1)`); // replace tint(@primary-color, 90%)
-@primary-2: color(~`colorPalette("@{primary-color}", 2)`); // replace tint(@primary-color, 80%)
-@primary-3: color(~`colorPalette("@{primary-color}", 3)`); // unused
-@primary-4: color(~`colorPalette("@{primary-color}", 4)`); // unused
-@primary-5: color(~`colorPalette("@{primary-color}", 5)`); // color used to control the text color in many active and hover states, replace tint(@primary-color, 20%)
-@primary-6: @primary-color; // color used to control the text color of active buttons, don't use, use @primary-color
-@primary-7: color(~`colorPalette("@{primary-color}", 7)`); // replace shade(@primary-color, 5%)
-@primary-8: color(~`colorPalette("@{primary-color}", 8)`); // unused
-@primary-9: color(~`colorPalette("@{primary-color}", 9)`); // unused
-@primary-10: color(~`colorPalette("@{primary-color}", 10)`); // unused
+@primary-1: color(~`colorPalette('@{primary-color}', 1) `); // replace tint(@primary-color, 90%)
+@primary-2: color(~`colorPalette('@{primary-color}', 2) `); // replace tint(@primary-color, 80%)
+@primary-3: color(~`colorPalette('@{primary-color}', 3) `); // unused
+@primary-4: color(~`colorPalette('@{primary-color}', 4) `); // unused
+@primary-5: color(
+ ~`colorPalette('@{primary-color}', 5) `
+); // color used to control the text color in many active and hover states, replace tint(@primary-color, 20%)
+@primary-6: @primary-color; // color used to control the text color of active buttons, don't use, use @primary-color
+@primary-7: color(~`colorPalette('@{primary-color}', 7) `); // replace shade(@primary-color, 5%)
+@primary-8: color(~`colorPalette('@{primary-color}', 8) `); // unused
+@primary-9: color(~`colorPalette('@{primary-color}', 9) `); // unused
+@primary-10: color(~`colorPalette('@{primary-color}', 10) `); // unused
// Base Scaffolding Variables
// ---
// Background color for ``
-@body-background : #fff;
+@body-background : #fff;
// Base background color for most components
-@component-background : #fff;
-@font-family : "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif,
+@component-background : #fff;
+@font-family : "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
-@code-family : "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
-@heading-color : fade(#000, 85%);
-@text-color : fade(#000, 65%);
-@text-color-secondary : fade(#000, 45%);
-@heading-color-dark : fade(#fff, 100%);
-@text-color-dark : fade(#fff, 85%);
+@code-family : "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
+@heading-color : fade(#000, 85%);
+@text-color : fade(#000, 65%);
+@text-color-secondary : fade(#000, 45%);
+@heading-color-dark : fade(#fff, 100%);
+@text-color-dark : fade(#fff, 85%);
@text-color-secondary-dark: fade(#fff, 65%);
-@font-variant-base : tabular-nums;
-@font-size-base : 14px;
-@font-size-lg : @font-size-base + 2px;
-@font-size-sm : 12px;
-@line-height-base : 1.5;
-@border-radius-base : 4px;
-@border-radius-sm : 2px;
+@font-variant-base : tabular-nums;
+@font-size-base : 14px;
+@font-size-lg : @font-size-base + 2px;
+@font-size-sm : 12px;
+@line-height-base : 1.5;
+@border-radius-base : 4px;
+@border-radius-sm : 2px;
// vertical paddings
-@padding-lg : 24px; // containers
-@padding-md : 16px; // small containers and buttons
-@padding-sm : 12px; // Form controls and items
-@padding-xs : 8px; // small items
+@padding-lg : 24px; // containers
+@padding-md : 16px; // small containers and buttons
+@padding-sm : 12px; // Form controls and items
+@padding-xs : 8px; // small items
// vertical padding for all form controls
@control-padding-horizontal: @padding-sm;
@@ -63,215 +65,215 @@
// The background colors for active and hover states for things like
// list items or table cells.
-@item-active-bg : @primary-1;
-@item-hover-bg : @primary-1;
+@item-active-bg : @primary-1;
+@item-hover-bg : @primary-1;
// ICONFONT
-@iconfont-css-prefix : anticon;
+@iconfont-css-prefix : anticon;
// LINK
-@link-color : @primary-color;
-@link-hover-color : color(~`colorPalette("@{link-color}", 5)`);
-@link-active-color : color(~`colorPalette("@{link-color}", 7)`);
-@link-decoration : none;
-@link-hover-decoration : none;
+@link-color : @primary-color;
+@link-hover-color : color(~`colorPalette("@{link-color}", 5)`);
+@link-active-color : color(~`colorPalette("@{link-color}", 7)`);
+@link-decoration : none;
+@link-hover-decoration : none;
// Animation
-@ease-base-out : cubic-bezier(0.7, 0.3, 0.1, 1);
-@ease-base-in : cubic-bezier(0.9, 0, 0.3, 0.7);
-@ease-out : cubic-bezier(0.215, 0.61, 0.355, 1);
-@ease-in : cubic-bezier(0.55, 0.055, 0.675, 0.19);
-@ease-in-out : cubic-bezier(0.645, 0.045, 0.355, 1);
-@ease-out-back : cubic-bezier(0.12, 0.4, 0.29, 1.46);
-@ease-in-back : cubic-bezier(0.71, -0.46, 0.88, 0.6);
-@ease-in-out-back : cubic-bezier(0.71, -0.46, 0.29, 1.46);
-@ease-out-circ : cubic-bezier(0.08, 0.82, 0.17, 1);
-@ease-in-circ : cubic-bezier(0.6, 0.04, 0.98, 0.34);
-@ease-in-out-circ : cubic-bezier(0.78, 0.14, 0.15, 0.86);
-@ease-out-quint : cubic-bezier(0.23, 1, 0.32, 1);
-@ease-in-quint : cubic-bezier(0.755, 0.05, 0.855, 0.06);
-@ease-in-out-quint : cubic-bezier(0.86, 0, 0.07, 1);
+@ease-base-out : cubic-bezier(0.7, 0.3, 0.1, 1);
+@ease-base-in : cubic-bezier(0.9, 0, 0.3, 0.7);
+@ease-out : cubic-bezier(0.215, 0.61, 0.355, 1);
+@ease-in : cubic-bezier(0.55, 0.055, 0.675, 0.19);
+@ease-in-out : cubic-bezier(0.645, 0.045, 0.355, 1);
+@ease-out-back : cubic-bezier(0.12, 0.4, 0.29, 1.46);
+@ease-in-back : cubic-bezier(0.71, -0.46, 0.88, 0.6);
+@ease-in-out-back : cubic-bezier(0.71, -0.46, 0.29, 1.46);
+@ease-out-circ : cubic-bezier(0.08, 0.82, 0.17, 1);
+@ease-in-circ : cubic-bezier(0.6, 0.04, 0.98, 0.34);
+@ease-in-out-circ : cubic-bezier(0.78, 0.14, 0.15, 0.86);
+@ease-out-quint : cubic-bezier(0.23, 1, 0.32, 1);
+@ease-in-quint : cubic-bezier(0.755, 0.05, 0.855, 0.06);
+@ease-in-out-quint : cubic-bezier(0.86, 0, 0.07, 1);
// Border color
-@border-color-base : hsv(0, 0, 85%); // base border outline a component
-@border-color-split : hsv(0, 0, 91%); // split border inside a component
-@border-width-base : 1px; // width of the border for a component
-@border-style-base : solid; // style of a components border
+@border-color-base : hsv(0, 0, 85%); // base border outline a component
+@border-color-split : hsv(0, 0, 91%); // split border inside a component
+@border-width-base : 1px; // width of the border for a component
+@border-style-base : solid; // style of a components border
// Outline
-@outline-blur-size : 0;
-@outline-width : 2px;
-@outline-color : @primary-color;
+@outline-blur-size : 0;
+@outline-width : 2px;
+@outline-color : @primary-color;
-@background-color-light : hsv(0, 0, 98%); // background of header and selected item
-@background-color-base : hsv(0, 0, 96%); // Default grey background color
+@background-color-light : hsv(0, 0, 98%); // background of header and selected item
+@background-color-base : hsv(0, 0, 96%); // Default grey background color
// Disabled states
-@disabled-color : fade(#000, 25%);
-@disabled-bg : @background-color-base;
-@disabled-color-dark : fade(#fff, 35%);
+@disabled-color : fade(#000, 25%);
+@disabled-bg : @background-color-base;
+@disabled-color-dark : fade(#fff, 35%);
// Shadow
-@shadow-color : rgba(0, 0, 0, .15);
-@box-shadow-base : @shadow-1-down;
-@shadow-1-up : 0 -2px 8px @shadow-color;
-@shadow-1-down : 0 2px 8px @shadow-color;
-@shadow-1-left : -2px 0 8px @shadow-color;
-@shadow-1-right : 2px 0 8px @shadow-color;
-@shadow-2 : 0 4px 12px @shadow-color;
+@shadow-color : rgba(0, 0, 0, .15);
+@box-shadow-base : @shadow-1-down;
+@shadow-1-up : 0 -2px 8px @shadow-color;
+@shadow-1-down : 0 2px 8px @shadow-color;
+@shadow-1-left : -2px 0 8px @shadow-color;
+@shadow-1-right : 2px 0 8px @shadow-color;
+@shadow-2 : 0 4px 12px @shadow-color;
// Buttons
-@btn-font-weight : 400;
+@btn-font-weight : 400;
@btn-border-radius-base : @border-radius-base;
-@btn-border-radius-sm : @border-radius-base;
+@btn-border-radius-sm : @border-radius-base;
-@btn-primary-color : #fff;
-@btn-primary-bg : @primary-color;
+@btn-primary-color : #fff;
+@btn-primary-bg : @primary-color;
-@btn-default-color : @text-color;
-@btn-default-bg : #fff;
-@btn-default-border : @border-color-base;
+@btn-default-color : @text-color;
+@btn-default-bg : #fff;
+@btn-default-border : @border-color-base;
-@btn-danger-color : @error-color;
-@btn-danger-bg : @background-color-base;
-@btn-danger-border : @border-color-base;
+@btn-danger-color : @error-color;
+@btn-danger-bg : @background-color-base;
+@btn-danger-border : @border-color-base;
-@btn-disable-color : @disabled-color;
-@btn-disable-bg : @disabled-bg;
-@btn-disable-border : @border-color-base;
+@btn-disable-color : @disabled-color;
+@btn-disable-bg : @disabled-bg;
+@btn-disable-border : @border-color-base;
-@btn-padding-base : 0 @padding-md - 1px;
-@btn-font-size-lg : @font-size-lg;
-@btn-font-size-sm : @font-size-base;
-@btn-padding-lg : @btn-padding-base;
-@btn-padding-sm : 0 @padding-xs - 1px;
+@btn-padding-base : 0 @padding-md - 1px;
+@btn-font-size-lg : @font-size-lg;
+@btn-font-size-sm : @font-size-base;
+@btn-padding-lg : @btn-padding-base;
+@btn-padding-sm : 0 @padding-xs - 1px;
-@btn-height-base : 32px;
-@btn-height-lg : 40px;
-@btn-height-sm : 24px;
+@btn-height-base : 32px;
+@btn-height-lg : 40px;
+@btn-height-sm : 24px;
-@btn-circle-size : @btn-height-base;
-@btn-circle-size-lg : @btn-height-lg;
-@btn-circle-size-sm : @btn-height-sm;
+@btn-circle-size : @btn-height-base;
+@btn-circle-size-lg : @btn-height-lg;
+@btn-circle-size-sm : @btn-height-sm;
-@btn-group-border : @primary-5;
+@btn-group-border : @primary-5;
// Checkbox
-@checkbox-size : 16px;
-@checkbox-color : @primary-color;
-@checkbox-check-color : #fff;
-@checkbox-border-width : @border-width-base;
+@checkbox-size : 16px;
+@checkbox-color : @primary-color;
+@checkbox-check-color : #fff;
+@checkbox-border-width : @border-width-base;
// Radio
-@radio-size : 16px;
-@radio-dot-color : @primary-color;
+@radio-size : 16px;
+@radio-dot-color : @primary-color;
// Radio buttons
-@radio-button-bg : @btn-default-bg;
-@radio-button-color : @btn-default-color;
-@radio-button-hover-color : @primary-5;
+@radio-button-bg : @btn-default-bg;
+@radio-button-color : @btn-default-color;
+@radio-button-hover-color : @primary-5;
@radio-button-active-color : @primary-7;
// Media queries breakpoints
// Extra small screen / phone
-@screen-xs : 480px;
-@screen-xs-min : @screen-xs;
+@screen-xs : 480px;
+@screen-xs-min : @screen-xs;
// Small screen / tablet
-@screen-sm : 576px;
-@screen-sm-min : @screen-sm;
+@screen-sm : 576px;
+@screen-sm-min : @screen-sm;
// Medium screen / desktop
-@screen-md : 768px;
-@screen-md-min : @screen-md;
+@screen-md : 768px;
+@screen-md-min : @screen-md;
// Large screen / wide desktop
-@screen-lg : 992px;
-@screen-lg-min : @screen-lg;
+@screen-lg : 992px;
+@screen-lg-min : @screen-lg;
// Extra large screen / full hd
-@screen-xl : 1200px;
-@screen-xl-min : @screen-xl;
+@screen-xl : 1200px;
+@screen-xl-min : @screen-xl;
// Extra extra large screen / large descktop
-@screen-xxl : 1600px;
-@screen-xxl-min : @screen-xxl;
+@screen-xxl : 1600px;
+@screen-xxl-min : @screen-xxl;
// provide a maximum
-@screen-xs-max : (@screen-sm-min - 1px);
-@screen-sm-max : (@screen-md-min - 1px);
-@screen-md-max : (@screen-lg-min - 1px);
-@screen-lg-max : (@screen-xl-min - 1px);
-@screen-xl-max : (@screen-xxl-min - 1px);
+@screen-xs-max : (@screen-sm-min - 1px);
+@screen-sm-max : (@screen-md-min - 1px);
+@screen-md-max : (@screen-lg-min - 1px);
+@screen-lg-max : (@screen-xl-min - 1px);
+@screen-xl-max : (@screen-xxl-min - 1px);
// Grid system
-@grid-columns : 24;
-@grid-gutter-width : 0;
+@grid-columns : 24;
+@grid-gutter-width : 0;
// Layout
-@layout-body-background : #f0f2f5;
-@layout-header-background : #001529;
-@layout-footer-background : @layout-body-background;
-@layout-header-height : 64px;
-@layout-header-padding : 0 50px;
-@layout-footer-padding : 24px 50px;
-@layout-sider-background : @layout-header-background;
-@layout-trigger-height : 48px;
-@layout-trigger-background : #002140;
-@layout-trigger-color : #fff;
-@layout-zero-trigger-width : 36px;
-@layout-zero-trigger-height : 42px;
+@layout-body-background : #f0f2f5;
+@layout-header-background : #001529;
+@layout-footer-background : @layout-body-background;
+@layout-header-height : 64px;
+@layout-header-padding : 0 50px;
+@layout-footer-padding : 24px 50px;
+@layout-sider-background : @layout-header-background;
+@layout-trigger-height : 48px;
+@layout-trigger-background : #002140;
+@layout-trigger-color : #fff;
+@layout-zero-trigger-width : 36px;
+@layout-zero-trigger-height : 42px;
// Layout light theme
-@layout-sider-background-light : #fff;
+@layout-sider-background-light : #fff;
@layout-trigger-background-light: #fff;
-@layout-trigger-color-light : @text-color;
+@layout-trigger-color-light : @text-color;
// z-index list
-@zindex-affix : 10;
-@zindex-back-top : 10;
-@zindex-modal-mask : 1000;
-@zindex-modal : 1000;
-@zindex-notification : 1010;
-@zindex-message : 1010;
-@zindex-popover : 1030;
-@zindex-picker : 1050;
-@zindex-dropdown : 1050;
-@zindex-tooltip : 1060;
+@zindex-affix : 10;
+@zindex-back-top : 10;
+@zindex-modal-mask : 1000;
+@zindex-modal : 1000;
+@zindex-notification : 1010;
+@zindex-message : 1010;
+@zindex-popover : 1030;
+@zindex-picker : 1050;
+@zindex-dropdown : 1050;
+@zindex-tooltip : 1060;
// Animation
-@animation-duration-slow: .3s; // Modal
-@animation-duration-base: .2s;
-@animation-duration-fast: .1s; // Tooltip
+@animation-duration-slow: 0.3s; // Modal
+@animation-duration-base: 0.2s;
+@animation-duration-fast: 0.1s; // Tooltip
// Form
// ---
-@label-required-color : @highlight-color;
-@label-color : @heading-color;
-@form-item-margin-bottom : 24px;
-@form-item-trailing-colon : true;
+@label-required-color : @highlight-color;
+@label-color : @heading-color;
+@form-item-margin-bottom : 24px;
+@form-item-trailing-colon : true;
@form-vertical-label-padding : 0 0 8px;
-@form-vertical-label-margin : 0;
+@form-vertical-label-margin : 0;
// Input
// ---
-@input-height-base : 32px;
-@input-height-lg : 40px;
-@input-height-sm : 24px;
-@input-padding-horizontal : @control-padding-horizontal - 1px;
+@input-height-base : 32px;
+@input-height-lg : 40px;
+@input-height-sm : 24px;
+@input-padding-horizontal : @control-padding-horizontal - 1px;
@input-padding-horizontal-base: @input-padding-horizontal;
@input-padding-horizontal-sm : @control-padding-horizontal-sm - 1px;
@input-padding-horizontal-lg : @input-padding-horizontal;
@input-padding-vertical-base : 4px;
-@input-padding-vertical-sm : 1px;
-@input-padding-vertical-lg : 6px;
-@input-placeholder-color : hsv(0, 0, 75%);
-@input-color : @text-color;
-@input-border-color : @border-color-base;
-@input-bg : #fff;
-@input-addon-bg : @background-color-light;
-@input-hover-border-color : @primary-color;
-@input-disabled-bg : @disabled-bg;
-@input-outline-offset : 0 0;
+@input-padding-vertical-sm : 1px;
+@input-padding-vertical-lg : 6px;
+@input-placeholder-color : hsv(0, 0, 75%);
+@input-color : @text-color;
+@input-border-color : @border-color-base;
+@input-bg : #fff;
+@input-addon-bg : @background-color-light;
+@input-hover-border-color : @primary-color;
+@input-disabled-bg : @disabled-bg;
+@input-outline-offset : 0 0;
// Tooltip
// ---
@@ -280,7 +282,7 @@
//** Tooltip text color
@tooltip-color: #fff;
//** Tooltip background color
-@tooltip-bg: rgba(0, 0, 0, .75);
+@tooltip-bg: rgba(0, 0, 0, 0.75);
//** Tooltip arrow width
@tooltip-arrow-width: 5px;
//** Tooltip distance with trigger
@@ -348,7 +350,7 @@
@table-header-bg: @background-color-light;
@table-header-color: @heading-color;
@table-header-sort-bg: @background-color-base;
-@table-body-sort-bg: rgba(0, 0, 0, .01);
+@table-body-sort-bg: rgba(0, 0, 0, 0.01);
@table-row-hover-bg: @primary-1;
@table-selected-row-bg: #fafafa;
@table-expanded-row-bg: #fbfbfb;
@@ -395,7 +397,7 @@
@card-padding-base: 24px;
@card-padding-wider: 32px;
@card-actions-background: @background-color-light;
-@card-shadow: 0 2px 8px rgba(0, 0, 0, .09);
+@card-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
// Comment
// ---
@@ -460,57 +462,57 @@
// Breadcrumb
// ---
-@breadcrumb-base-color: @text-color-secondary;
-@breadcrumb-last-item-color: @text-color;
-@breadcrumb-font-size: @font-size-base;
-@breadcrumb-icon-font-size: @font-size-base;
-@breadcrumb-link-color: @text-color-secondary;
-@breadcrumb-link-color-hover: @primary-5;
-@breadcrumb-separator-color: @text-color-secondary;
-@breadcrumb-separator-margin: 0 @padding-xs;
+@breadcrumb-base-color: @text-color-secondary;
+@breadcrumb-last-item-color: @text-color;
+@breadcrumb-font-size: @font-size-base;
+@breadcrumb-icon-font-size: @font-size-base;
+@breadcrumb-link-color: @text-color-secondary;
+@breadcrumb-link-color-hover: @primary-5;
+@breadcrumb-separator-color: @text-color-secondary;
+@breadcrumb-separator-margin: 0 @padding-xs;
// Slider
// ---
-@slider-margin: 14px 6px 10px;
-@slider-rail-background-color: @background-color-base;
-@slider-rail-background-color-hover: #e1e1e1;
-@slider-track-background-color: @primary-5;
+@slider-margin: 14px 6px 10px;
+@slider-rail-background-color: @background-color-base;
+@slider-rail-background-color-hover: #e1e1e1;
+@slider-track-background-color: @primary-5;
@slider-track-background-color-hover: @primary-6;
-@slider-handle-color: @primary-5;
-@slider-handle-color-hover: @primary-6;
-@slider-handle-color-focus: tint(@primary-color, 20%);
-@slider-handle-color-focus-shadow: fade(@primary-color, 20%);
-@slider-handle-color-tooltip-open: @primary-color;
-@slider-dot-border-color: @border-color-split;
-@slider-dot-border-color-active: @primary-5;
-@slider-disabled-color: @disabled-color;
-@slider-disabled-background-color: @component-background;
+@slider-handle-color: @primary-5;
+@slider-handle-color-hover: @primary-6;
+@slider-handle-color-focus: tint(@primary-color, 20%);
+@slider-handle-color-focus-shadow: fade(@primary-color, 20%);
+@slider-handle-color-tooltip-open: @primary-color;
+@slider-dot-border-color: @border-color-split;
+@slider-dot-border-color-active: @primary-5;
+@slider-disabled-color: @disabled-color;
+@slider-disabled-background-color: @component-background;
// Tree
// ---
-@tree-title-height: 24px;
-@tree-child-padding: 18px;
-@tree-directory-selected-color: #fff;
-@tree-directory-selected-bg: @primary-color;
+@tree-title-height: 24px;
+@tree-child-padding: 18px;
+@tree-directory-selected-color: #fff;
+@tree-directory-selected-bg: @primary-color;
// Collapse
// ---
-@collapse-header-padding: 12px 0 12px 40px;
-@collapse-header-bg: @background-color-light;
-@collapse-content-padding: @padding-md;
-@collapse-content-bg: @component-background;
+@collapse-header-padding: 12px 0 12px 40px;
+@collapse-header-bg: @background-color-light;
+@collapse-content-padding: @padding-md;
+@collapse-content-bg: @component-background;
// Skeleton
// ---
-@skeleton-color: #f2f2f2;
+@skeleton-color: #f2f2f2;
// Transfer
// ---
-@transfer-disabled-bg: @disabled-bg;
+@transfer-disabled-bg: @disabled-bg;
// Message
// ---
-@message-notice-content-padding: 10px 16px;
+@message-notice-content-padding: 10px 16px;
// Motion
// ---
@@ -518,24 +520,24 @@
// Alert
// ---
-@alert-success-border-color: ~`colorPalette("@{success-color}", 3)`;
-@alert-success-bg-color: ~`colorPalette("@{success-color}", 1)`;
+@alert-success-border-color: ~`colorPalette('@{success-color}', 3) `;
+@alert-success-bg-color: ~`colorPalette('@{success-color}', 1) `;
@alert-success-icon-color: @success-color;
-@alert-info-border-color: ~`colorPalette("@{info-color}", 3)`;
-@alert-info-bg-color: ~`colorPalette("@{info-color}", 1)`;
+@alert-info-border-color: ~`colorPalette('@{info-color}', 3) `;
+@alert-info-bg-color: ~`colorPalette('@{info-color}', 1) `;
@alert-info-icon-color: @info-color;
-@alert-warning-border-color: ~`colorPalette("@{warning-color}", 3)`;
-@alert-warning-bg-color: ~`colorPalette("@{warning-color}", 1)`;
+@alert-warning-border-color: ~`colorPalette('@{warning-color}', 3) `;
+@alert-warning-bg-color: ~`colorPalette('@{warning-color}', 1) `;
@alert-warning-icon-color: @warning-color;
-@alert-error-border-color: ~`colorPalette("@{error-color}", 3)`;
-@alert-error-bg-color: ~`colorPalette("@{error-color}", 1)`;
+@alert-error-border-color: ~`colorPalette('@{error-color}', 3) `;
+@alert-error-bg-color: ~`colorPalette('@{error-color}', 1) `;
@alert-error-icon-color: @error-color;
// List
// ---
-@list-empty-text-padding: @padding-md;
-@list-item-padding: @padding-sm 0;
-@list-item-content-margin: 0 0 @padding-md 0;
-@list-item-meta-margin-bottom: @padding-md;
-@list-item-meta-avatar-margin-right: @padding-md;
-@list-item-meta-title-margin-bottom: @padding-sm;
+@list-empty-text-padding: @padding-md;
+@list-item-padding: @padding-sm 0;
+@list-item-content-margin: 0 0 @padding-md 0;
+@list-item-meta-margin-bottom: @padding-md;
+@list-item-meta-avatar-margin-right: @padding-md;
+@list-item-meta-title-margin-bottom: @padding-sm;
diff --git a/components/style/v2-compatible-reset.less b/components/style/v2-compatible-reset.less
index c60350ebb0..7fe3a6d7ea 100644
--- a/components/style/v2-compatible-reset.less
+++ b/components/style/v2-compatible-reset.less
@@ -3,7 +3,44 @@
// or
// @import '~antd/style/v2-compatible-reset.css';
// unify the setting of elements's margin and padding for browsers
-body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,hr,button,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
+body,
+div,
+dl,
+dt,
+dd,
+ul,
+ol,
+li,
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+pre,
+code,
+form,
+fieldset,
+legend,
+input,
+textarea,
+p,
+blockquote,
+th,
+td,
+hr,
+button,
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+menu,
+nav,
+section {
margin: 0;
padding: 0;
}
diff --git a/components/switch/__tests__/index.test.js b/components/switch/__tests__/index.test.js
index 89b07233e2..6c04caebf7 100644
--- a/components/switch/__tests__/index.test.js
+++ b/components/switch/__tests__/index.test.js
@@ -8,7 +8,10 @@ describe('Switch', () => {
it('should has click wave effect', async () => {
const wrapper = mount(