ant-design/docs/spec/font.md

210 lines
4.5 KiB
Markdown
Raw Normal View History

2016-03-31 14:17:09 +08:00
---
category:
zh-CN: 设计基础
en-US: Design Fundamental
2016-03-31 14:17:09 +08:00
order: 0
2016-09-21 11:28:38 +08:00
title:
zh-CN: 字体
en-US: Font
2016-03-31 14:17:09 +08:00
---
2015-08-04 16:54:08 +08:00
跨平台的字体设定,力求在各个操作系统下都有最佳展示效果。
2016-03-14 16:18:06 +08:00
---
2015-08-04 16:54:08 +08:00
## 字体家族
- 中文字体族:
2015-12-30 21:06:51 +08:00
<img src="https://os.alipayobjects.com/rmsportal/OKbesWXtRMCNGmO.png" width="100%">
2015-08-04 16:54:08 +08:00
- 英文文字体族:
<img src="https://t.alipayobjects.com/images/T1bcXhXfNeXXXXXXXX.png" width="100%">
字体家族 css 代码如下:
```css
2015-12-30 21:06:51 +08:00
font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
2015-08-04 16:54:08 +08:00
```
## 字体使用规范
2016-06-28 21:09:49 +08:00
<div class="ant-row">
<div class="ant-col ant-col-12">
<div class="font-type">
2015-08-04 16:54:08 +08:00
<div class="font-title">主标题</div>
2016-06-28 21:09:49 +08:00
<h1>
2015-08-04 16:54:08 +08:00
<span>我是标题</span>
<span>加粗</span>
<span>#666</span>
<span>16px</span>
</h1>
</div>
2016-06-28 21:09:49 +08:00
<div class="font-type">
2015-08-04 16:54:08 +08:00
<div class="font-title">次级标题</div>
2016-06-28 21:09:49 +08:00
<h2>
2015-08-04 16:54:08 +08:00
<span>我是标题</span>
<span>加粗</span>
<span>#666</span>
<span>14px</span>
</h2>
</div>
2016-06-28 21:09:49 +08:00
<div class="font-type">
2015-08-04 16:54:08 +08:00
<div class="font-title">小标题</div>
2016-06-28 21:09:49 +08:00
<h3>
2015-08-04 16:54:08 +08:00
<span>我是标题</span>
<span>加粗</span>
<span>#666</span>
<span>12px</span>
</h3>
</div>
<div class="font-type text">
<div class="font-title">正文</div>
<p class="font-text">
<span>我是正文</span>
<span>#666</span>
<span>12px</span>
</p>
</div>
<div class="font-type help-text">
<div class="font-title">辅助文字</div>
<p class="font-text">
<span>我是辅助文字</span>
<span>#999</span>
<span>12px</span>
</p>
</div>
<div class="font-type disabled-text">
<div class="font-title">失效文字</div>
<p class="font-text">
<span>我是失效文字</span>
<span>#ccc</span>
<span>12px</span>
</p>
</div>
<div class="font-type link-text">
<div class="font-title">链接文字</div>
<p class="font-text">
<a href="#">
<span>我是链接文字</span>
<span>#2db7f5</span>
<span>12px</span>
</a>
</p>
</div>
</div>
2016-06-28 21:09:49 +08:00
<div class="ant-col ant-col-12">
<div class="font-type">
2015-08-04 16:54:08 +08:00
<div class="font-title">Main Head</div>
2016-06-28 21:09:49 +08:00
<h1>
2015-08-04 16:54:08 +08:00
<span>I am example text</span>
<span>bold</span>
<span>#666</span>
<span>16px</span>
</h1>
</div>
2016-06-28 21:09:49 +08:00
<div class="font-type">
2015-08-04 16:54:08 +08:00
<div class="font-title">Sub Head</div>
2016-06-28 21:09:49 +08:00
<h2>
2015-08-04 16:54:08 +08:00
<span>I am example text</span>
<span>bold</span>
<span>#666</span>
<span>14px</span>
</h2>
</div>
2016-06-28 21:09:49 +08:00
<div class="font-type">
2015-08-04 16:54:08 +08:00
<div class="font-title">Small Head</div>
2016-06-28 21:09:49 +08:00
<h3>
2015-08-04 16:54:08 +08:00
<span>I am example text</span>
<span>bold</span>
<span>#666</span>
<span>12px</span>
</h3>
</div>
<div class="font-type text">
<div class="font-title">Text</div>
<p class="font-text">
<span>I am example text</span>
<span>#666</span>
<span>12px</span>
</p>
</div>
<div class="font-type help-text">
<div class="font-title">Help Text</div>
<p class="font-text">
<span>I am example text</span>
<span>#999</span>
<span>12px</span>
</p>
</div>
<div class="font-type disabled-text">
<div class="font-title">Disabled Text</div>
<p class="font-text">
<span>I am example text</span>
<span>#ccc</span>
<span>12px</span>
</p>
</div>
<div class="font-type link-text">
<div class="font-title">Link Text</div>
<p class="font-text">
<a href="#">
<span>I am example text</span>
<span>#2db7f5</span>
<span>12px</span>
</a>
</p>
</div>
</div>
</div>
<style>
.font-type {
margin: 20px 0;
overflow: hidden;
font-size: 12px;
}
.font-type h1,
.font-type h2,
.font-type h3,
.font-type p {
margin: 0;
color: #666;
}
.font-type > * {
display: inline-block;
}
.font-title {
font-size: 14px;
width: 100px;
}
2016-06-28 21:09:49 +08:00
.font-type h1,
.font-type h2,
.font-type h3,
.font-type .font-text {
2015-08-04 16:54:08 +08:00
width: 300px;
}
2016-06-28 21:09:49 +08:00
.font-type h1 span,
.font-type h2 span,
.font-type h3 span,
.font-type .font-text span {
margin-right: 0.6em;
2015-08-04 16:54:08 +08:00
}
2016-06-28 21:09:49 +08:00
.font-type h1 {
2015-08-04 16:54:08 +08:00
font-size: 16px;
}
2016-06-28 21:09:49 +08:00
.font-type h2 {
2015-08-04 16:54:08 +08:00
font-size: 14px;
}
2016-06-28 21:09:49 +08:00
.font-type h3 {
2015-08-04 16:54:08 +08:00
font-size: 12px;
}
.disabled-text .font-text {
color: #ccc;
}
2015-11-01 18:01:01 +08:00
.help-text .font-text {
color: #999;
}
2015-08-04 16:54:08 +08:00
</style>