From cbfc052d0d948beb29c0b5f5b383d309bb0740e0 Mon Sep 17 00:00:00 2001 From: chenshuai2144 Date: Mon, 23 Dec 2019 16:02:09 +0800 Subject: [PATCH] dark theme sync --- components/date-picker/style/DecadePanel.less | 1 - components/date-picker/style/MonthPanel.less | 86 --- components/date-picker/style/TimePicker.less | 151 ---- components/date-picker/style/YearPanel.less | 85 --- components/style/themes/default.less | 2 - docs/react/introduce.en-US.md | 4 +- docs/react/introduce.zh-CN.md | 4 +- package.json | 1 + scripts/dart.js | 683 ++++++++++++++++++ scripts/generateColorLess.js | 32 +- site/theme/static/common.less | 4 +- site/theme/static/demo.less | 6 +- site/theme/static/docsearch.less | 4 + site/theme/static/home.less | 20 +- site/theme/static/preview-img.less | 5 +- site/theme/static/responsive.less | 4 +- site/theme/static/toc.less | 4 +- site/theme/template/Layout/index.jsx | 19 + 18 files changed, 754 insertions(+), 361 deletions(-) delete mode 100644 components/date-picker/style/MonthPanel.less delete mode 100644 components/date-picker/style/TimePicker.less delete mode 100644 components/date-picker/style/YearPanel.less create mode 100644 scripts/dart.js diff --git a/components/date-picker/style/DecadePanel.less b/components/date-picker/style/DecadePanel.less index b6b4f20e4e..27c087ffe3 100644 --- a/components/date-picker/style/DecadePanel.less +++ b/components/date-picker/style/DecadePanel.less @@ -17,7 +17,6 @@ } .@{calendar-prefix-cls}-decade-panel-header { - .calendarPanelHeader(~'@{calendar-prefix-cls}-decade-panel'); position: relative; } diff --git a/components/date-picker/style/MonthPanel.less b/components/date-picker/style/MonthPanel.less deleted file mode 100644 index cef00fe8e3..0000000000 --- a/components/date-picker/style/MonthPanel.less +++ /dev/null @@ -1,86 +0,0 @@ -.@{calendar-prefix-cls}-month-panel { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: @zindex-picker-panel; - background: @month-panel-bg; - border-radius: @border-radius-base; - outline: none; - - > div { - display: flex; - flex-direction: column; - // TODO: this is a useless wrapper, and we need to remove it in rc-calendar - height: 100%; - } -} - -.@{calendar-prefix-cls}-month-panel-hidden { - display: none; -} - -.@{calendar-prefix-cls}-month-panel-header { - .calendarPanelHeader(~'@{calendar-prefix-cls}-month-panel'); - position: relative; -} - -.@{calendar-prefix-cls}-month-panel-body { - flex: 1; -} - -.@{calendar-prefix-cls}-month-panel-footer { - border-top: @border-width-base @border-style-base @border-color-split; - .@{calendar-prefix-cls}-footer-extra { - padding: 0 12px; - } -} - -.@{calendar-prefix-cls}-month-panel-table { - width: 100%; - height: 100%; - table-layout: fixed; - border-collapse: separate; -} - -.@{calendar-prefix-cls}-month-panel-selected-cell .@{calendar-prefix-cls}-month-panel-month { - color: @text-color-inverse; - background: @primary-color; - - &:hover { - color: @text-color-inverse; - background: @primary-color; - } -} - -.@{calendar-prefix-cls}-month-panel-cell { - text-align: center; - - &-disabled .@{calendar-prefix-cls}-month-panel-month { - &, - &:hover { - color: @disabled-color; - background: @picker-basic-cell-disabled-bg; - cursor: not-allowed; - } - } -} - -.@{calendar-prefix-cls}-month-panel-month { - display: inline-block; - height: 24px; - margin: 0 auto; - padding: 0 8px; - color: @text-color; - line-height: 24px; - text-align: center; - background: transparent; - border-radius: @border-radius-base; - transition: background 0.3s ease; - - &:hover { - background: @item-hover-bg; - cursor: pointer; - } -} diff --git a/components/date-picker/style/TimePicker.less b/components/date-picker/style/TimePicker.less deleted file mode 100644 index 15374822af..0000000000 --- a/components/date-picker/style/TimePicker.less +++ /dev/null @@ -1,151 +0,0 @@ -.@{calendar-timepicker-prefix-cls} { - position: absolute; - top: 40px; - width: 100%; - background-color: @time-picker-bg; - - &-panel { - position: absolute; - z-index: @zindex-picker; - width: 100%; - } - - &-inner { - position: relative; - display: inline-block; - width: 100%; - overflow: hidden; - font-size: @font-size-base; - line-height: 1.5; - text-align: left; - list-style: none; - background-color: @time-picker-inner-bg; - background-clip: padding-box; - outline: none; - } - &-combobox { - width: 100%; - } - - &-column-1, - &-column-1 &-select { - width: 100%; - } - &-column-2 &-select { - width: 50%; - } - &-column-3 &-select { - width: 33.33%; - } - &-column-4 &-select { - width: 25%; - } - - &-input-wrap { - display: none; - } - - &-select { - position: relative; // Fix chrome weird render bug - float: left; - height: 226px; - overflow: hidden; - font-size: @font-size-base; - border-right: @border-width-base @border-style-base @border-color-split; - - &:hover { - overflow-y: auto; - } - - &:first-child { - margin-left: 0; - border-left: 0; - } - - &:last-child { - border-right: 0; - } - - ul { - width: 100%; - max-height: 206px; - margin: 0; - padding: 0; - list-style: none; - } - - li { - width: 100%; - height: 24px; - margin: 0; - line-height: 24px; - text-align: center; - list-style: none; - cursor: pointer; - transition: all 0.3s; - user-select: none; - - &:last-child::after { - display: block; - height: 202px; - content: ''; - } - - &:hover { - background: @item-hover-bg; - } - - &:focus { - color: @primary-color; - font-weight: 600; - outline: none; - } - } - - li&-option-selected { - font-weight: 600; - background: @time-picker-selected-bg; - } - - li&-option-disabled { - color: @btn-disable-color; - &:hover { - background: transparent; - cursor: not-allowed; - } - } - } -} - -.@{calendar-prefix-cls}-time { - .@{calendar-prefix-cls}-day-select { - display: inline-block; - padding: 0 2px; - color: @heading-color; - font-weight: 500; - line-height: 34px; - } - - .@{calendar-prefix-cls}-footer { - position: relative; - height: auto; - - &-btn { - text-align: right; - } - - .@{calendar-prefix-cls}-today-btn { - float: left; - margin: 0; - } - - .@{calendar-prefix-cls}-time-picker-btn { - display: inline-block; - margin-right: 8px; - - &-disabled { - color: @disabled-color; - } - } - } -} diff --git a/components/date-picker/style/YearPanel.less b/components/date-picker/style/YearPanel.less deleted file mode 100644 index 38f14d855b..0000000000 --- a/components/date-picker/style/YearPanel.less +++ /dev/null @@ -1,85 +0,0 @@ -.@{calendar-prefix-cls}-year-panel { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: @zindex-picker-panel; - background: @year-panel-bg; - border-radius: @border-radius-base; - outline: none; - - > div { - display: flex; - flex-direction: column; - // TODO: this is a useless wrapper, and we need to remove it in rc-calendar - height: 100%; - } -} - -.@{calendar-prefix-cls}-year-panel-hidden { - display: none; -} - -.@{calendar-prefix-cls}-year-panel-header { - .calendarPanelHeader(~'@{calendar-prefix-cls}-year-panel'); - position: relative; -} - -.@{calendar-prefix-cls}-year-panel-body { - flex: 1; -} - -.@{calendar-prefix-cls}-year-panel-footer { - border-top: @border-width-base @border-style-base @border-color-split; - .@{calendar-prefix-cls}-footer-extra { - padding: 0 12px; - } -} - -.@{calendar-prefix-cls}-year-panel-table { - width: 100%; - height: 100%; - table-layout: fixed; - border-collapse: separate; -} - -.@{calendar-prefix-cls}-year-panel-cell { - text-align: center; -} - -.@{calendar-prefix-cls}-year-panel-year { - display: inline-block; - height: 24px; - margin: 0 auto; - padding: 0 8px; - color: @text-color; - line-height: 24px; - text-align: center; - background: transparent; - border-radius: @border-radius-base; - transition: background 0.3s ease; - - &:hover { - background: @item-hover-bg; - cursor: pointer; - } -} - -.@{calendar-prefix-cls}-year-panel-selected-cell .@{calendar-prefix-cls}-year-panel-year { - color: @text-color-inverse; - background: @primary-color; - - &:hover { - color: @text-color-inverse; - background: @primary-color; - } -} - -.@{calendar-prefix-cls}-year-panel-last-decade-cell, -.@{calendar-prefix-cls}-year-panel-next-decade-cell { - .@{calendar-prefix-cls}-year-panel-year { - color: @disabled-color; - user-select: none; - } -} diff --git a/components/style/themes/default.less b/components/style/themes/default.less index 6b94ce57c0..50cc43e65b 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -774,5 +774,3 @@ // Notification // --- @notification-bg: @component-background; - -@import './dark.less'; diff --git a/docs/react/introduce.en-US.md b/docs/react/introduce.en-US.md index 80f9458277..3e400ab1b5 100644 --- a/docs/react/introduce.en-US.md +++ b/docs/react/introduce.en-US.md @@ -6,9 +6,9 @@ title: Ant Design of React Following the Ant Design specification, we developed a React UI library `antd` that contains a set of high quality components and demos for building rich, interactive user interfaces.
- + + - +