Skip to content

Commit

Permalink
style: #563 tabs (#564)
Browse files Browse the repository at this point in the history
* chore: theme page style

* style: #563 tabs
  • Loading branch information
liuxy0551 authored May 6, 2024
1 parent ed032db commit d6bdb73
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 11 deletions.
2 changes: 1 addition & 1 deletion components/tab/demo/card.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
order: 4
order: 5
title:
zh-CN: 卡片式页签
en-US: Card type tab
Expand Down
2 changes: 1 addition & 1 deletion components/tab/demo/editable-card.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
order: 7
order: 8
title:
zh-CN: 新增和关闭页签
---
Expand Down
2 changes: 1 addition & 1 deletion components/tab/demo/light.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
order: 5
order: 6
title:
zh-CN: 浅色背景下使用
---
Expand Down
2 changes: 1 addition & 1 deletion components/tab/demo/sider-menu.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
order: 6
order: 7
title:
zh-CN: 侧边菜单
---
Expand Down
43 changes: 43 additions & 0 deletions components/tab/demo/slide-vertical.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
order: 4
title:
zh-CN: 隐藏 `···` icon
en-US: HiddenIcon
---

## zh-CN

可以使用 `dt-tabs-hidden-more-icon` 隐藏数量较多时左下角或右上角的 `···` icon

## en-US

You can use 'dt-tabs-hidden-more-icon' to hide the more icon in the bottom left or top right corner when there is a large quantity.

```jsx
import { Tabs, Radio } from 'antd';
import { AndroidOutlined, AppleOutlined } from '@ant-design/icons';

const { TabPane } = Tabs;

class SlidingTabsDemo extends React.Component {
constructor(props) {
super(props);
}

render() {
return (
<div>
<Tabs className="dt-tabs-hidden-more-icon" defaultActiveKey="1" tabPosition="left" style={{ height: 220 }}>
{[...Array(30).keys()].map(i => (
<TabPane tab={ i < 4 ? <span><AndroidOutlined />Tab-{i}</span> : `Tab-${i}`} key={i}>
Content of tab {i}
</TabPane>
))}
</Tabs>
</div>
);
}
}

ReactDOM.render(<SlidingTabsDemo />, mountNode);
```
3 changes: 2 additions & 1 deletion components/tab/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/lkI2hNEDr2V/Tabs.svg
|.dt-tabs-sider-menu | 侧边栏菜单类名,需配合type="line"和tabPosition="right"或者"left"一起使用 | 侧边菜单 |
|.dt-tabs-content-padding | 内容内边距类名,16px | 侧边菜单 |
|.dt-tabs-nav-padding-16 | 增加左右边距16px | 基础样式 |
|.dt-tabs-nav-no-margin | 减少上边距/左边距16px,整体宽度增加32px | 消除间隙 |
|.dt-tabs-nav-no-margin | 减少上边距/左边距16px,整体宽度增加32px | 消除间隙 |
|.dt-tabs-hidden-more-icon | 更多标签时,隐藏 ··· 的更多 icon | 侧边菜单 |
15 changes: 11 additions & 4 deletions theme/dt-theme/default/tab.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
line-height: 20px;
.ant-tabs-tab-btn {
.anticon {
margin-right: 4px;
margin: 0 4px 0 -4px;
font-size: 16px;
color: @black_pageMsg;
}
Expand Down Expand Up @@ -48,8 +48,8 @@
}

.ant-tabs-left > .ant-tabs-nav .ant-tabs-nav-list .ant-tabs-tab {
padding: 8px 7px;
margin-top: 0;
padding: 2px 12px;
margin: 6px 0;
}

.ant-tabs-left > .ant-tabs-nav .ant-tabs-ink-bar {
Expand Down Expand Up @@ -119,7 +119,8 @@
.ant-tabs-nav-wrap-ping-bottom {
.ant-tabs-nav-list {
.ant-tabs-tab {
padding: 8px 12px;
padding: 2px 12px;
margin: 6px 0;
}
}
}
Expand Down Expand Up @@ -203,6 +204,12 @@
}
}

.dt-tabs-hidden-more-icon {
.ant-tabs-nav-more {
display: none;
}
}

.ant-tabs-right.dt-tabs-sider-menu {
.ant-tabs-nav {
.ant-tabs-tab-active {
Expand Down
5 changes: 5 additions & 0 deletions theme/static/header.less
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,9 @@
height: 64px;
float: right;
margin-right: 50px;
.ant-radio-group-outline {
.ant-radio-wrapper {
padding-top: 0;
}
}
}
4 changes: 2 additions & 2 deletions theme/template/NotFound.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Link } from 'bisheng/router';
import zhCn from '../zh-CN';
import config from '../../bisheng.config';

export default function NotFound({ location: _location }) {
return (
Expand All @@ -9,7 +9,7 @@ export default function NotFound({ location: _location }) {
<h1>404</h1>
<p>
啊哦~,您要找的页面不存在。 &nbsp;&nbsp;
<Link to={zhCn.messages['app.home.url']}>返回首页</Link>
<Link to={config.baseConfig.homeUrl}>返回首页</Link>
</p>
</section>
<style
Expand Down

0 comments on commit d6bdb73

Please sign in to comment.