typo-rails 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7140c986c3c809028bda9e93c0cc19a44ca5d977
4
+ data.tar.gz: c097c6081f73b85fc2654933042a7e39b2761a37
5
+ SHA512:
6
+ metadata.gz: 6a28cfd33fa85d21b52ef70231c3e7418df6d97acefb0d8ec257f87d50ee2f14b75391a3d6de24a614704d8515c48ffedc25b6b979f5326442a74e753dfc84c3
7
+ data.tar.gz: 8da0aef2b53142d53fb5bec2741976e48bf86bb8a3f951b42b3fa1972d447de9b022d224bfa1df9bad0635ec5ebc0b150a3c41b253f7045c33e12647bf89b059
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 namiheike
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # Typo-Rails
2
+
3
+ [Typo.css](https://github.com/sofish/typo.css) includes normal reset styles, plus some great styles designed for Chinese typography.
4
+
5
+ You'll want to simply use this gem to integrate it into your app.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'typo-rails'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install typo-rails
20
+
21
+ ## Usage
22
+
23
+ Add something like this to your application.css(.sass):
24
+
25
+ *= require typo
26
+ //= require typo
data/lib/typo/rails.rb ADDED
@@ -0,0 +1,8 @@
1
+ require "rails/version"
2
+
3
+ module Typo
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module Typo
2
+ module Rails
3
+ VERSION = "0.1.1"
4
+ end
5
+ end
@@ -0,0 +1,305 @@
1
+ @charset "utf-8";
2
+
3
+ /* 防止用户自定义背景颜色对网页的影响,添加让用户可以自定义字体 */
4
+ html {
5
+ color: #444333;
6
+ background: #fff;
7
+ -webkit-text-size-adjust: 100%;
8
+ -ms-text-size-adjust: 100%;
9
+ text-rendering: optimizelegibility;
10
+ }
11
+
12
+ /* 内外边距通常让各个浏览器样式的表现位置不同 */
13
+ body, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, textarea, p, blockquote, th, td, hr, button, article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
14
+ margin: 0;
15
+ padding: 0;
16
+ }
17
+
18
+ /* 重设 HTML5 标签, IE 需要在 js 中 createElement(TAG) */
19
+ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
20
+ display: block;
21
+ }
22
+
23
+ /* HTML5 媒体文件跟 img 保持一致 */
24
+ audio, canvas, video {
25
+ display: inline-block;
26
+ *display: inline;
27
+ *zoom: 1;
28
+ }
29
+
30
+ /* 要注意表单元素并不继承父级 font 的问题 */
31
+ body, button, input, select, textarea {
32
+ font:500 0.875em/1.8 Microsoft Yahei, Hiragino Sans GB, WenQuanYi Micro Hei, sans-serif;
33
+ }
34
+
35
+ /* 去除 IE6 input/button 多余的空白 */
36
+ button, input {
37
+ *width: auto;
38
+ *overflow: visible;
39
+
40
+ /* 让 input 和 button 一样高 */
41
+ line-height:22px;
42
+ }
43
+
44
+ /* 去掉各Table cell 的边距并让其边重合 */
45
+ table {
46
+ border-collapse: collapse;
47
+ border-spacing: 0;
48
+ }
49
+
50
+ /* IE bug fixed: th 不继承 text-align*/
51
+ th {
52
+ text-align: inherit;
53
+ }
54
+
55
+ /* 去除默认边框 */
56
+ fieldset, img {
57
+ border: 0;
58
+ }
59
+
60
+ /* 解决 IE6-7 图片缩放锯齿问题 */
61
+ img {
62
+ -ms-interpolation-mode: bicubic;
63
+ }
64
+
65
+ /* ie6 7 8(q) bug 显示为行内表现 */
66
+ iframe {
67
+ display: block;
68
+ }
69
+
70
+ /* 块/段落引用 */
71
+ blockquote {
72
+ font-family:Optima, Georgia, STSong, serif;
73
+ margin: 1em 0;
74
+ color:#999;
75
+ padding: 0.6em 1em;
76
+ background:#f8f8f8;
77
+ border-left: 0.4em solid #ddd;
78
+ }
79
+ blockquote blockquote {
80
+ padding: 0 0 0 1em;
81
+ margin-left: 2em;
82
+ }
83
+
84
+ /* Firefox 以外,元素没有下划线,需添加 */
85
+ acronym, abbr {
86
+ border-bottom: 1px dotted;
87
+ font-variant: normal;
88
+ }
89
+
90
+ /* 添加鼠标问号,进一步确保应用的语义是正确的(要知道,交互他们也有洁癖,如果你不去掉,那得多花点口舌) */
91
+ abbr {
92
+ cursor: help;
93
+ }
94
+
95
+ /* 一致的 del 样式 */
96
+ del {
97
+ text-decoration: line-through;
98
+ }
99
+
100
+ address, caption, cite, code, dfn, em, th, var {
101
+ font-style: normal;
102
+ font-weight: 400;
103
+ }
104
+
105
+ /* 去掉列表前的标识, li 会继承,大部分网站通常用列表来很多内容,所以应该当去 */
106
+ ul, ol {
107
+ list-style: none;
108
+ }
109
+
110
+ /* 对齐是排版最重要的因素, 别让什么都居中 */
111
+ caption, th {
112
+ text-align: left;
113
+ }
114
+
115
+ q:before, q:after {
116
+ content: '';
117
+ }
118
+
119
+ /* 统一上标和下标 */
120
+ sub, sup {
121
+ font-size: 75%;
122
+ line-height: 0;
123
+ position: relative;
124
+ vertical-align: text-top\9;
125
+ }
126
+ :root sub, :root sup{
127
+ vertical-align: baseline; /* for ie9 and other mordern browsers */
128
+ }
129
+ sup {
130
+ top: -0.5em;
131
+ }
132
+ sub {
133
+ bottom: -0.25em;
134
+ }
135
+
136
+ /* 让链接在 hover 状态下显示下划线 */
137
+ a:hover {
138
+ text-decoration: underline;
139
+ }
140
+
141
+ /* 默认不显示下划线,保持页面简洁 */
142
+ ins, a {
143
+ text-decoration: none;
144
+ }
145
+
146
+ /* 专名号:虽然 u 已经重回 html5 Draft,但在所有浏览器中都是可以使用的,
147
+ * 要做到更好,向后兼容的话,添加 class="typo-u" 来显示专名号
148
+ * 关于 <u> 标签:http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-u-element
149
+ * 被放弃的是 4,之前一直搞错 http://www.w3.org/TR/html401/appendix/changes.html#idx-deprecated
150
+ * 一篇关于 <u> 标签的很好文章:http://html5doctor.com/u-element/
151
+ */
152
+ u, .typo-u {
153
+ text-decoration: underline;
154
+ }
155
+
156
+ /* 标记,类似于手写的荧光笔的作用 */
157
+ mark {
158
+ background: #fffdd1;
159
+ }
160
+
161
+ /* 代码片断 */
162
+ pre, code {
163
+ font-family: "Courier New", Courier, monospace;
164
+ white-space: pre-wrap;
165
+ word-wrap: break-word;
166
+ }
167
+ pre {
168
+ background: #f8f8f8;
169
+ border:1px solid #ddd;
170
+ padding: 1em 1.5em;
171
+ }
172
+
173
+ /* 一致化 horizonal rule */
174
+ hr{
175
+ border:none;
176
+ border-bottom:1px solid #cfcfcf;
177
+ margin-bottom:10px;
178
+ *color:pink;*filter:chroma(color=pink);
179
+ height:10px;
180
+ *margin:-7px 0 2px;
181
+ }
182
+
183
+ /* 底部印刷体、版本等标记 */
184
+ small, .typo-small,
185
+
186
+ /* 图片说明 */
187
+ figcaption {
188
+ font-size: 0.9em;
189
+ color: #888;
190
+ }
191
+
192
+ /* 可拖动文件添加拖动手势 */
193
+ [draggable] {
194
+ cursor: move;
195
+ }
196
+
197
+ .clearfix:before, .clearfix:after {
198
+ content: "";
199
+ display: table;
200
+ }
201
+
202
+ .clearfix:after {
203
+ clear: both
204
+ }
205
+
206
+ .clearfix {
207
+ zoom: 1
208
+ }
209
+
210
+ /* 强制文本换行 */
211
+ .textwrap, .textwrap td, .textwrap th{
212
+ word-wrap:break-word;
213
+ word-break:break-all;
214
+ }
215
+ .textwrap-table{
216
+ table-layout:fixed;
217
+ }
218
+
219
+ /* 保证块/段落之间的空白隔行 */
220
+ .typo p, .typo pre, .typo ul, .typo ol, .typo dl, .typo form, .typo hr, .typo table,
221
+ .typo-p, .typo-pre, .typo-ul, .typo-ol, .typo-dl, .typo-form, .typo-hr, .typo-table {
222
+ margin-bottom: 1.2em;
223
+ }
224
+
225
+ h1, h2, h3, h4, h5, h6{
226
+ font-weight: 500;
227
+ *font-weight: 800;
228
+ font-family: Helvetica Neue, Microsoft Yahei,Hiragino Sans GB,WenQuanYi Micro Hei,sans-serif;
229
+ color:#333;
230
+ }
231
+
232
+ /* 标题应该更贴紧内容,并与其他块区分,margin 值要相应做优化 */
233
+ .typo h1, .typo h2, .typo h3, .typo h4, .typo h5, .typo h6,
234
+ .typo-h1, .typo-h2, .typo-h3, .typo-h4, .typo-h5, .typo-h6 {
235
+ margin-bottom: 0.4em;
236
+ line-height: 1.5;
237
+ }
238
+ .typo h1, .typo-h1 {
239
+ font-size: 1.8em;
240
+ }
241
+ .typo h2, .typo-h2 {
242
+ font-size: 1.6em;
243
+ }
244
+ .typo h3, .typo-h3 {
245
+ font-size: 1.4em;
246
+ }
247
+ .typo h4, .typo-h4 {
248
+ font-size: 1.2em;
249
+ }
250
+ .typo h5, .typo h6, .typo-h5, .typo-h6 {
251
+ font-size: 1em;
252
+ }
253
+
254
+ /* 在文章中,应该还原 ul 和 ol 的样式 */
255
+ .typo ul, .typo-ul {
256
+ margin-left: 1.3em;
257
+ list-style: disc;
258
+ }
259
+ .typo ol, .typo-ol {
260
+ list-style: decimal;
261
+ margin-left: 1.9em;
262
+ }
263
+ .typo li ul, .typo li ol, .typo-ul ul, .typo-ul ol, .typo-ol ul, .typo-ol ol {
264
+ margin-top: 0;
265
+ margin-bottom: 0;
266
+ margin-left: 2em;
267
+ }
268
+ .typo li ul, .typo-ul ul, .typo-ol ul {
269
+ list-style: circle;
270
+ }
271
+
272
+ /* 同 ul/ol,在文章中应用 table 基本格式 */
273
+ .typo table th, .typo table td, .typo-table th, .typo-table td .typo table caption{
274
+ border: 1px solid #ddd;
275
+ padding: 0.5em 1em;
276
+ color:#666;
277
+ }
278
+ .typo table th, .typo-table th {
279
+ background: #fbfbfb;
280
+ }
281
+ .typo table thead th, .typo-table thead th {
282
+ background: #f1f1f1;
283
+ }
284
+ .typo table .caption {
285
+ border-bottom:none;
286
+ }
287
+
288
+ /* 去除 webkit 中 input 和 textarea 的默认样式 */
289
+ .typo-input, .typo-textarea{
290
+ -webkit-appearance:none;
291
+ border-radius:0;
292
+ }
293
+
294
+ /* 高亮选中 */
295
+ ::-moz-selection {
296
+ background:#08c;
297
+ color:#fff;
298
+ }
299
+ ::selection {
300
+ background:#08c;
301
+ color:#fff;
302
+ }
303
+
304
+ /* TODO: 供着重号使用 */
305
+ .typo-em, .typo em, legend, caption {font-weight: 700;}
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: typo-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - namiheike
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-08-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: railties
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '3.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '3.1'
55
+ description: Typo.css for rails
56
+ email:
57
+ - namiheike@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - lib/typo/rails.rb
63
+ - lib/typo/rails/version.rb
64
+ - vendor/assets/stylesheets/typo.css
65
+ - LICENSE
66
+ - README.md
67
+ homepage: http://github.com/namiheike/typo-rails
68
+ licenses:
69
+ - MIT
70
+ metadata: {}
71
+ post_install_message:
72
+ rdoc_options: []
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubyforge_project:
87
+ rubygems_version: 2.0.3
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: Typo.css includes normal reset styles, plus some great styles designed for
91
+ Chinese typography.
92
+ test_files: []