From d1eea7d5984887a7bec2fd8fa59dcf867b6564c4 Mon Sep 17 00:00:00 2001 From: Yuxuan Huo Date: Mon, 19 Oct 2020 12:01:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20modal,=20switch=20icloud-theme=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui-theme/icloud-theme/src/colors.js | 2 +- packages/ui-theme/osui-theme/src/colors.js | 2 +- .../ui/docs/icloud/stories/modal/index.stories.mdx | 2 +- .../ui/docs/icloud/stories/switch/index.stories.mdx | 6 ++++-- .../ui/docs/icloud/stories/switch/index.stories.tsx | 11 +++++++++++ packages/ui/modal/src/index.less | 2 +- packages/ui/modal/stories/icloud.stories.mdx | 2 +- packages/ui/switch/src/index.less | 4 ++++ packages/ui/switch/stories/icloud.stories.mdx | 6 ++++-- packages/ui/switch/stories/icloud.stories.tsx | 11 +++++++++++ 10 files changed, 39 insertions(+), 9 deletions(-) diff --git a/packages/ui-theme/icloud-theme/src/colors.js b/packages/ui-theme/icloud-theme/src/colors.js index e728ee02..a9dec03f 100644 --- a/packages/ui-theme/icloud-theme/src/colors.js +++ b/packages/ui-theme/icloud-theme/src/colors.js @@ -412,7 +412,7 @@ exports.presetColors = { '--form-item-explain-icon-display': 'none', '--modal-body-border-bottom': '1px solid var(--theme-border-color-split)', '--modal-footer-border-top': 'none', - '--modal-body-margin': '0 30px', + '--modal-body-padding': '0 30px', '--popover-font-size': '12px', '--popover-line-height': '20px', ...buttonColors, diff --git a/packages/ui-theme/osui-theme/src/colors.js b/packages/ui-theme/osui-theme/src/colors.js index da7116f2..92d0f280 100644 --- a/packages/ui-theme/osui-theme/src/colors.js +++ b/packages/ui-theme/osui-theme/src/colors.js @@ -438,7 +438,7 @@ exports.presetColors = { '--form-item-explain-icon-display': 'inline-block', '--modal-body-border-bottom': 'none', '--modal-footer-border-top': '1px solid var(--theme-border-color-split)', - '--modal-body-margin': '0', + '--modal-body-padding': '0', '--popover-font-size': '14px', '--popover-line-height': '1.5715', ...buttonColors, diff --git a/packages/ui/docs/icloud/stories/modal/index.stories.mdx b/packages/ui/docs/icloud/stories/modal/index.stories.mdx index fce4c870..25f383a2 100644 --- a/packages/ui/docs/icloud/stories/modal/index.stories.mdx +++ b/packages/ui/docs/icloud/stories/modal/index.stories.mdx @@ -1,7 +1,7 @@ import {Meta, Story, Preview} from '@storybook/addon-docs/blocks'; import * as stories from './index.stories' - + # OSUI Modal diff --git a/packages/ui/docs/icloud/stories/switch/index.stories.mdx b/packages/ui/docs/icloud/stories/switch/index.stories.mdx index bf1e3074..5a4c495b 100644 --- a/packages/ui/docs/icloud/stories/switch/index.stories.mdx +++ b/packages/ui/docs/icloud/stories/switch/index.stories.mdx @@ -13,8 +13,10 @@ import * as stories from './index.stories' 支持所有antd属性:见[antd文档](https://ant.design/components/switch-cn/#API) - - + + + + diff --git a/packages/ui/docs/icloud/stories/switch/index.stories.tsx b/packages/ui/docs/icloud/stories/switch/index.stories.tsx index b77cfcd2..b4844a92 100644 --- a/packages/ui/docs/icloud/stories/switch/index.stories.tsx +++ b/packages/ui/docs/icloud/stories/switch/index.stories.tsx @@ -19,3 +19,14 @@ export const Demo = () => { ); }; + + +export const Size = () => { + return ( + <> + +
+ + + ); +}; diff --git a/packages/ui/modal/src/index.less b/packages/ui/modal/src/index.less index 3eb38896..e54c2899 100644 --- a/packages/ui/modal/src/index.less +++ b/packages/ui/modal/src/index.less @@ -12,7 +12,7 @@ .ant-modal-body { border-bottom: var(--modal-body-border-bottom); - margin: var(--modal-body-margin); + padding: var(--modal-body-padding); } .ant-modal-footer { diff --git a/packages/ui/modal/stories/icloud.stories.mdx b/packages/ui/modal/stories/icloud.stories.mdx index 5e36ee65..53c3ffd8 100644 --- a/packages/ui/modal/stories/icloud.stories.mdx +++ b/packages/ui/modal/stories/icloud.stories.mdx @@ -42,5 +42,5 @@ import * as stories from './icloud.stories' ## 根据内容自适应高度 - + diff --git a/packages/ui/switch/src/index.less b/packages/ui/switch/src/index.less index e440e542..cff9b641 100644 --- a/packages/ui/switch/src/index.less +++ b/packages/ui/switch/src/index.less @@ -3,6 +3,10 @@ .@{osui-switch-class-prefix} { &.ant-switch { min-width: var(--switch-min-width); + + &.ant-switch-small { + min-width: 28px; + } } &.ant-switch-disabled { diff --git a/packages/ui/switch/stories/icloud.stories.mdx b/packages/ui/switch/stories/icloud.stories.mdx index ab21e7ac..5e2680f9 100644 --- a/packages/ui/switch/stories/icloud.stories.mdx +++ b/packages/ui/switch/stories/icloud.stories.mdx @@ -13,8 +13,10 @@ import * as stories from './icloud.stories' 支持所有antd属性:见[antd文档](https://ant.design/components/switch-cn/#API) - - + + + + diff --git a/packages/ui/switch/stories/icloud.stories.tsx b/packages/ui/switch/stories/icloud.stories.tsx index c61de7e4..08f47b5d 100644 --- a/packages/ui/switch/stories/icloud.stories.tsx +++ b/packages/ui/switch/stories/icloud.stories.tsx @@ -19,3 +19,14 @@ export const Demo = () => { ); }; + + +export const Size = () => { + return ( + <> + +
+ + + ); +}; -- Gitee