diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index fc3fcfb514..e37b91adea 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -251,7 +251,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi - Add Input.Textarea, Input[type='textArea'] will be deprecated. [pull/6138](https://github.com/ant-design/ant-design/pull/6138) - LocaleProvider supporting Thai. [pull/6721](https://github.com/ant-design/ant-design/pull/6721) [@koobitor](https://github.com/koobitor) - Mention support `focus` function. [#6135](https://github.com/ant-design/ant-design/issues/6135) -- Menu[mode='inline'] could be collapsed, and use `context` to pass `collapsed` prop from Layout.Sider to Menu, don't need customized css code anymore. [pull/6686](https://github.com/ant-design/ant-design/pull/6686) +- Menu inline mode could be collapsed by `inlineCollapsed`, and use `context` to pass `collapsed` prop from Layout.Sider to Menu, don't need customized css code anymore. [pull/6686](https://github.com/ant-design/ant-design/pull/6686) - Add Pagination `itemRender`, now you can customize the structure of page number. [25a603](https://github.com/ant-design/ant-design/commit/25a60322e5c6649522fb9f0d34919eba0ccb1f65) - Add Tooltip `autoAdjustOverflow` prop, now the auto adjust feature can be disabled. [pull/6661](https://github.com/ant-design/ant-design/pull/6661) [@jdz321](https://github.com/jdz321) - Fix errors in docs of Avatar. [pull/6711](https://github.com/ant-design/ant-design/pull/6711) [@llaski](https://github.com/llaski) @@ -667,7 +667,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi - Fix that `Cannot find module '../../package.json'` error. [#4935](https://github.com/ant-design/ant-design/issues/4935) - Fix definitions of Table, RangePicker and Upload. - Fix lack of event argument for Modal `onOk` `afterClose` and Popconfirm `onConfirm` `onCancel`. [#4787](https://github.com/ant-design/ant-design/issues/4787) -- Improve animation of Menu[inline] and Collapse. +- Improve animation of Menu inline mode and Collapse. - Improve Checkbox and Radio vertical align style. - Table - Fix misplace header when fix column. [#4936](https://github.com/ant-design/ant-design/issues/4936) diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index d4f9f62fce..eb008d6c91 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -250,7 +250,7 @@ timeline: true - 新增 Input.TextArea,原 Input[type='textArea'] 将被废弃。[pull/6138](https://github.com/ant-design/ant-design/pull/6138) - LocaleProvider 新增泰语支持。[pull/6721](https://github.com/ant-design/ant-design/pull/6721) [@koobitor](https://github.com/koobitor) - Mention 支持 `focus` 方法。[#6135](https://github.com/ant-design/ant-design/issues/6135) -- Menu[mode='inline'] 支持缩起/展开,同时 Layout.Sider 使用 `context` 向 Menu 传递 `collapsed` 属性,无需再自己定制样式。[pull/6686](https://github.com/ant-design/ant-design/pull/6686) +- Menu `inline` 模式下支持用 `inlineCollapsed` 属性缩起/展开,同时 Layout.Sider 使用 `context` 向 Menu 传递 `collapsed` 属性,无需再自己定制样式。[pull/6686](https://github.com/ant-design/ant-design/pull/6686) - 新增 Pagination `itemRender` 属性,用于自定义页码的结构。[25a603](https://github.com/ant-design/ant-design/commit/25a60322e5c6649522fb9f0d34919eba0ccb1f65) - 新增 Tooltip `autoAdjustOverflow` 属性,支持关闭自动调整位置的功能。[pull/6661](https://github.com/ant-design/ant-design/pull/6661) [@jdz321](https://github.com/jdz321) - 修复了 Avatar 错误的文档。[pull/6711](https://github.com/ant-design/ant-design/pull/6711) [@llaski](https://github.com/llaski) @@ -665,7 +665,7 @@ timeline: true - 修复 `Cannot find module '../../package.json'` 的问题。[#4935](https://github.com/ant-design/ant-design/issues/4935) - 补充了 Table、RangePicker 和 Upload 的部分属性定义。 - 修复了 Modal `onOk` `afterClose` 和 Popconfirm `onConfirm` `onCancel` 缺少点击 event 参数的问题。 [#4787](https://github.com/ant-design/ant-design/issues/4787) -- 优化 Menu[inline] 和 Collapse 的折叠动画效果。 +- 优化 Menu inline 模式和 Collapse 的折叠动画效果。 - 优化了 Checkbox 和 Radio 的垂直对齐样式。 - Table - 修复固定列时列头样式错位的问题。[#4936](https://github.com/ant-design/ant-design/issues/4936) diff --git a/components/checkbox/style/mixin.less b/components/checkbox/style/mixin.less index e897a1869b..c7490921d0 100644 --- a/components/checkbox/style/mixin.less +++ b/components/checkbox/style/mixin.less @@ -44,21 +44,23 @@ top: 0; left: 0; display: block; - width: 14px; - height: 14px; + width: @checkbox-size; + height: @checkbox-size; border: @border-width-base @border-style-base @border-color-base; border-radius: @border-radius-sm; background-color: #fff; transition: all .3s; &:after { + @check-width: (@checkbox-size / 14) * 5px; + @check-height: (@checkbox-size / 14) * 8px; transform: rotate(45deg) scale(0); position: absolute; - left: 4px; - top: 1px; + left: (@checkbox-size - @check-width) / 2 - 0.5px * (@checkbox-size / 14); + top: (@checkbox-size - @check-height) / 2 - 2px * (@checkbox-size / 14); display: table; - width: 5px; - height: 8px; + width: @check-width; + height: @check-height; border: 2px solid #fff; border-top: 0; border-left: 0; @@ -83,13 +85,15 @@ // 半选状态 .@{checkbox-prefix-cls}-indeterminate .@{checkbox-inner-prefix-cls}:after { + @indeterminate-width: (@checkbox-size / 14) * 8px; + @indeterminate-height: (@checkbox-size / 14) * 1px; content: ' '; transform: scale(1); position: absolute; - left: 2px; - top: 5px; - width: 8px; - height: 1px; + left: (@checkbox-size - 2 - @indeterminate-width) / 2; + top: (@checkbox-size - 3 - @indeterminate-height) / 2; + width: @indeterminate-width; + height: @indeterminate-height; } .@{checkbox-prefix-cls}-indeterminate.@{checkbox-prefix-cls}-disabled .@{checkbox-inner-prefix-cls}:after { @@ -100,11 +104,7 @@ .@{checkbox-prefix-cls}-checked .@{checkbox-inner-prefix-cls}:after { transform: rotate(45deg) scale(1); position: absolute; - left: 4px; - top: 1px; display: table; - width: 5px; - height: 8px; border: 2px solid #fff; border-top: 0; border-left: 0; diff --git a/components/layout/style/index.less b/components/layout/style/index.less index b92d0458a6..f84ebe26e5 100644 --- a/components/layout/style/index.less +++ b/components/layout/style/index.less @@ -52,6 +52,10 @@ /* fix firefox can't set width smaller than content on flex item */ min-width: 0; + &-children { + height: 100%; + } + &-has-trigger { padding-bottom: @layout-trigger-height; } diff --git a/components/style/themes/default.less b/components/style/themes/default.less index 06e377a93c..8de8bd884a 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -142,9 +142,12 @@ @btn-group-border : @primary-7; +// Checkbox +@checkbox-size : 14px; + // Radio buttons -@radio-button-bg : @btn-default-bg; -@radio-button-color : @btn-default-color; +@radio-button-bg : @btn-default-bg; +@radio-button-color : @btn-default-color; // Media queries breakpoints // Extra small screen / phone @@ -228,7 +231,7 @@ @input-padding-vertical-base : 4px; @input-padding-vertical-sm : 1px; @input-padding-vertical-lg : 6px; -@input-placeholder-color : @disabled-color; +@input-placeholder-color : hsv(0, 0, 75%); @input-color : @text-color; @input-border-color : @border-color-base; @input-bg : #fff; diff --git a/docs/spec/introduce.en-US.md b/docs/spec/introduce.en-US.md index f9e0df2b47..2e1c7e4591 100644 --- a/docs/spec/introduce.en-US.md +++ b/docs/spec/introduce.en-US.md @@ -27,9 +27,7 @@ We supply a series of design principles, practical patterns and high quality des - [Ant Design of React](/docs/react/introduce) (official implementation) -
-- - -- - - diff --git a/docs/spec/introduce.zh-CN.md b/docs/spec/introduce.zh-CN.md index 8c957f5235..7b082b70f0 100644 --- a/docs/spec/introduce.zh-CN.md +++ b/docs/spec/introduce.zh-CN.md @@ -27,9 +27,7 @@ Ant Design 是一个致力于提升『用户』和『设计者』使用体验的 - [Ant Design of React](/docs/react/introduce)(官方实现) - -- - -- - - diff --git a/scripts/generateColorLess.js b/scripts/generateColorLess.js index 0dcad3ac11..35ba563fe9 100644 --- a/scripts/generateColorLess.js +++ b/scripts/generateColorLess.js @@ -49,28 +49,26 @@ const reducePlugin = postcss.plugin('reducePlugin', () => { }; }); -async function generateCss() { - const antd = path.resolve(__dirname, '../'); - const entry = path.join(antd, 'components/style/index.less'); - let content = fs.readFileSync(entry).toString(); - const styles = glob.sync(path.join(antd, 'components/*/style/index.less')); - content += '\n'; - styles.forEach((style) => { - content += `@import "${style}";\n`; - }); - content += `@import "${path.join(antd, 'site/theme/static/index.less')}";\n`; - fs.writeFileSync('/tmp/style.less', content); +const antd = path.resolve(__dirname, '../'); +const entry = path.join(antd, 'components/style/index.less'); +let content = fs.readFileSync(entry).toString(); +const styles = glob.sync(path.join(antd, 'components/*/style/index.less')); +content += '\n'; +styles.forEach((style) => { + content += `@import "${style}";\n`; +}); +content += `@import "${path.join(antd, 'site/theme/static/index.less')}";\n`; +fs.writeFileSync('/tmp/style.less', content); - let result = (await less.render.call(less, content, { - paths: [path.join(antd, 'components/style')], - })).css; - - result = (await postcss([ +less.render.call(less, content, { + paths: [path.join(antd, 'components/style')], +}).then(({ css }) => { + return postcss([ reducePlugin, - ]).process(result, { parser: less.parser, from: entry })).css; - + ]).process(css, { parser: less.parser, from: entry }); +}).then(({ css }) => { Object.keys(COLOR_MAP).forEach((key) => { - result = result.replace(new RegExp(key, 'g'), COLOR_MAP[key]); + css = css.replace(new RegExp(key, 'g'), COLOR_MAP[key]); }); const bezierEasing = fs.readFileSync(path.join(antd, 'components/style/color/bezierEasing.less')).toString(); @@ -80,16 +78,14 @@ async function generateCss() { .replace('@import "bezierEasing";', '') .replace('@import "tinyColor";', ''); - result = `${colorPalette}\n${result}`; - result = `${tinyColor}\n${result}`; - result = `${bezierEasing}\n${result}`; - result = `@primary-color: #108ee9;\n${result}`; + css = `${colorPalette}\n${css}`; + css = `${tinyColor}\n${css}`; + css = `${bezierEasing}\n${css}`; + css = `@primary-color: #108ee9;\n${css}`; const siteDir = path.resolve(__dirname, '../_site'); if (!fs.existsSync(siteDir)) { fs.mkdirSync(siteDir); } - fs.writeFileSync(path.resolve(__dirname, '../_site/color.less'), result); -} - -generateCss(); + fs.writeFileSync(path.resolve(__dirname, '../_site/color.less'), css); +}); diff --git a/site/bisheng.config.js b/site/bisheng.config.js index a246e69b56..9fef7cba94 100644 --- a/site/bisheng.config.js +++ b/site/bisheng.config.js @@ -74,7 +74,7 @@ module.exports = { 'create-react-class': 'preact-compat/lib/create-react-class', 'react-router': 'react-router', }); - } else { + } else if (isDev) { config.externals = Object.assign({}, config.externals, { react: 'React', 'react-dom': 'ReactDOM',