mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-22 22:48:29 +08:00
b9f77fde6c
* feat: migrate less to token for Switch * chore: add demo * chore: code clean * chore: update demo * docs: update docs en * chore: code clean --------- Co-authored-by: MadCcc <1075746765@qq.com>
31 lines
761 B
TypeScript
31 lines
761 B
TypeScript
import React from 'react';
|
|
import { ConfigProvider, Space, Switch } from 'antd';
|
|
|
|
const App: React.FC = () => (
|
|
<ConfigProvider
|
|
theme={{
|
|
components: {
|
|
Switch: {
|
|
trackHeight: 14,
|
|
trackMinWidth: 32,
|
|
// opacityLoading: 0.1,
|
|
colorPrimary: 'rgb(25, 118, 210, 0.5)',
|
|
trackPadding: -3,
|
|
handleSize: 20,
|
|
handleBg: 'rgb(25, 118, 210)',
|
|
handleShadow:
|
|
'rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px',
|
|
// innerMinMargin: 4,
|
|
// innerMaxMargin: 8,
|
|
},
|
|
},
|
|
}}
|
|
>
|
|
<Space>
|
|
<Switch defaultChecked />
|
|
</Space>
|
|
</ConfigProvider>
|
|
);
|
|
|
|
export default App;
|