Skip to content

Commit

Permalink
Merge pull request #934 from XiaoMi/hotfix/theme
Browse files Browse the repository at this point in the history
Hotfix/theme
  • Loading branch information
solarjoker authored Feb 8, 2020
2 parents 0d4f9f2 + 5f6944f commit 7674116
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 11 deletions.
8 changes: 5 additions & 3 deletions components/menu/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@
&--mini {
.hi-menu-item {
&--active {
background-color: rgba($value, 0.1);

&::after {
background-color: $value;
}
Expand All @@ -336,8 +338,8 @@
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15);

.hi-menu-item {
&--active {
background-color: rgba($value, 0.15);
&--active:not(.hi-submenu) {
background-color: rgba($value, 0.1);

&::after {
background-color: $value;
Expand All @@ -347,7 +349,7 @@

.hi-menu__title {
&:hover {
background-color: rgba($value, 0.15);
background-color: rgba($value, 0.1);
}
}
}
Expand Down
26 changes: 23 additions & 3 deletions components/table/style/Table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $borderColor: #e6e7e8 !default;
position: relative;
}

.hi-icon {
.hi-icon.icon-menu {
color: #4284f5;
}

Expand Down Expand Up @@ -461,7 +461,7 @@ $borderColor: #e6e7e8 !default;
@each $key, $value in $theme-colors {
.theme__#{$key}.hi-table {
.hi-table-container table th {
background-color: rgba($value, 0.3);
background-color: rgba($value, 0.1);
color: #83868c;
}

Expand All @@ -470,7 +470,11 @@ $borderColor: #e6e7e8 !default;
color: #83868c;
}

.hi-icon {
.hi-table-container table .hi-table-thead tr:hover {
background-color: #fff;
}

.hi-icon.icon-menu {
color: $value;
}

Expand All @@ -494,5 +498,21 @@ $borderColor: #e6e7e8 !default;
}
}
}

.hi-pagination {
.hi-icon {
color: #666;
}

.hi-icon:hover {
color: $value;
}
}

.hi-pagination:hover > span {
.hi-icon {
color: $value;
}
}
}
}
7 changes: 4 additions & 3 deletions components/tabs/ItemDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class ItemDropdown extends Component {
items,
onChoose,
localeDatas,
activeId
activeId,
theme
} = this.props
const {
visible
Expand All @@ -61,7 +62,7 @@ class ItemDropdown extends Component {
if (item.tabId === activeId) activeIndex = index
})
return (
<div className={classNames('hi-tabs-dropdown', {'hi-tabs-dropdown--active': !!items[activeIndex]})}>
<div className={classNames('hi-tabs-dropdown', `theme__${theme}`, {'hi-tabs-dropdown--active': !!items[activeIndex]})}>
<div className='hi-tabs-dropdown__toggle' ref={node => { this.toggleRef = node }} onClick={e => {
e.stopPropagation()
this.toggle()
Expand All @@ -80,7 +81,7 @@ class ItemDropdown extends Component {
leftGap={-18}
topGap={3}
>
<div className={classNames('hi-tabs-dropdown__items')}>
<div className={classNames('hi-tabs-dropdown__items', `theme__${theme}`)}>
{
items.map((item, index) => {
return (
Expand Down
1 change: 1 addition & 0 deletions components/tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ class Tabs extends Component {
<ItemDropdown
active={activeTabInHiddenItems}
activeId={activeId}
theme={theme}
defaultActiveId={defaultActiveId}
items={hiddenTabItems}
onChoose={(item, e) => {
Expand Down
10 changes: 10 additions & 0 deletions components/tabs/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -323,4 +323,14 @@ $prefix: 'hi-tabs' !default;
}
}
}

.theme__#{$key}.hi-tabs-dropdown__items {
.hi-tabs-dropdown__item:hover {
background-color: rgba($value, 0.1);
}

.hi-tabs-dropdown__item.hi-tabs-dropdown__item--active {
background-color: rgba($value, 0.1);
}
}
}
12 changes: 11 additions & 1 deletion components/tree/TreeItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ class TreeItem extends Component {
apperance,
theme
} = this.props

const themeColor = {
'orange': '#f63',
'cyan': '#46bc99',
'magenta': '#ff5975',
'lavender': '#b450de',
'blue': '#3da8f5',
'purple': '#8a8acb',
'hiui-blue': '#4284f5'
}
const { nodePlaceholder, confirm, cancel } = localeDatas.tree
const treeItem = (
<li
Expand Down Expand Up @@ -131,7 +141,7 @@ class TreeItem extends Component {
}}
/>
<span
style={(editingNodes.find(node => node.id === item.id) || {}).title === '' ? { marginRight: 12, color: '#999' } : { cursor: 'pointer', marginRight: 12, color: '#4284F5' }}
style={(editingNodes.find(node => node.id === item.id) || {}).title === '' ? { marginRight: 12, color: '#999', cursor: 'not-allowed' } : { cursor: 'pointer', marginRight: 12, color: themeColor[theme] }}
onClick={() => {
if ((editingNodes.find(node => node.id === item.id) || {}).title !== '') {
saveEditNode(item.id)
Expand Down
11 changes: 10 additions & 1 deletion components/tree/TreeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ class TreeNode extends Component {

// 高亮检索值
highlightData = (data, highlightValue) => {
const themeColor = {
'orange': '#f63',
'cyan': '#46bc99',
'magenta': '#ff5975',
'lavender': '#b450de',
'blue': '#3da8f5',
'purple': '#8a8acb',
'hiui-blue': '#4284f5'
}
return data.map(item => {
if (typeof item.title === 'string' && item.title.includes(highlightValue)) {
const index = item.title.indexOf(highlightValue)
Expand All @@ -112,7 +121,7 @@ class TreeNode extends Component {
item.title = (
<span>
{beforeStr}
<span style={{ color: '#4284f5' }}>{highlightValue}</span>
<span style={{ color: themeColor[this.props.theme] }}>{highlightValue}</span>
{afterStr}
</span>
)
Expand Down
4 changes: 4 additions & 0 deletions components/tree/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,10 @@ $tree: 'hi-tree' !default;
border: 1px solid $value;
}

.hi-checkbox-legacy__label.highlight {
color: $value;
}

.hi-checkbox-legacy--checked .hi-checkbox-legacy__input {
border: 1px solid $value;
}
Expand Down

0 comments on commit 7674116

Please sign in to comment.