Skip to content

Commit

Permalink
feat: Add Min-Width Style Variables for Switch Component (#20829)
Browse files Browse the repository at this point in the history
* chore: Export form typescript interface

* Feat -- Min-Width Style Variables for Switch Component

Implementation of feature request from @LuisRodriguezLD

Co-authored-by: 二货机器人 <smith3816@gmail.com>
  • Loading branch information
abdih and zombieJ committed Jan 11, 2020
1 parent 29316b4 commit d70637e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions components/form/index.tsx
@@ -1,5 +1,5 @@
import InternalForm, { useForm, FormInstance } from './Form';
import Item from './FormItem';
import InternalForm, { useForm, FormInstance, FormProps } from './Form';
import Item, { FormItemProps } from './FormItem';
import List from './FormList';
import { FormProvider } from './context';
import warning from '../_util/warning';
Expand Down Expand Up @@ -29,6 +29,6 @@ Form.create = () => {
);
};

export { FormInstance };
export { FormInstance, FormProps, FormItemProps };

export default Form;
2 changes: 2 additions & 0 deletions components/style/themes/default.less
Expand Up @@ -631,6 +631,8 @@
// ---
@switch-height: 22px;
@switch-sm-height: 16px;
@switch-min-width: 44px;
@switch-sm-min-width: 28px;
@switch-sm-checked-margin-left: -(@switch-sm-height - 3px);
@switch-disabled-opacity: 0.4;
@switch-color: @primary-color;
Expand Down
4 changes: 2 additions & 2 deletions components/switch/style/index.less
Expand Up @@ -10,7 +10,7 @@
position: relative;
display: inline-block;
box-sizing: border-box;
min-width: 44px;
min-width: @switch-min-width;
height: @switch-height;
line-height: @switch-height - 2px;
vertical-align: middle;
Expand Down Expand Up @@ -101,7 +101,7 @@
}

&-small {
min-width: 28px;
min-width: @switch-sm-min-width;
height: @switch-sm-height;
line-height: @switch-sm-height - 2px;

Expand Down

0 comments on commit d70637e

Please sign in to comment.