Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dark palette preview #20281

Merged
merged 116 commits into from
Dec 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
3b112e0
fix: process-tail-color
ycjcl868 Dec 16, 2019
70ea42a
fix: slider color
ycjcl868 Dec 16, 2019
dae4e4f
fix: primary color , fix select item bg
ycjcl868 Dec 16, 2019
e53a05c
tmp: not merge
ycjcl868 Dec 16, 2019
8ffcbe4
feat: change theme
ycjcl868 Dec 18, 2019
4760877
feat: dark theme change
ycjcl868 Dec 18, 2019
9fc3afe
fix: dark css dist error caused by variables
PeachScript Dec 18, 2019
ae69b13
Merge pull request #20336 from PeachScript/hotfix/fix-dark-css
ycjcl868 Dec 18, 2019
f20c746
fix: change dark theme
ycjcl868 Dec 18, 2019
13928fb
fix: bg
ycjcl868 Dec 18, 2019
ab356f9
fix: compile
ycjcl868 Dec 18, 2019
2aa9ab6
chore: use dark-vars.js
ycjcl868 Dec 18, 2019
d80d65f
fix: lint
ycjcl868 Dec 18, 2019
9630712
fix: demo style
ycjcl868 Dec 18, 2019
f9e9ab7
fix: site script
ycjcl868 Dec 20, 2019
6a96299
Merge 4.0-prepare into feat-dark-palette
ycjcl868 Dec 20, 2019
b2576d9
Merge origin/4.0-prepare into feat-dark-palette
ycjcl868 Dec 20, 2019
b241e9d
fix: componentPage
ycjcl868 Dec 20, 2019
d60b736
Merge origin/4.0-prepare into feat-dark-palette
ycjcl868 Dec 21, 2019
d316190
fix: picker dark theme
ycjcl868 Dec 21, 2019
608c000
fix: mentions bg
ycjcl868 Dec 21, 2019
b15458f
fix: dark theme
ycjcl868 Dec 21, 2019
65695f4
Merge origin/4.0-prepare into feat-dark-palette
ycjcl868 Dec 23, 2019
4895c3d
fix: dark theme
ycjcl868 Dec 23, 2019
7fe9214
fix: icon
ycjcl868 Dec 23, 2019
5d0aa4a
fix: grid
ycjcl868 Dec 23, 2019
0f445dd
fix: code style
ycjcl868 Dec 23, 2019
242f573
fix: theme demo
ycjcl868 Dec 23, 2019
5163b24
feat: code block dark theme
ycjcl868 Dec 23, 2019
cbfc052
dark theme sync
chenshuai2144 Dec 23, 2019
74d035d
update logo text
chenshuai2144 Dec 23, 2019
194bf36
fix: site code action icon
ycjcl868 Dec 23, 2019
31234f1
fix: conflict
ycjcl868 Dec 23, 2019
6477b46
fix: data-theme
ycjcl868 Dec 23, 2019
1188d5e
fix: theme
ycjcl868 Dec 23, 2019
7acab87
Merge origin/4.0-prepare into feat-dark-palette
ycjcl868 Dec 23, 2019
60eca31
fix: localStorage
ycjcl868 Dec 23, 2019
2f27354
fix: default
ycjcl868 Dec 23, 2019
30b3720
fix: token
ycjcl868 Dec 23, 2019
f4e198c
fix: switch dark
ycjcl868 Dec 23, 2019
27ce701
fix: border-color
ycjcl868 Dec 23, 2019
0f54669
fix: steps styles
ycjcl868 Dec 23, 2019
180effc
fix: steps icon
ycjcl868 Dec 23, 2019
3a38cfa
fix: card, form site dark theme
ycjcl868 Dec 23, 2019
589dfdc
load all less file
chenshuai2144 Dec 23, 2019
52e9c20
Merge origin/4.0-prepare into feat-dark-palette
ycjcl868 Dec 24, 2019
2136dca
fix: add timestamp
ycjcl868 Dec 24, 2019
da0e1d2
fix: for removing cache
ycjcl868 Dec 24, 2019
f234fca
fix: timestamp
ycjcl868 Dec 24, 2019
b1ac37e
fix: location theme
ycjcl868 Dec 24, 2019
b50590c
fix: update merge-less
ycjcl868 Dec 24, 2019
c352a17
fix: steps custom icon style
ycjcl868 Dec 24, 2019
589750d
fix: dark.css theme in site
ycjcl868 Dec 24, 2019
9049e08
fix: generateColor
ycjcl868 Dec 24, 2019
1a98feb
fix: concurrently build site
ycjcl868 Dec 24, 2019
6a7752a
fix: steps custom-icon
ycjcl868 Dec 24, 2019
c10a6f0
fix: demo style
ycjcl868 Dec 24, 2019
a70560a
Merge 4.0-prepare into feat-dark-palette
ycjcl868 Dec 24, 2019
6c60379
fix: switch fixed icon
ycjcl868 Dec 24, 2019
2e8d5d3
fix: icons
ycjcl868 Dec 25, 2019
057c4a6
fix: menu pop submenu theme
ycjcl868 Dec 25, 2019
35c01f6
fix: descriptions bg
ycjcl868 Dec 25, 2019
fb44177
fix: dark theme fixed
ycjcl868 Dec 25, 2019
3698d7d
up antd-pro-merge-less
chenshuai2144 Dec 25, 2019
5dbfe42
fix: Icon dark theme
ycjcl868 Dec 25, 2019
957b1ac
fix: calendar style hover
ycjcl868 Dec 25, 2019
839ed3e
fix: table site dark style
ycjcl868 Dec 25, 2019
5a80917
fix: checkbox en doc style
ycjcl868 Dec 25, 2019
cc2b5dd
fix: icon, dropdown style
ycjcl868 Dec 25, 2019
c100b89
fix: table dark theme style
ycjcl868 Dec 25, 2019
2af4c84
fix: table header sort active bg
ycjcl868 Dec 25, 2019
82b73c7
fix: icons
ycjcl868 Dec 25, 2019
76f31cb
fix: list demo dark style
ycjcl868 Dec 25, 2019
bd8564e
fix: form demo dark style
ycjcl868 Dec 25, 2019
ceaf191
fix: tabs dark demo
ycjcl868 Dec 25, 2019
d0dc06a
fix: tag demo style
ycjcl868 Dec 25, 2019
2c3c39f
fix: drawer style
ycjcl868 Dec 25, 2019
f7cfb21
fix: calendar-full background
ycjcl868 Dec 25, 2019
18099c7
fix: use presetDarkPalettes
ycjcl868 Dec 25, 2019
56530f1
fix: backtop demo
ycjcl868 Dec 25, 2019
4dc860d
Merge origin/4.0-prepare into feat-dark-palette
ycjcl868 Dec 25, 2019
f1c8dc7
fix: result error icon demo
ycjcl868 Dec 25, 2019
ca77c02
fix: Progress steps item bg
ycjcl868 Dec 25, 2019
c6fa94c
fix: picker-date hover range color
ycjcl868 Dec 25, 2019
0431074
fix: collapse custom demo style
ycjcl868 Dec 25, 2019
7215fee
fix: alert component dark theme
ycjcl868 Dec 25, 2019
bd2633d
Merge 4.0-prepare into feat-dark-palette
ycjcl868 Dec 25, 2019
51b118e
fix: empty svg
ycjcl868 Dec 25, 2019
fa0da12
fix: Modal icon
ycjcl868 Dec 25, 2019
27a3758
fix: input group demo dark
ycjcl868 Dec 25, 2019
f866fac
fix: demo margin in dark
ycjcl868 Dec 25, 2019
0f9ee82
fix: card demo inner
ycjcl868 Dec 25, 2019
607e697
fix: demo style
ycjcl868 Dec 25, 2019
53a2254
fix: site code block
ycjcl868 Dec 25, 2019
e9c5667
Merge origin/4.0-prepare into feat-dark-palette
ycjcl868 Dec 26, 2019
2dc8316
fix: empty dark image
ycjcl868 Dec 26, 2019
8a8557b
fix: site icon
ycjcl868 Dec 26, 2019
6c318d8
fix: layout demo
ycjcl868 Dec 26, 2019
4508287
fix: menu popup dark color
ycjcl868 Dec 26, 2019
6921bd4
fix: checkbox demo dark
ycjcl868 Dec 26, 2019
79867a9
fix: site toc dark bg
ycjcl868 Dec 26, 2019
8795a31
fix: theme static demo border
ycjcl868 Dec 26, 2019
8a7beb0
fix: dropdown menu
ycjcl868 Dec 26, 2019
78c8647
fix: https image url
ycjcl868 Dec 26, 2019
01a6ac5
fix: site theme switch text
ycjcl868 Dec 26, 2019
483f25d
fix: site dark theme search
ycjcl868 Dec 26, 2019
a8579af
Merge origin/4.0-prepare into feat-dark-palette
ycjcl868 Dec 26, 2019
3a527c6
fix: docs Menu api
ycjcl868 Dec 26, 2019
0306096
chore: update snapshot
ycjcl868 Dec 26, 2019
050fff7
fix: code block color
ycjcl868 Dec 26, 2019
7ff2c7c
fix: lint
ycjcl868 Dec 26, 2019
f36b4de
Merge origin/4.0-prepare into feat-dark-palette
ycjcl868 Dec 26, 2019
cb788dc
chore: update snapshot
ycjcl868 Dec 26, 2019
9d20cb4
tweak: antd.dark.min.css bundlesize
ycjcl868 Dec 26, 2019
e5bc8ba
fix: style:lint
ycjcl868 Dec 26, 2019
090f258
fix: lint
ycjcl868 Dec 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions .antd-tools.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const fs = require('fs');
const path = require('path');
// eslint-disable-next-line import/no-extraneous-dependencies
const lessToJs = require('less-vars-to-js');
const packageInfo = require('./package.json');
const darkVars = require('./scripts/dark-vars');

// We need compile additional content for antd user
function finalizeCompile() {
Expand Down Expand Up @@ -70,20 +70,10 @@ function finalizeDist() {
console.log('Built a entry less file to dist/antd.dark.less');

// Build dark.js: dist/dark-theme.js, for less-loader
const stylePath = path.join(process.cwd(), 'components', 'style');

const colorLess = fs.readFileSync(path.join(stylePath, 'color', 'colors.less'), 'utf8');
const defaultLess = fs.readFileSync(path.join(stylePath, 'themes', 'default.less'), 'utf8');
const darkLess = fs.readFileSync(path.join(stylePath, 'themes', 'dark.less'), 'utf8');

const darkPaletteLess = lessToJs(`${colorLess}${defaultLess}${darkLess}`, {
stripPrefix: true,
resolveVariables: false,
});

fs.writeFileSync(
path.join(process.cwd(), 'dist', 'dark-theme.js'),
`module.exports = ${JSON.stringify(darkPaletteLess, null, 2)};`,
`module.exports = ${JSON.stringify(darkVars, null, 2)};`,
);

// eslint-disable-next-line
Expand Down
2 changes: 1 addition & 1 deletion components/alert/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ReactDOM.render(<Alert message="Success Text" type="success" />, mountNode);
```

<style>
.ant-alert {
.code-box-demo .ant-alert {
margin-bottom: 16px;
}
</style>
5 changes: 0 additions & 5 deletions components/alert/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@

@alert-prefix-cls: ~'@{ant-prefix}-alert';

@alert-message-color: @heading-color;
@alert-text-color: @text-color;
@alert-close-color: @text-color-secondary;
@alert-close-hover-color: @icon-color-hover;

.@{alert-prefix-cls} {
.reset-component;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`renders ./components/back-top/demo/basic.md correctly 1`] = `
<div>
Scroll down to see the bottom-right
<strong
style="color:rgba(64, 64, 64, 0.6)"
class="site-back-top-basic"
>
gray
</strong>
Expand Down
14 changes: 13 additions & 1 deletion components/back-top/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,21 @@ ReactDOM.render(
<div>
<BackTop />
Scroll down to see the bottom-right
<strong style={{ color: 'rgba(64, 64, 64, 0.6)' }}> gray </strong>
<strong className="site-back-top-basic"> gray </strong>
button.
</div>,
mountNode,
);
```

```css
.site-back-top-basic {
color: rgba(64, 64, 64, 0.6);
}
```

<style>
[data-theme="dark"] .site-back-top-basic {
color: rgba(255,255,255,.45);
}
</style>
5 changes: 2 additions & 3 deletions components/badge/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1306,12 +1306,11 @@ exports[`renders ./components/badge/demo/no-wrapper.md correctly 1`] = `
</sup>
</span>
<span
class="ant-badge ant-badge-not-a-wrapper"
class="site-badge-count-4 ant-badge ant-badge-not-a-wrapper"
>
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
style="background-color:#fff;color:#999;box-shadow:0 0 0 1px #d9d9d9 inset"
title="4"
>
<span
Expand Down Expand Up @@ -1472,7 +1471,7 @@ exports[`renders ./components/badge/demo/no-wrapper.md correctly 1`] = `
</sup>
</span>
<span
class="ant-badge ant-badge-not-a-wrapper"
class="site-badge-count-109 ant-badge ant-badge-not-a-wrapper"
>
<sup
class="ant-scroll-number ant-badge-count ant-badge-multiple-words"
Expand Down
5 changes: 4 additions & 1 deletion components/badge/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ ReactDOM.render(
.head-example {
width: 42px;
height: 42px;
border-radius: 4px;
border-radius: 2px;
background: #eee;
display: inline-block;
vertical-align: middle;
}
[data-theme="dark"] .head-example {
background: rgba(255,255,255,.12);
}
</style>
19 changes: 14 additions & 5 deletions components/badge/demo/no-wrapper.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,27 @@ import { Badge } from 'antd';
ReactDOM.render(
<div>
<Badge count={25} />
<Badge
count={4}
style={{ backgroundColor: '#fff', color: '#999', boxShadow: '0 0 0 1px #d9d9d9 inset' }}
/>
<Badge count={109} style={{ backgroundColor: '#52c41a' }} />
<Badge count={4} className="site-badge-count-4" />
<Badge className="site-badge-count-109" count={109} style={{ backgroundColor: '#52c41a' }} />
</div>,
mountNode,
);
```

```css
.site-badge-count-4 .ant-badge-count {
background-color: #fff;
color: #999;
box-shadow: 0 0 0 1px #d9d9d9 inset;
}
```

<style>
.ant-badge-not-a-wrapper:not(.ant-badge-status) {
margin-right: 8px;
}
[data-theme="dark"] .site-badge-count-4 .ant-badge-count {
background-color: #141414;
box-shadow: 0 0 0 1px #434343 inset;
}
</style>
5 changes: 4 additions & 1 deletion components/badge/demo/title.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ ReactDOM.render(
.head-example {
width: 42px;
height: 42px;
border-radius: 4px;
border-radius: 2px;
background: #eee;
display: inline-block;
}
[data-theme="dark"] .head-example {
background: rgba(255,255,255,.12);
}
</style>
4 changes: 2 additions & 2 deletions components/button/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ exports[`renders ./components/button/demo/disabled.md correctly 1`] = `
</span>
</button>
<div
style="padding:8px 8px 0 8px;background:rgb(190, 200, 200)"
class="site-button-ghost-wrapper"
>
<button
class="ant-btn ant-btn-background-ghost"
Expand All @@ -257,7 +257,7 @@ exports[`renders ./components/button/demo/disabled.md correctly 1`] = `

exports[`renders ./components/button/demo/ghost.md correctly 1`] = `
<div
style="background:rgb(190, 200, 200);padding:26px 16px 16px"
class="site-button-ghost-wrapper"
>
<button
class="ant-btn ant-btn-primary ant-btn-background-ghost"
Expand Down
9 changes: 8 additions & 1 deletion components/button/demo/disabled.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ReactDOM.render(
<Button danger disabled>
Danger Default(disabled)
</Button>
<div style={{ padding: '8px 8px 0 8px', background: 'rgb(190, 200, 200)' }}>
<div className="site-button-ghost-wrapper">
<Button ghost>Ghost</Button>
<Button ghost disabled>
Ghost(disabled)
Expand All @@ -57,3 +57,10 @@ ReactDOM.render(
mountNode,
);
```

```css
.site-button-ghost-wrapper {
padding: 8px 8px 0 8px;
background: rgb(190, 200, 200);
}
```
9 changes: 8 additions & 1 deletion components/button/demo/ghost.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ title:
import { Button } from 'antd';

ReactDOM.render(
<div style={{ background: 'rgb(190, 200, 200)', padding: '26px 16px 16px' }}>
<div className="site-button-ghost-wrapper">
<Button type="primary" ghost>
Primary
</Button>
Expand All @@ -38,3 +38,10 @@ ReactDOM.render(
mountNode,
);
```

```css
.site-button-ghost-wrapper {
background: rgb(190, 200, 200);
padding: 26px 16px 16px;
}
```
3 changes: 3 additions & 0 deletions components/button/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,7 @@ Following the Ant Design specification, we will add one space between if Button
[id^=components-button-demo-] .ant-btn-group > span > .ant-btn {
margin-right: 0;
}
[data-theme="dark"] .site-button-ghost-wrapper {
background: rgba(255, 255, 255, 0.3);
}
</style>
3 changes: 3 additions & 0 deletions components/button/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ subtitle: 按钮
[id^="components-button-demo-"] .ant-btn-group > .ant-btn {
margin-right: 0;
}
[data-theme="dark"] .site-button-ghost-wrapper {
background: rgba(255, 255, 255, 0.3);
}
</style>
4 changes: 2 additions & 2 deletions components/calendar/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `

exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
<div
style="width:300px;border:1px solid #f0f0f0;border-radius:4px"
class="site-calendar-demo-card"
>
<div
class="ant-picker-calendar ant-picker-calendar-mini"
Expand Down Expand Up @@ -1906,7 +1906,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `

exports[`renders ./components/calendar/demo/customize-header.md correctly 1`] = `
<div
style="width:300px;border:1px solid #d9d9d9;border-radius:4px"
class="site-calendar-customize-header-wrapper"
>
<div
class="ant-picker-calendar ant-picker-calendar-mini"
Expand Down
16 changes: 15 additions & 1 deletion components/calendar/demo/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,23 @@ function onPanelChange(value, mode) {
}

ReactDOM.render(
<div style={{ width: 300, border: '1px solid #f0f0f0', borderRadius: 4 }}>
<div className="site-calendar-demo-card">
<Calendar fullscreen={false} onPanelChange={onPanelChange} />
</div>,
mountNode,
);
```

```css
.site-calendar-demo-card {
width: 300px;
border: 1px solid #f0f0f0;
border-radius: 4px;
}
```

<style>
[data-theme="dark"] .site-calendar-demo-card {
border: 1px solid #303030;
}
</style>
16 changes: 15 additions & 1 deletion components/calendar/demo/customize-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function onPanelChange(value, mode) {
}

ReactDOM.render(
<div style={{ width: 300, border: '1px solid #d9d9d9', borderRadius: 4 }}>
<div className="site-calendar-customize-header-wrapper">
<Calendar
fullscreen={false}
headerRender={({ value, type, onChange, onTypeChange }) => {
Expand Down Expand Up @@ -105,3 +105,17 @@ ReactDOM.render(
mountNode,
);
```

```css
.site-calendar-customize-header-wrapper {
width: 300px;
border: 1px solid #d9d9d9;
border-radius: 4px;
}
```

<style>
[data-theme="dark"] .site-calendar-customize-header-wrapper {
border: 1px solid #303030;
}
</style>
4 changes: 3 additions & 1 deletion components/calendar/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

.@{calendar-prefix-cls} {
.reset-component;
background: @calendar-bg;
background: @calendar-full-bg;

// ========================= Header =========================
&-header {
Expand All @@ -29,6 +29,7 @@
}

.@{calendar-picker-prefix-cls}-panel {
background: @calendar-full-panel-bg;
border: 0;
border-top: @border-width-base @border-style-base @border-color-split;
border-radius: 0;
Expand Down Expand Up @@ -83,6 +84,7 @@
display: block;
width: 100%;
text-align: right;
background: @calendar-full-bg;
border: 0;

.@{calendar-picker-prefix-cls}-body {
Expand Down
6 changes: 3 additions & 3 deletions components/card/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ exports[`renders ./components/card/demo/basic.md correctly 1`] = `

exports[`renders ./components/card/demo/border-less.md correctly 1`] = `
<div
style="background:#ECECEC;padding:30px"
class="site-card-border-less-wrapper"
>
<div
class="ant-card"
Expand Down Expand Up @@ -229,7 +229,7 @@ exports[`renders ./components/card/demo/grid-card.md correctly 1`] = `

exports[`renders ./components/card/demo/in-column.md correctly 1`] = `
<div
style="background:#ECECEC;padding:30px"
class="site-card-wrapper"
>
<div
class="ant-row"
Expand Down Expand Up @@ -341,7 +341,7 @@ exports[`renders ./components/card/demo/inner.md correctly 1`] = `
class="ant-card-body"
>
<p
style="font-size:14px;color:rgba(0, 0, 0, 0.85);margin-bottom:16px;font-weight:500"
class="site-card-demo-inner-p"
>
Group title
</p>
Expand Down
15 changes: 14 additions & 1 deletion components/card/demo/border-less.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A borderless card on a gray background.
import { Card } from 'antd';

ReactDOM.render(
<div style={{ background: '#ECECEC', padding: '30px' }}>
<div className="site-card-border-less-wrapper">
<Card title="Card title" bordered={false} style={{ width: 300 }}>
<p>Card content</p>
<p>Card content</p>
Expand All @@ -27,3 +27,16 @@ ReactDOM.render(
mountNode,
);
```

```css
.site-card-border-less-wrapper {
background: #ececec;
padding: 30px;
}
```

<style>
[data-theme="dark"] .site-card-border-less-wrapper {
background: #303030;
}
</style>
Loading