Files
ant-design/spec/typography.html
T
2016-01-03 01:31:32 +08:00

436 lines
16 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta name="description" content="一个 UI 设计语言"/>
<title>
排版 - Ant Design
</title>
<link rel="icon" href="https://t.alipayobjects.com/images/T1QUBfXo4fXXXXXXXX.png" type="image/x-icon">
<link rel="shortcut icon" href="https://t.alipayobjects.com/images/T1QUBfXo4fXXXXXXXX.png" type="image/x-icon">
<link rel="stylesheet" href="../dist/demo.css">
<link rel="stylesheet" href="../static/style.css">
<link rel="stylesheet" href="../static/tomorrow.css">
<!--[if IE 8]>
<script src="https://t.alipayobjects.com/images/rmsweb/T1q8JiXftaXXXXXXXX.js"></script>
<![endif]-->
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.1.14/es5-shim.min.js,es5-shim/4.1.14/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script>
<script src="https://a.alipayobjects.com/??bluebird/2.9.30/bluebird.js,jquery/jquery/1.11.1/jquery.js"></script>
<script>
(function() {
window.ANT_COMPONENTS = [];
window.InstantClickChangeFns = [];
ANT_COMPONENTS.push({
title: 'Popconfirm',
desc: '气泡确认框'
});
ANT_COMPONENTS.push({
title: 'Affix',
desc: '固钉'
});
ANT_COMPONENTS.push({
title: 'Badge',
desc: '徽标数'
});
ANT_COMPONENTS.push({
title: 'Breadcrumb',
desc: '面包屑'
});
ANT_COMPONENTS.push({
title: 'Button',
desc: '按钮'
});
ANT_COMPONENTS.push({
title: 'Calendar',
desc: '日历'
});
ANT_COMPONENTS.push({
title: 'Carousel',
desc: '走马灯'
});
ANT_COMPONENTS.push({
title: 'Checkbox',
desc: '多选框'
});
ANT_COMPONENTS.push({
title: 'Collapse',
desc: '折叠面板'
});
ANT_COMPONENTS.push({
title: 'DatePicker',
desc: '日期选择框'
});
ANT_COMPONENTS.push({
title: 'Dropdown',
desc: '下拉菜单'
});
ANT_COMPONENTS.push({
title: 'Form',
desc: '表单'
});
ANT_COMPONENTS.push({
title: 'Icon',
desc: '图标'
});
ANT_COMPONENTS.push({
title: 'InputNumber',
desc: '数字输入框'
});
ANT_COMPONENTS.push({
title: 'Layout',
desc: '布局'
});
ANT_COMPONENTS.push({
title: 'Menu',
desc: '导航菜单'
});
ANT_COMPONENTS.push({
title: 'Message',
desc: '全局提示'
});
ANT_COMPONENTS.push({
title: 'Modal',
desc: '对话框'
});
ANT_COMPONENTS.push({
title: 'Notification',
desc: '通知提醒框'
});
ANT_COMPONENTS.push({
title: 'Pagination',
desc: '分页'
});
ANT_COMPONENTS.push({
title: 'Alert',
desc: '警告提示'
});
ANT_COMPONENTS.push({
title: 'Popover',
desc: '气泡卡片'
});
ANT_COMPONENTS.push({
title: 'Progress',
desc: '进度条'
});
ANT_COMPONENTS.push({
title: 'QueueAnim',
desc: '进出场动画'
});
ANT_COMPONENTS.push({
title: 'Radio',
desc: '单选框'
});
ANT_COMPONENTS.push({
title: 'Select',
desc: '选择器'
});
ANT_COMPONENTS.push({
title: 'Slider',
desc: '滑动输入条'
});
ANT_COMPONENTS.push({
title: 'Spin',
desc: '加载中'
});
ANT_COMPONENTS.push({
title: 'Steps',
desc: '步骤条'
});
ANT_COMPONENTS.push({
title: 'Switch',
desc: '开关'
});
ANT_COMPONENTS.push({
title: 'Table',
desc: '表格'
});
ANT_COMPONENTS.push({
title: 'Tabs',
desc: '标签页'
});
ANT_COMPONENTS.push({
title: 'Tag',
desc: '标签'
});
ANT_COMPONENTS.push({
title: 'TimePicker',
desc: '时间选择框'
});
ANT_COMPONENTS.push({
title: 'Timeline',
desc: '时间轴'
});
ANT_COMPONENTS.push({
title: 'Tooltip',
desc: '文字提示'
});
ANT_COMPONENTS.push({
title: 'Transfer',
desc: '穿梭框'
});
ANT_COMPONENTS.push({
title: 'Tree',
desc: '树形控件'
});
ANT_COMPONENTS.push({
title: 'Upload',
desc: '文件上传'
});
ANT_COMPONENTS.push({
title: 'Validation',
desc: '表单校验'
});
var i = location.pathname.split('/').lastIndexOf('ant-design');
if (i > 0) {
window.rootUrl = location.origin + location.pathname.split('/').slice(0, 2+1).join('/');
} else {
window.rootUrl = location.origin;
}
})();
</script>
<script src="../static/script.js"></script>
<script>
window.antdVersion = {
latest: '0.11.2'
};
</script>
<script src="../dist/demo.js"></script>
<script src="https://t.alipayobjects.com/images/T1DrxhXe0mXXXXXXXX.js"></script>
</head>
<body >
<header id="header" class="clearfix">
<a class="logo" href="..">
<img width="60" src="https://t.alipayobjects.com/images/rmsweb/T1B9hfXcdvXXXXXXXX.svg">
Ant Design
</a>
<div class="search">
<div id="autoComplete"></div>
</div>
<div class="global-hint">
0.11 已发布,0.10 文档请访问 <a href="http://010x.ant.design/">010x.ant.design</a>
</div>
<nav class="nav">
<span class="bar"></span>
<ul>
<li class="">
<a href=".." data-no-instant>首页</a>
</li>
<li class="current">
<a href="./introduce">设计</a>
</li>
<li class="">
<a href="../docs/introduce">React UI</a>
</li>
<li>
<a target="_blank" href="https://github.com/ant-design/ant-design">Github</a>
</li>
</ul>
</nav>
<div class="nav-phone-icon"></div>
</header>
<div class="main-wrapper">
<aside class="aside-container">
<ul>
<li class="">
<a href="introduce" class="">
Ant Design
<span class="chinese"></span>
</a>
</li>
<li open="open">
<h4>基础</h4>
<ul class="">
<li class="">
<a href="font"
class="">
字体
<span class="chinese"></span>
</a>
</li>
<li class="current">
<a href="typography"
class="">
排版
<span class="chinese"></span>
</a>
</li>
<li class="">
<a href="colors"
class="">
色彩
<span class="chinese"></span>
</a>
</li>
<li class="">
<a href="layout/"
class="">
常用布局
<span class="chinese"></span>
</a>
</li>
</ul>
</li>
<li open="open">
<h4>动画</h4>
<ul class="">
<li class="">
<a href="easing"
class="">
自然运动
<span class="chinese"></span>
</a>
</li>
<li class="">
<a href="page-transition"
class="">
互动转换
<span class="chinese"></span>
</a>
</li>
<li class="">
<a href="motion"
class="">
组件动画
<span class="chinese"></span>
</a>
</li>
</ul>
</li>
<li class="">
<a href="pattern" class="nav-link-disabled">
设计模式
<span class="chinese"></span>
</a>
</li>
<li class="">
<a href="tools" class="">
资源下载
<span class="chinese"></span>
</a>
</li>
</ul>
</aside>
<section class="main-container">
<article class="markdown">
<h1>排版 </h1>
<p>良好的排版规范能大大提升用户的视觉体验。</p>
<h2 id="行高和段落">行高和段落<a href="#行高和段落" class="anchor">#</a> </h2><p>考虑到阅读的舒适度和节奏感,句子和段落间需要合适的间距。行距決定了段落中各行文字的垂直距离,通过字体本身行高来控制,我们行高默认为字号的 1.5 倍。段落间距決定了段落上下的间距,一般为字号的一倍宽。</p>
<div class="row">
<div class="col col-12 paragraph-12px">
<h3>12px 段落</h3>
<p>汉学家称这个空白字为「盘古之白」,因为它劈开了全角字和半角字之间的混沌。</p>
<p>另有研究显示,打字的时候不喜欢在中文和英文之间加空格的人,感情路都走得很辛苦,有七成的比例会在 34 岁的时候跟自己不爱的人结婚,而其余三成的人最后只能把遗产留给自己的猫。毕竟爱情跟书写都需要适时地留白。</p>
<p>文案来自 <a href="https://github.com/vinta/paranoid-auto-spacing#%E7%82%BA%E4%BB%80%E9%BA%BC%E4%BD%A0%E5%80%91%E5%B0%B1%E6%98%AF%E4%B8%8D%E8%83%BD%E5%8A%A0%E5%80%8B%E7%A9%BA%E6%A0%BC%E5%91%A2">此处</a></p>
</div>
<div class="col col-12 paragraph-14px">
<h3>14px 段落</h3>
<p>汉学家称这个空白字为「盘古之白」,因为它劈开了全角字和半角字之间的混沌。</p>
<p>另有研究显示,打字的时候不喜欢在中文和英文之间加空格的人,感情路都走得很辛苦,有七成的比例会在 34 岁的时候跟自己不爱的人结婚,而其余三成的人最后只能把遗产留给自己的猫。毕竟爱情跟书写都需要适时地留白。</p>
<p>文案来自 <a href="https://github.com/vinta/paranoid-auto-spacing#%E7%82%BA%E4%BB%80%E9%BA%BC%E4%BD%A0%E5%80%91%E5%B0%B1%E6%98%AF%E4%B8%8D%E8%83%BD%E5%8A%A0%E5%80%8B%E7%A9%BA%E6%A0%BC%E5%91%A2">此处</a></p>
</div>
</div>
<style>
.paragraph-14px, .paragraph-12px {
padding: 15px;
line-height: 1.5;
}
.paragraph-14px p,
.paragraph-12px p {
margin: 1em 0;
}
.paragraph-14px {
font-size: 14px;
}
.paragraph-12px {
font-size: 12px;
}
</style>
<h2 id="标点和空格">标点和空格<a href="#标点和空格" class="anchor">#</a> </h2><p><img align="right" src="https://t.alipayobjects.com/images/T1KrXhXlxnXXXXXXXX.png" width="200"></p>
<ol>
<li>使用全角中文标点。</li>
<li>遇到完整的英文整句、特殊名词,其内容使用半角标点。</li>
<li>数字使用半角字符。</li>
<li>不重复使用标点符号。</li>
</ol>
<h3 id="空格规范">空格规范<a href="#空格规范" class="anchor">#</a> </h3><ol>
<li>中文和英文间需要空格。</li>
<li>数字与单位之间需要增加空格。
例外:度、百分比与数字之间不需要增加空格。</li>
<li>中文链接之间增加空格。</li>
</ol>
<h2 id="文字背景">文字背景<a href="#文字背景" class="anchor">#</a> </h2><p>当文字和背景明暗对比小于一定比值时,人眼识别文字信息将会变得吃力,尤其在明亮的室外或晃动的情况下。</p>
<p>方法:若彩色背景,可先将色彩去色转为黑白,分别吸取并查看背景和文字的 <code>HSV</code> 色值。
两者的 V 值的差额便是明暗对比差。这个明暗对比差建议不小于 40。</p>
<p><img src="https://t.alipayobjects.com/images/T1UYphXe8lXXXXXXXX.png" width="90%"></p>
<h2 id="对齐">对齐<a href="#对齐" class="anchor">#</a> </h2><h3 id="中文-英文居左对齐">中文/英文居左对齐<a href="#中文-英文居左对齐" class="anchor">#</a> </h3><p>中文和英文均采用左对齐的方式,是因为文字的阅读顺序一般是从左到右的。</p>
<p><img src="https://t.alipayobjects.com/images/T1nHhhXl4mXXXXXXXX.png" width="100%"></p>
<h3 id="数字-小数点对齐">数字/小数点对齐<a href="#数字-小数点对齐" class="anchor">#</a> </h3><p><img align="right" src="https://t.alipayobjects.com/images/T1YbthXhRkXXXXXXXX.png" width="400"></p>
<p style="height:220px;width:380px;">数字通常采用右对齐或小数点对齐,这样便于对个十百千位上的数字进行对比。</p>
<h3 id="冒号对齐">冒号对齐<a href="#冒号对齐" class="anchor">#</a> </h3><p><img align="right" src="https://t.alipayobjects.com/images/T1hcJhXnlXXXXXXXXX.png" width="400"></p>
<p style="height:220px;width:380px;">以冒号对齐的方式在表单中尤其常见。主要是为了区分标题和内容区块,除了美观简洁外,让用户能迅速看清标题减少出错概率。</p>
<h2 id="文案长度">文案长度<a href="#文案长度" class="anchor">#</a> </h2><p>语言通常是越简单越明确,而提示性文字更需要简明扼要,让用户一目了然,减少操作失误。提示性句子长度视业务而定,建议一般不超过 16–18 个字。</p>
<p><img align="right" style="margin:30px 100px" src="https://t.alipayobjects.com/images/T17cthXgpbXXXXXXXX.png" width="300"></p>
<p>保持简明准确的方法:</p>
<ul>
<li>每个句子只包含一个观点;</li>
<li>使用明确的词;</li>
<li>尽可能使用主动语态少用被动语态;</li>
</ul>
<h2 id="层级引导">层级引导<a href="#层级引导" class="anchor">#</a> </h2><p>我们通常使用对比的手法来区分出信息的层次感,信息主次分明能准确地将信息清晰地传达给用户,让用户第一眼获取所需资讯,提升阅读体验。</p>
<p><img src="https://t.alipayobjects.com/images/T1GYBhXghjXXXXXXXX.png" width="600"></p>
<h3 id="squint-test">Squint test<a href="#squint-test" class="anchor">#</a> </h3><p>我们可以采用 <a href="https://chrome.google.com/webstore/detail/the-squint-test/gppnipfbappicilfniaimcnagbpfflpg">模糊测试</a> 的方法,即眯起眼睛从整体来检视结构上的合理与否。</p>
<p><img src="https://t.alipayobjects.com/images/T1bY4hXkpfXXXXXXXX.png" width="600"></p>
</article>
</section>
</div><footer id="footer">
<ul>
<li>
<h2>GitHub</h2>
<a target="_blank "href="https://github.com/ant-design/ant-design">仓库</a>
<a target="_blank" href="https://github.com/ant-design/ant-design/tree/master/style">样式</a>
<a target="_blank" href="https://github.com/ant-tool/xtool">开发工具</a>
</li>
<li>
<h2>关于我们</h2>
<a href="https://github.com/ant-ued/blog">博客 - Ant UED</a>
</li>
<li>
<h2>联系我们</h2>
<a target="_blank" href="https://github.com/ant-design/ant-design/issues">反馈和建议</a>
<a target="_blank" href="https://gitter.im/ant-design/ant-design">讨论</a>
<a target="_blank" href="http://dwz.cn/2dJ2mg">报告 Bug</a>
</li>
<li>
<h3>©2015 蚂蚁金服体验技术部出品</h3>
<h3>文档版本:<span id="versions-select"></span></h3>
</li>
</ul>
</footer>
<script src="https://t.alipayobjects.com/images/rmsweb/T1AmXhXg0kXXXXXXXX.js" data-no-instant></script>
<script data-no-instant>
InstantClick.on('change', function() {
InstantClickChangeFns.forEach(function(fn) {
fn();
});
});
InstantClick.init();
</script>
</body>
</html>