Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加 typo.css 2.1.2 #557

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions libs/typo.css/2.1.2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## 中文网页重设与排版:

目标:一致化浏览器排版效果,构建最适合中文阅读的网页排版。包括桌面和移动平台。

预览:[typo.css](http://typo.sofi.sh)

### 一、目录结构
.
├── README.md --- 使用帮助
├── license.txt --- 许可证
├── typo.css --- 将应用于你的项目
└── typo.html --- Demo/预览


### 二、TYPO.CSS 的设计和使用


## TYPO.CSS 主要包括:

1、一般 reset.css 所需的内容

目前的设计是这样的,尽量保持完整的 reset,比如让 ul/ol 无样式并且无多余的 `padding`/`margin`,这是必须的,因为一个网可能需要很多自定义的的内容,在实践中我们并不希望像 ul/ol 有样式,这样我们得用优先级去覆盖,这是非常麻烦的事。所以 typo.css 并不像 normalize.css,后者给每一个元素都预先定义了样式,这样在自定义的时候将是非常痛苦的。要大保持干净的所有元素一致化的 reset 才是最佳实践。

2、`class="typo"` 阅读内容排版

在文章/文档阅读的页面,需添加 `.typo` 这个 class,这样 table/ol/ul 等都会有预定的样式,让你的排版像 [http://typo.sofi.sh](http://typo.sofi.sh) 一样,让用户阅读起来更舒服。

在父容器在没有添加 `class="typo"` 的时候,可以使用 `class="typo-标签"`(如 `class="typo-ul"`)来实现像 `.typo > ul` 这样结构的样式。

3、增加类:

主要是一些需要中文日常排版需要的元素和语文对应样式的增强,目前包括:

(1) 专名号:使用标签 `<u>` 或者 `.typo-u` <br />
(2) 着重号:使用 class `.typo-em` <br />
(3) 清理浮动:与一般 reset.css 保持一致 `.clearfix` <br />
(4) 强制换行:添加 `.textwrap` 到文本所在的容器,如果是 `table` 测还需要 `.textwrap-table` <br />
(5) 衬线字体:添加 `.serif` <br />
(6) 创建 border-box:在 html 中添加 `.borderbox` [#why](http://www.paulirish.com/2012/box-sizing-border-box-ftw/)


### 三、开源许可
基于 [MIT License](http://zh.wikipedia.org/wiki/MIT_License) 开源,使用代码只需说明来源,或者引用 [license.txt](https://github.com/sofish/typo.css/blob/master/license.txt) 即可。
22 changes: 22 additions & 0 deletions libs/typo.css/2.1.2/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
TYPO.CSS - a better way to manage the typography of your Chinese-lang-base site.

Copyright (C) 2012 Sofish Lin http://sofish.de

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Loading