Commit 664e9289 authored by niko's avatar niko Committed by GitHub

update style (#21)

parent 268a4ef3
import React from 'react'; import React from 'react';
import { Popover } from 'antd'; import { Tooltip } from 'antd';
import styles from './index.less'; import styles from './index.less';
const MiniProgress = ({ target, color, strokeWidth, percent }) => ( const MiniProgress = ({ target, color, strokeWidth, percent }) => (
<div className={styles.miniProgress}> <div className={styles.miniProgress}>
<Popover title={null} content={`目标值: ${target}%`}> <Tooltip title={`目标值: ${target}%`}>
<div <div
className={styles.target} className={styles.target}
style={{ left: (target ? `${target}%` : null) }} style={{ left: (target ? `${target}%` : null) }}
...@@ -13,7 +13,7 @@ const MiniProgress = ({ target, color, strokeWidth, percent }) => ( ...@@ -13,7 +13,7 @@ const MiniProgress = ({ target, color, strokeWidth, percent }) => (
<span style={{ backgroundColor: (color || null) }} /> <span style={{ backgroundColor: (color || null) }} />
<span style={{ backgroundColor: (color || null) }} /> <span style={{ backgroundColor: (color || null) }} />
</div> </div>
</Popover> </Tooltip>
<div className={styles.progressWrap}> <div className={styles.progressWrap}>
<div <div
className={styles.progress} className={styles.progress}
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
} }
.ant-form-item-label label { .ant-form-item-label label {
color: @text-color; color: @text-color;
margin-right: 16px; margin-right: 0;
} }
} }
.label { .label {
......
...@@ -123,27 +123,29 @@ class TagSelect extends PureComponent { ...@@ -123,27 +123,29 @@ class TagSelect extends PureComponent {
return ( return (
<div className={cls} style={style}> <div className={cls} style={style}>
<CheckableTag <div>
checked={checkedAll} <CheckableTag
key="tag-select-__all__" checked={checkedAll}
onChange={this.onSelectAll} key="tag-select-__all__"
> onChange={this.onSelectAll}
全部 >
</CheckableTag> 全部
{ </CheckableTag>
children.filter(child => child.props.displayName === 'TagSelectOption').map(child => React.cloneElement(child, { {
key: `tag-select-${child.props.value}`, children.filter(child => child.props.displayName === 'TagSelectOption').map(child => React.cloneElement(child, {
checked: checkedTags.indexOf(child.props.value) > -1, key: `tag-select-${child.props.value}`,
onChange: this.handleTagChange, checked: checkedTags.indexOf(child.props.value) > -1,
})) onChange: this.handleTagChange,
} }))
{ }
expandNode && ( {
<a className={styles.trigger} onClick={this.handleExpand}> expandNode && (
{ expand ? '收起' : '展开'} <Icon type={expand ? 'up' : 'down'} /> <a className={styles.trigger} onClick={this.handleExpand}>
</a> { expand ? '收起' : '展开'} <Icon type={expand ? 'up' : 'down'} />
) </a>
} )
}
</div>
{ {
expandNode && ( expandNode && (
<div className={expand ? styles.expand : styles.fold}> <div className={expand ? styles.expand : styles.fold}>
......
...@@ -5,6 +5,12 @@ ...@@ -5,6 +5,12 @@
user-select: none; user-select: none;
margin-left: -8px; margin-left: -8px;
position: relative; position: relative;
:global {
.ant-tag {
padding: 0 8px;
margin-right: 24px;
}
}
.expand { .expand {
transition: all 0.32s ease; transition: all 0.32s ease;
overflow: hidden; overflow: hidden;
...@@ -18,6 +24,9 @@ ...@@ -18,6 +24,9 @@
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
i {
font-size: 12px;
}
} }
} }
.expandTag { .expandTag {
......
...@@ -193,7 +193,7 @@ class BasicLayout extends React.PureComponent { ...@@ -193,7 +193,7 @@ class BasicLayout extends React.PureComponent {
> >
<div className={styles.logo}> <div className={styles.logo}>
<Link to="/"> <Link to="/">
<img src="https://gw.alipayobjects.com/zos/rmsportal/osjtaBtmmQzWRvMbcKeb.svg" alt="logo" /> <img src="https://gw.alipayobjects.com/zos/rmsportal/iwWyPinUoseUxIAeElSx.svg" alt="logo" />
<h1>Ant Design Pro</h1> <h1>Ant Design Pro</h1>
</Link> </Link>
</div> </div>
...@@ -204,7 +204,7 @@ class BasicLayout extends React.PureComponent { ...@@ -204,7 +204,7 @@ class BasicLayout extends React.PureComponent {
onOpenChange={this.handleOpenChange} onOpenChange={this.handleOpenChange}
selectedKeys={this.getCurrentMenuSelectedKeys()} selectedKeys={this.getCurrentMenuSelectedKeys()}
style={{ margin: '24px 0', width: '100%' }} style={{ margin: '24px 0', width: '100%' }}
inlineIndent={32} inlineIndent={24}
> >
{this.getNavMenuItems(this.menus)} {this.getNavMenuItems(this.menus)}
</Menu> </Menu>
......
@import "~antd/lib/style/themes/default.less"; @import "~antd/lib/style/themes/default.less";
.header { .header {
padding: 0 16px 0 0; padding: 0 12px 0 0;
background: #fff; background: #fff;
box-shadow: 0 1px 4px rgba(0, 21, 41, .12); box-shadow: 0 1px 4px rgba(0, 21, 41, .12);
position: relative; position: relative;
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
color: #fff; color: #fff;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
font-size: 22px; font-size: 18px;
margin-left: 12px; margin-left: 12px;
font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif; font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif;
margin-top: -2px; margin-top: -2px;
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
line-height: 64px; line-height: 64px;
cursor: pointer; cursor: pointer;
transition: all .3s; transition: all .3s;
padding: 0 28px; padding: 0 24px;
&:hover { &:hover {
background: rgba(0, 0, 0, .04); background: rgba(0, 0, 0, .04);
} }
...@@ -103,5 +103,5 @@ ...@@ -103,5 +103,5 @@
min-height: 100vh; min-height: 100vh;
box-shadow: 2px 0 6px rgba(0, 21, 41, .35); box-shadow: 2px 0 6px rgba(0, 21, 41, .35);
position: relative; position: relative;
z-index: 1; z-index: 10;
} }
...@@ -62,8 +62,8 @@ export default class CardList extends PureComponent { ...@@ -62,8 +62,8 @@ export default class CardList extends PureComponent {
dataSource={['', ...list]} dataSource={['', ...list]}
renderItem={item => (item ? ( renderItem={item => (item ? (
<List.Item key={item.id}> <List.Item key={item.id}>
<Link to="/list/card-list"> <Card hoverable actions={[<a>操作一</a>, <a>操作二</a>]}>
<Card hoverable actions={[<a>操作一</a>, <a>操作二</a>]}> <Link to="/list/card-list">
<Card.Meta <Card.Meta
avatar={<Avatar size="large" src={item.avatar} />} avatar={<Avatar size="large" src={item.avatar} />}
title={item.title} title={item.title}
...@@ -73,8 +73,8 @@ export default class CardList extends PureComponent { ...@@ -73,8 +73,8 @@ export default class CardList extends PureComponent {
</p> </p>
)} )}
/> />
</Card> </Link>
</Link> </Card>
</List.Item> </List.Item>
) : ( ) : (
<List.Item> <List.Item>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
border-color: @border-color-base; border-color: @border-color-base;
color: @text-color-secondary; color: @text-color-secondary;
width: 100%; width: 100%;
height: 178px; height: 185px;
} }
.cardDescription { .cardDescription {
......
...@@ -153,7 +153,7 @@ export default class CoverCardList extends PureComponent { ...@@ -153,7 +153,7 @@ export default class CoverCardList extends PureComponent {
onTabChange={this.handleTabChange} onTabChange={this.handleTabChange}
> >
<div className={styles.coverCardList}> <div className={styles.coverCardList}>
<Card bordered={false}> <Card bordered={false} bodyStyle={{ padding: 24 }}>
<Form layout="inline"> <Form layout="inline">
<StandardFormRow title="所属类目" block> <StandardFormRow title="所属类目" block>
<FormItem> <FormItem>
......
...@@ -151,7 +151,7 @@ export default class FilterCardList extends PureComponent { ...@@ -151,7 +151,7 @@ export default class FilterCardList extends PureComponent {
onTabChange={this.handleTabChange} onTabChange={this.handleTabChange}
> >
<div className={styles.filterCardList}> <div className={styles.filterCardList}>
<Card bordered={false}> <Card bordered={false} bodyStyle={{ padding: 24 }}>
<Form layout="inline"> <Form layout="inline">
<StandardFormRow title="所属类目" block> <StandardFormRow title="所属类目" block>
<FormItem> <FormItem>
...@@ -221,6 +221,8 @@ export default class FilterCardList extends PureComponent { ...@@ -221,6 +221,8 @@ export default class FilterCardList extends PureComponent {
renderItem={item => ( renderItem={item => (
<List.Item key={item.id}> <List.Item key={item.id}>
<Card <Card
hoverable
bodyStyle={{ paddingBottom: 16 }}
actions={[ actions={[
<Tooltip title="下载"><Icon type="download" /></Tooltip>, <Tooltip title="下载"><Icon type="download" /></Tooltip>,
<Tooltip title="编辑"><Icon type="edit" /></Tooltip>, <Tooltip title="编辑"><Icon type="edit" /></Tooltip>,
......
...@@ -7,10 +7,14 @@ ...@@ -7,10 +7,14 @@
.ant-card-meta-content { .ant-card-meta-content {
margin-top: 0; margin-top: 0;
} }
// disabled white space
.ant-card-meta-avatar {
font-size: 0;
}
} }
.cardInfo { .cardInfo {
.clearfix(); .clearfix();
margin-top: 12px; margin-top: 16px;
margin-left: 40px; margin-left: 40px;
& > div { & > div {
position: relative; position: relative;
...@@ -18,7 +22,7 @@ ...@@ -18,7 +22,7 @@
float: left; float: left;
width: 50%; width: 50%;
p { p {
color: @text-color; color: @text-color-secondary;
line-height: 32px; line-height: 32px;
font-size: 24px; font-size: 24px;
} }
......
...@@ -183,7 +183,7 @@ export default class SearchList extends Component { ...@@ -183,7 +183,7 @@ export default class SearchList extends Component {
onTabChange={this.handleTabChange} onTabChange={this.handleTabChange}
> >
<div> <div>
<Card bordered={false}> <Card bordered={false} bodyStyle={{ padding: 24 }}>
<Form layout="inline"> <Form layout="inline">
<StandardFormRow title="所属类目" block> <StandardFormRow title="所属类目" block>
<FormItem> <FormItem>
......
// https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less // https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less
module.exports = { module.exports = {
// 'primary-color': '#10e99b', // 'primary-color': '#10e99b',
'card-actions-background': '#f7f9fa',
}; };
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment