fix: card, form site dark theme

This commit is contained in:
ycjcl868 2019-12-23 20:07:56 +08:00
parent 180effc5db
commit 3a38cfaa01
17 changed files with 106 additions and 26 deletions

View File

@ -17,7 +17,7 @@ A borderless card on a gray background.
import { Card } from 'antd'; import { Card } from 'antd';
ReactDOM.render( ReactDOM.render(
<div style={{ background: '#ECECEC', padding: '30px' }}> <div className="site-card-border-less-wrapper">
<Card title="Card title" bordered={false} style={{ width: 300 }}> <Card title="Card title" bordered={false} style={{ width: 300 }}>
<p>Card content</p> <p>Card content</p>
<p>Card content</p> <p>Card content</p>
@ -27,3 +27,16 @@ ReactDOM.render(
mountNode, mountNode,
); );
``` ```
```css
.site-card-border-less-wrapper {
background: #ececec;
padding: 30px;
}
```
<style>
[data-theme="dark"] .site-card-border-less-wrapper {
background: #303030;
}
</style>

View File

@ -17,7 +17,7 @@ Cards usually cooperate with grid column layout in overview page.
import { Card, Col, Row } from 'antd'; import { Card, Col, Row } from 'antd';
ReactDOM.render( ReactDOM.render(
<div style={{ background: '#ECECEC', padding: '30px' }}> <div className="site-card-wrapper">
<Row gutter={16}> <Row gutter={16}>
<Col span={8}> <Col span={8}>
<Card title="Card title" bordered={false}> <Card title="Card title" bordered={false}>
@ -39,3 +39,16 @@ ReactDOM.render(
mountNode, mountNode,
); );
``` ```
```css
.site-card-wrapper {
background: #ececec;
padding: 30px;
}
```
<style>
[data-theme="dark"] .site-card-wrapper {
background: #303030;
}
</style>

View File

@ -47,7 +47,7 @@ class App extends React.Component {
render() { render() {
return ( return (
<div> <div>
<div style={{ borderBottom: '1px solid #E9E9E9' }}> <div className="site-checkbox-all-wrapper">
<Checkbox <Checkbox
indeterminate={this.state.indeterminate} indeterminate={this.state.indeterminate}
onChange={this.onCheckAllChange} onChange={this.onCheckAllChange}
@ -69,3 +69,9 @@ class App extends React.Component {
ReactDOM.render(<App />, mountNode); ReactDOM.render(<App />, mountNode);
``` ```
```css
.site-checkbox-all-wrapper {
border-bottom: 1px solid #e9e9e9;
}
```

View File

@ -56,3 +56,9 @@ interface Option {
| ------- | -------- | ---- | | ------- | -------- | ---- |
| blur() | 移除焦点 | | | blur() | 移除焦点 | |
| focus() | 获取焦点 | | | focus() | 获取焦点 | |
<style>
.site-checkbox-all-wrapper {
border-bottom: 1px solid #303030;
}
</style>

View File

@ -121,10 +121,18 @@ ReactDOM.render(
#components-form-demo-advanced-search .search-result-list { #components-form-demo-advanced-search .search-result-list {
margin-top: 16px; margin-top: 16px;
border: 1px dashed #e9e9e9; border: 1px dashed #e9e9e9;
border-radius: 6px; border-radius: 2px;
background-color: #fafafa; background-color: #fafafa;
min-height: 200px; min-height: 200px;
text-align: center; text-align: center;
padding-top: 80px; padding-top: 80px;
} }
[data-theme="dark"] .ant-advanced-search-form {
background: rgba(255,255,255,0.04);
border: 1px solid #434343;
}
[data-theme="dark"] #components-form-demo-advanced-search .search-result-list {
border: 1px dashed #434343;
background: rgba(255,255,255,0.04);
}
</style> </style>

View File

@ -36,17 +36,14 @@ const HorizontalLoginForm = () => {
name="username" name="username"
rules={[{ required: true, message: 'Please input your username!' }]} rules={[{ required: true, message: 'Please input your username!' }]}
> >
<Input <Input prefix={<UserOutlined className="site-form-item-icon" />} placeholder="Username" />
prefix={<UserOutlined style={{ color: 'rgba(0,0,0,.25)' }} />}
placeholder="Username"
/>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name="password" name="password"
rules={[{ required: true, message: 'Please input your password!' }]} rules={[{ required: true, message: 'Please input your password!' }]}
> >
<Input <Input
prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} prefix={<LockOutlined className="site-form-item-icon" />}
type="password" type="password"
placeholder="Password" placeholder="Password"
/> />

View File

@ -33,17 +33,14 @@ const NormalLoginForm = () => {
name="username" name="username"
rules={[{ required: true, message: 'Please input your Username!' }]} rules={[{ required: true, message: 'Please input your Username!' }]}
> >
<Input <Input prefix={<UserOutlined className="site-form-item-icon" />} placeholder="Username" />
prefix={<UserOutlined style={{ color: 'rgba(0,0,0,.25)' }} />}
placeholder="Username"
/>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name="password" name="password"
rules={[{ required: true, message: 'Please input your Password!' }]} rules={[{ required: true, message: 'Please input your Password!' }]}
> >
<Input <Input
prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} prefix={<LockOutlined className="site-form-item-icon" />}
type="password" type="password"
placeholder="Password" placeholder="Password"
/> />

View File

@ -327,3 +327,12 @@ const TestForm = () => {
Online demo: Online demo:
[![Edit wrappedComponentRef-in-function-component](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/wrappedcomponentref-in-function-component-fj43c?fontsize=14&hidenavigation=1&theme=dark) [![Edit wrappedComponentRef-in-function-component](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/wrappedcomponentref-in-function-component-fj43c?fontsize=14&hidenavigation=1&theme=dark)
<style>
.site-form-item-icon {
color: rgba(0, 0, 0, 0.25);
}
[data-theme="dark"] .site-form-item-icon {
color: rgba(255,255,255,.3);
}
</style>

View File

@ -328,3 +328,12 @@ const TestForm = () => {
在线示例: 在线示例:
[![Edit wrappedComponentRef-in-function-component](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/wrappedcomponentref-in-function-component-fj43c?fontsize=14&hidenavigation=1&theme=dark) [![Edit wrappedComponentRef-in-function-component](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/wrappedcomponentref-in-function-component-fj43c?fontsize=14&hidenavigation=1&theme=dark)
<style>
.site-form-item-icon {
color: rgba(0, 0, 0, 0.25);
}
[data-theme="dark"] .site-form-item-icon {
color: rgba(255,255,255,.3);
}
</style>

View File

@ -110,3 +110,10 @@ If the Ant Design grid layout component does not meet your needs, you can use th
| xxl | `≥1600px`, could be a `span` value or an object containing above props | number\|object | - | | | xxl | `≥1600px`, could be a `span` value or an object containing above props | number\|object | - | |
The breakpoints of responsive grid follow [BootStrap 4 media queries rules](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints)(not including `occasionally part`). The breakpoints of responsive grid follow [BootStrap 4 media queries rules](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints)(not including `occasionally part`).
<style>
[data-theme="dark"] #components-grid-demo-playground pre {
background: rgba(255,255,255,0.8);
color: rgba(255,255,255,.65);
}
</style>

View File

@ -112,7 +112,7 @@ Ant Design 的布局组件若不能满足你的需求,你也可以直接使用
<style> <style>
[data-theme="dark"] #components-grid-demo-playground pre { [data-theme="dark"] #components-grid-demo-playground pre {
background: #1f1f1f; background: rgba(255,255,255,0.08);
color: rgba(255,255,255,.65); color: rgba(255,255,255,.65);
} }
</style> </style>

View File

@ -21,7 +21,7 @@ ReactDOM.render(
<div> <div>
<Input <Input
placeholder="Enter your username" placeholder="Enter your username"
prefix={<UserOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} prefix={<UserOutlined className="site-form-item-icon" />}
suffix={ suffix={
<Tooltip title="Extra information"> <Tooltip title="Extra information">
<InfoCircleOutlined style={{ color: 'rgba(0,0,0,.45)' }} /> <InfoCircleOutlined style={{ color: 'rgba(0,0,0,.45)' }} />

View File

@ -18,11 +18,6 @@ import { Steps } from 'antd';
const { Step } = Steps; const { Step } = Steps;
const stepStyle = {
marginBottom: 60,
boxShadow: '0px -1px 0 0 #e8e8e8 inset',
};
class Demo extends React.Component { class Demo extends React.Component {
state = { state = {
current: 0, current: 0,
@ -42,7 +37,7 @@ class Demo extends React.Component {
size="small" size="small"
current={current} current={current}
onChange={this.onChange} onChange={this.onChange}
style={stepStyle} className="site-navigation-steps"
> >
<Step <Step
title="Step 1" title="Step 1"
@ -63,7 +58,12 @@ class Demo extends React.Component {
description="This is a description." description="This is a description."
/> />
</Steps> </Steps>
<Steps type="navigation" current={current} onChange={this.onChange} style={stepStyle}> <Steps
type="navigation"
current={current}
onChange={this.onChange}
className="site-navigation-steps"
>
<Step status="finish" title="Step 1" /> <Step status="finish" title="Step 1" />
<Step status="process" title="Step 2" /> <Step status="process" title="Step 2" />
<Step status="wait" title="Step 3" /> <Step status="wait" title="Step 3" />
@ -74,7 +74,7 @@ class Demo extends React.Component {
size="small" size="small"
current={current} current={current}
onChange={this.onChange} onChange={this.onChange}
style={stepStyle} className="site-navigation-steps"
> >
<Step status="finish" title="finish 1" /> <Step status="finish" title="finish 1" />
<Step status="finish" title="finish 2" /> <Step status="finish" title="finish 2" />
@ -88,3 +88,10 @@ class Demo extends React.Component {
ReactDOM.render(<Demo />, mountNode); ReactDOM.render(<Demo />, mountNode);
``` ```
```css
.site-navigation-steps {
margin-bottom: 60px;
box-shadow: 0px -1px 0 0 #e8e8e8 inset;
}
```

View File

@ -90,7 +90,7 @@ ReactDOM.render(<App />, mountNode);
.steps-content { .steps-content {
margin-top: 16px; margin-top: 16px;
border: 1px dashed #e9e9e9; border: 1px dashed #e9e9e9;
border-radius: 6px; border-radius: 2px;
background-color: #fafafa; background-color: #fafafa;
min-height: 200px; min-height: 200px;
text-align: center; text-align: center;

View File

@ -57,4 +57,8 @@ A single step in the step bar.
background-color: rgba(255,255,255,0.04); background-color: rgba(255,255,255,0.04);
color: rgba(255,255,255,0.65); color: rgba(255,255,255,0.65);
} }
[data-theme="dark"] .site-navigation-steps {
border-bottom: 1px solid #303030;
box-shadow: none;
}
</style> </style>

View File

@ -58,4 +58,8 @@ title: Steps
background-color: rgba(255,255,255,0.04); background-color: rgba(255,255,255,0.04);
color: rgba(255,255,255,0.65); color: rgba(255,255,255,0.65);
} }
[data-theme="dark"] .site-navigation-steps {
border-bottom: 1px solid #303030;
box-shadow: none;
}
</style> </style>

View File

@ -89,7 +89,7 @@
&-demo { &-demo {
padding: 42px 24px 50px; padding: 42px 24px 50px;
color: rgba(0, 0, 0, 0.65); color: @site-text-color;
border-bottom: 1px solid @site-border-color-split; border-bottom: 1px solid @site-border-color-split;
} }