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: support compact theme #22126

Merged
merged 31 commits into from
Mar 29, 2020
Merged

feat: support compact theme #22126

merged 31 commits into from
Mar 29, 2020

Conversation

AshoneA
Copy link
Contributor

@AshoneA AshoneA commented Mar 11, 2020

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

close #22068

💡 Background and solution

To support compact theme mode.

📝 Changelog

Language Changelog
🇺🇸 English Support compact mode theme
🇨🇳 Chinese 支持紧凑模式主题

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

@tests-checker tests-checker bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add tests to make sure this change works as expected?

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Mar 11, 2020

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 11, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a4f35e5:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Mar 11, 2020

Codecov Report

Merging #22126 into feature will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           feature   #22126   +/-   ##
========================================
  Coverage    98.07%   98.07%           
========================================
  Files          360      360           
  Lines         7224     7224           
  Branches      1975     1975           
========================================
  Hits          7085     7085           
  Misses         139      139

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2cfad04...a4f35e5. Read the comment docs.

@@ -63,6 +63,7 @@ const SITE_THEME_STORE_KEY = 'site-theme';
const timestamp = new Date().getTime();
const themeMap = {
dark: `/dark.css?${timestamp}`,
narrow: `/narrow.css?${timestamp}`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compact.css 好一点。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,叫 compact 感觉更直接一点,到时候我可以批量替换一下。

@afc163 afc163 changed the title feat: support narrow mode theme [WIP] feat: support narrow mode theme Mar 11, 2020
@afc163 afc163 changed the title [WIP] feat: support narrow mode theme [WIP] feat: support compat theme Mar 12, 2020
@afc163 afc163 changed the base branch from master to feature March 13, 2020 03:43

// Pagination
@pagination-item-size: 28px;
@pagination-item-size-sm: 24px; // todo: should more small?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep it -sm.

Copy link
Contributor Author

@AshoneA AshoneA Mar 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,之前留着提醒一下的,后面有跟设计师沟通之后改动还没推,周末我会把这些弄掉推一版。

@AshoneA AshoneA changed the title [WIP] feat: support compat theme [WIP] feat: support compact theme Mar 13, 2020
@afc163
Copy link
Member

afc163 commented Mar 19, 2020

Merge 一下 feature,免得后面冲突更多。

@AshoneA
Copy link
Contributor Author

AshoneA commented Mar 19, 2020

Merge 一下 feature,免得后面冲突更多。

嗯,晚上我来合下。看着 rtl 的改动,想象到的 conflict, 头顶一凉。

{[
{ type: 'default', text: '普通模式' },
{ type: 'dark', text: '暗黑模式' },
{ type: 'compact', text: '紧凑模式' },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认主题 暗黑主题 紧凑主题

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

噢,这边应该用下国际化的。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed d08d721

& &-avatar {
color: #000;
background-color: #fff;
box-shadow: @shadow-2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加个 transition 过渡

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed d08d721

@@ -3,6 +3,8 @@ module.exports = {
messages: {
'app.theme.switch.dark': '切换浅色模式',
'app.theme.switch.default': '切换暗黑模式',
'app.theme.switch.normal': '切换紧凑模式',
'app.theme.switch.compact': '切换普通模式',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好像用不上了。

@ant-design ant-design deleted a comment from todo bot Mar 27, 2020
@ant-design ant-design deleted a comment from todo bot Mar 27, 2020
@AshoneA
Copy link
Contributor Author

AshoneA commented Mar 28, 2020

@zombieJ CI passed.

@afc163
Copy link
Member

afc163 commented Mar 28, 2020

加个 bundlesize limit:

ant-design/package.json

Lines 271 to 274 in c806a83

{
"path": "./dist/antd.dark.min.css",
"maxSize": "65 kB"
}

@AshoneA
Copy link
Contributor Author

AshoneA commented Mar 28, 2020

加个 bundlesize limit:

Fixed 0174586

@AshoneA
Copy link
Contributor Author

AshoneA commented Mar 28, 2020

@afc163 @zombieJ
抽了下生成 dist css 文件,不太确定会不会造成 break,帮忙 review 一下。
a4f35e5

@zombieJ
Copy link
Member

zombieJ commented Mar 29, 2020

准备合了,WIP 标志是不是可以去掉了?

@zombieJ zombieJ changed the title [WIP] feat: support compact theme feat: support compact theme Mar 29, 2020
@zombieJ zombieJ merged commit dda45e4 into feature Mar 29, 2020
@zombieJ zombieJ deleted the feat/narrow-theme branch March 29, 2020 02:39
@zombieJ zombieJ mentioned this pull request Mar 29, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provides narrow theme
5 participants