ramaze 2011.07.25 → 2011.10.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. data/.gitignore +3 -0
  2. data/.mailmap +3 -2
  3. data/.travis.yml +17 -0
  4. data/.yardopts +13 -0
  5. data/README.md +95 -352
  6. data/examples/app/blog/app.rb +25 -64
  7. data/examples/app/blog/config.ru +11 -9
  8. data/examples/app/blog/controller/init.rb +29 -86
  9. data/examples/app/blog/controller/posts.rb +232 -0
  10. data/examples/app/blog/controller/users.rb +160 -0
  11. data/examples/app/blog/layout/default.xhtml +61 -0
  12. data/examples/app/blog/migrations/01_create_schema.rb +50 -0
  13. data/examples/app/blog/model/comment.rb +41 -54
  14. data/examples/app/blog/model/init.rb +41 -13
  15. data/examples/app/blog/model/post.rb +35 -0
  16. data/examples/app/blog/model/user.rb +105 -0
  17. data/examples/app/blog/public/.htaccess +24 -0
  18. data/examples/app/blog/public/css/grid.css +107 -0
  19. data/examples/app/blog/public/css/layout.css +203 -0
  20. data/examples/app/blog/public/css/reset.css +123 -0
  21. data/examples/app/blog/public/css/text.css +109 -0
  22. data/examples/app/blog/public/dispatch.fcgi +11 -0
  23. data/examples/app/blog/public/favicon.ico +0 -0
  24. data/examples/app/blog/public/images/bg.png +0 -0
  25. data/examples/app/blog/start.rb +18 -3
  26. data/examples/app/blog/view/feed.xhtml +23 -0
  27. data/examples/app/blog/view/form.xhtml +11 -0
  28. data/examples/app/blog/view/index.xhtml +44 -0
  29. data/examples/app/blog/view/users/form.xhtml +12 -0
  30. data/examples/app/blog/view/users/index.xhtml +30 -0
  31. data/examples/app/blog/view/users/login.xhtml +8 -0
  32. data/examples/app/blog/view/view.xhtml +68 -0
  33. data/{doc → guide}/AUTHORS +5 -3
  34. data/{doc → guide}/CHANGELOG +428 -0
  35. data/{doc/GPL → guide/GPL_LICENSE} +0 -0
  36. data/{doc/COPYING → guide/RUBY_LICENSE} +3 -6
  37. data/guide/_static/logo.png +0 -0
  38. data/guide/_static/logo.svg +49 -0
  39. data/guide/_static/ramaze_console.png +0 -0
  40. data/guide/css/common.css +20 -0
  41. data/guide/general/cache.md +167 -0
  42. data/guide/general/configuration.md +168 -0
  43. data/guide/general/contributing.md +108 -0
  44. data/guide/general/controllers.md +115 -0
  45. data/guide/general/helpers.md +76 -0
  46. data/guide/general/installation.md +58 -0
  47. data/guide/general/logging.md +99 -0
  48. data/guide/general/middlewares.md +100 -0
  49. data/guide/general/models.md +78 -0
  50. data/guide/general/principles.md +53 -0
  51. data/guide/general/ramaze_command.md +155 -0
  52. data/guide/general/routes.md +81 -0
  53. data/guide/general/sessions.md +140 -0
  54. data/guide/general/special_thanks.md +67 -0
  55. data/guide/general/testing.md +61 -0
  56. data/guide/general/views.md +322 -0
  57. data/guide/tutorials/introduction.md +259 -0
  58. data/lib/proto/config.ru +1 -1
  59. data/lib/proto/public/favicon.ico +0 -0
  60. data/lib/proto/view/index.xhtml +7 -7
  61. data/lib/ramaze.rb +4 -4
  62. data/lib/ramaze/app.rb +11 -11
  63. data/lib/ramaze/app_graph.rb +2 -4
  64. data/lib/ramaze/bin/console.rb +3 -3
  65. data/lib/ramaze/bin/create.rb +2 -2
  66. data/lib/ramaze/bin/restart.rb +4 -4
  67. data/lib/ramaze/bin/runner.rb +5 -5
  68. data/lib/ramaze/bin/start.rb +19 -4
  69. data/lib/ramaze/bin/status.rb +3 -3
  70. data/lib/ramaze/bin/stop.rb +3 -3
  71. data/lib/ramaze/cache.rb +1 -0
  72. data/lib/ramaze/cache/lru.rb +8 -4
  73. data/lib/ramaze/cache/memcache.rb +32 -13
  74. data/lib/ramaze/cache/redis.rb +164 -0
  75. data/lib/ramaze/cache/sequel.rb +43 -28
  76. data/lib/ramaze/controller.rb +1 -2
  77. data/lib/ramaze/dependencies.rb +40 -3
  78. data/lib/ramaze/helper/bench.rb +26 -16
  79. data/lib/ramaze/helper/blue_form.rb +46 -73
  80. data/lib/ramaze/helper/cache.rb +10 -6
  81. data/lib/ramaze/helper/csrf.rb +35 -39
  82. data/lib/ramaze/helper/disqus.rb +5 -4
  83. data/lib/ramaze/helper/email.rb +35 -24
  84. data/lib/ramaze/helper/erector.rb +9 -13
  85. data/lib/ramaze/helper/flash.rb +7 -9
  86. data/lib/ramaze/helper/formatting.rb +194 -179
  87. data/lib/ramaze/helper/gravatar.rb +4 -8
  88. data/lib/ramaze/helper/identity.rb +3 -3
  89. data/lib/ramaze/helper/layout.rb +23 -8
  90. data/lib/ramaze/helper/markaby.rb +1 -1
  91. data/lib/ramaze/helper/paginate.rb +46 -39
  92. data/lib/ramaze/helper/request_accessor.rb +3 -1
  93. data/lib/ramaze/helper/simple_captcha.rb +18 -17
  94. data/lib/ramaze/helper/stack.rb +1 -1
  95. data/lib/ramaze/helper/tagz.rb +4 -2
  96. data/lib/ramaze/helper/upload.rb +523 -0
  97. data/lib/ramaze/helper/user.rb +4 -8
  98. data/lib/ramaze/helper/xhtml.rb +11 -15
  99. data/lib/ramaze/log.rb +9 -6
  100. data/lib/ramaze/log/rotatinginformer.rb +62 -27
  101. data/lib/ramaze/log/syslog.rb +20 -15
  102. data/lib/ramaze/log/xosd.rb +2 -1
  103. data/lib/ramaze/reloader.rb +2 -0
  104. data/lib/ramaze/request.rb +11 -10
  105. data/lib/ramaze/setup.rb +23 -6
  106. data/lib/ramaze/snippets/array/put_within.rb +3 -9
  107. data/lib/ramaze/snippets/binding/locals.rb +5 -10
  108. data/lib/ramaze/snippets/fiber.rb +1 -23
  109. data/lib/ramaze/snippets/kernel/pretty_inspect.rb +3 -6
  110. data/lib/ramaze/snippets/numeric/filesize_format.rb +3 -5
  111. data/lib/ramaze/snippets/numeric/time.rb +3 -7
  112. data/lib/ramaze/snippets/object/__dir__.rb +3 -7
  113. data/lib/ramaze/snippets/object/instance_variable_defined.rb +3 -6
  114. data/lib/ramaze/snippets/object/pretty.rb +3 -7
  115. data/lib/ramaze/snippets/object/scope.rb +7 -9
  116. data/lib/ramaze/snippets/proc/locals.rb +12 -12
  117. data/lib/ramaze/snippets/ramaze/acquire.rb +15 -14
  118. data/lib/ramaze/snippets/ramaze/deprecated.rb +1 -1
  119. data/lib/ramaze/snippets/ramaze/fiber.rb +1 -1
  120. data/lib/ramaze/snippets/ramaze/lru_hash.rb +2 -3
  121. data/lib/ramaze/snippets/ramaze/struct.rb +2 -4
  122. data/lib/ramaze/snippets/string/camel_case.rb +8 -10
  123. data/lib/ramaze/snippets/string/color.rb +3 -4
  124. data/lib/ramaze/snippets/string/end_with.rb +3 -6
  125. data/lib/ramaze/snippets/string/esc.rb +3 -8
  126. data/lib/ramaze/snippets/string/ord.rb +3 -8
  127. data/lib/ramaze/snippets/string/snake_case.rb +6 -9
  128. data/lib/ramaze/snippets/string/start_with.rb +3 -8
  129. data/lib/ramaze/snippets/string/unindent.rb +3 -6
  130. data/lib/ramaze/snippets/thread/into.rb +1 -3
  131. data/lib/ramaze/spec.rb +2 -31
  132. data/lib/ramaze/spec/bacon.rb +18 -2
  133. data/lib/ramaze/version.rb +1 -1
  134. data/lib/ramaze/view.rb +1 -1
  135. data/ramaze.gemspec +1 -1
  136. data/spec/helper.rb +2 -1
  137. data/spec/ramaze/bin/start.rb +16 -20
  138. data/spec/ramaze/cache/localmemcache.rb +4 -7
  139. data/spec/ramaze/cache/memcache.rb +3 -1
  140. data/spec/ramaze/cache/redis.rb +62 -0
  141. data/spec/ramaze/helper/blue_form.rb +33 -4
  142. data/spec/ramaze/helper/layout.rb +40 -7
  143. data/spec/ramaze/helper/upload.rb +149 -0
  144. data/spec/ramaze/helper/uploads/text_1.txt +1 -0
  145. data/spec/ramaze/helper/uploads/text_2.txt +1 -0
  146. data/spec/ramaze/log/growl.rb +4 -6
  147. data/spec/ramaze/log/syslog.rb +6 -0
  148. data/spec/ramaze/view/lokar.rb +5 -0
  149. data/spec/ramaze/view/nagoro.rb +5 -0
  150. data/tasks/authors.rake +1 -1
  151. data/tasks/bacon.rake +14 -5
  152. data/tasks/changelog.rake +1 -1
  153. data/tasks/yard.rake +12 -4
  154. metadata +277 -239
  155. data/doc/LEGAL +0 -26
  156. data/examples/app/blog/README +0 -3
  157. data/examples/app/blog/controller/comment.rb +0 -45
  158. data/examples/app/blog/controller/entry.rb +0 -85
  159. data/examples/app/blog/controller/main.rb +0 -20
  160. data/examples/app/blog/controller/tag.rb +0 -9
  161. data/examples/app/blog/layout/default.nag +0 -31
  162. data/examples/app/blog/model/entry.rb +0 -89
  163. data/examples/app/blog/model/tag.rb +0 -36
  164. data/examples/app/blog/public/css/screen.css +0 -273
  165. data/examples/app/blog/spec/blog.rb +0 -87
  166. data/examples/app/blog/view/comment/form.nag +0 -10
  167. data/examples/app/blog/view/comment/show.nag +0 -16
  168. data/examples/app/blog/view/entry/edit.nag +0 -14
  169. data/examples/app/blog/view/entry/feed.atom.nag +0 -8
  170. data/examples/app/blog/view/entry/feed.rss.nag +0 -7
  171. data/examples/app/blog/view/entry/index.nag +0 -7
  172. data/examples/app/blog/view/entry/new.nag +0 -13
  173. data/examples/app/blog/view/entry/show.nag +0 -36
  174. data/examples/app/blog/view/feed.atom.nag +0 -18
  175. data/examples/app/blog/view/feed.rss.nag +0 -25
  176. data/examples/app/blog/view/index.nag +0 -6
  177. data/examples/app/blog/view/tag/index.nag +0 -5
  178. data/lib/proto/public/ramaze.png +0 -0
  179. data/lib/ramaze/rest.rb +0 -36
  180. data/spec/ramaze/rest.rb +0 -28
  181. data/tasks/rcov.rake +0 -22
@@ -0,0 +1,105 @@
1
+ ##
2
+ # The User model is user for retrieving and authenticating users. This
3
+ # application uses bcrypt to hash the passwords. For more information on bcrypt
4
+ # see the following pages:
5
+ #
6
+ # * http://codahale.com/how-to-safely-store-a-password/
7
+ # * http://yorickpeterse.com/articles/use-bcrypt-fool/
8
+ # * https://github.com/codahale/bcrypt-ruby
9
+ #
10
+ # @author Yorick Peterse
11
+ # @since 26-09-2011
12
+ #
13
+ class User < Sequel::Model
14
+ # A user can have any number of posts and comments.
15
+ one_to_many :posts
16
+ one_to_many :comments
17
+
18
+ ##
19
+ # User.authenticate() is used to authenticate a user. Each request the User
20
+ # helper calls this method to see if the currently logged in user is a valid
21
+ # user. Once called this methods queries the database and returns a valid User
22
+ # object in case the specified details were correct or something that
23
+ # evaluates to false if this wasn't the case.
24
+ #
25
+ # @author Yorick Peterse
26
+ # @since 26-09-2011
27
+ # @param [Hash] creds A hash containing the username and password of the
28
+ # currently logged in user.
29
+ # @return [Users|FalseClass]
30
+ #
31
+ def self.authenticate(creds)
32
+ username, password = creds['username'], creds['password']
33
+
34
+ if creds['username'].nil? or creds['username'].empty?
35
+ return false
36
+ end
37
+
38
+ # Let's see if there is a user for the given username.
39
+ user = self[:username => username]
40
+
41
+ # Validate the user. Note that while it may seem that the password is
42
+ # compared as plain text this is not the case. The bcrypt class
43
+ # automatically converts the given password to a bcrypt hash. If these
44
+ # hashes are the same the specified password is correct.
45
+ if !user.nil? or user.password == password
46
+ return user
47
+ else
48
+ return false
49
+ end
50
+ end
51
+
52
+ ##
53
+ # In order to properly use bcrypt we have to override the password=() and
54
+ # password() methods to return a correct bcrypt hash/object rather than
55
+ # whatever was stored in the database as a String instance.
56
+ #
57
+ # @author Yorick Peterse
58
+ # @since 26-09-2011
59
+ # @param [String] password The new password of a user.
60
+ #
61
+ def password=(password)
62
+ # Passing an empty password to the BCrypt class triggers errors.
63
+ if password.nil? or password.empty?
64
+ return
65
+ end
66
+
67
+ # Generates a new bcrypt password using a cost of 10. In my opinion a cost
68
+ # higher than 10 makes a web based application too slow.
69
+ password = BCrypt::Password.create(password, :cost => 10)
70
+
71
+ super(password)
72
+ end
73
+
74
+ ##
75
+ # Because the password=() is overwritten with a custom one we also have to
76
+ # define a matching getter. Without this you'd get an instance of String
77
+ # containing the bcrypt hash and thus wouldn't be able to properly compare it
78
+ # to other passwords.
79
+ #
80
+ # @author Yorick Peterse
81
+ # @since 26-09-2011
82
+ # @return [BCrypt::Password|NilClass]
83
+ #
84
+ def password
85
+ password = super
86
+
87
+ if !password.nil?
88
+ return BCrypt::Password.new(password)
89
+ else
90
+ return nil
91
+ end
92
+ end
93
+
94
+ ##
95
+ # Validates an instance of this model. See Post#validate() for some extra
96
+ # details on how this works.
97
+ #
98
+ # @author Yorick Peterse
99
+ # @since 26-09-2011
100
+ #
101
+ def validate
102
+ validates_presence(:username)
103
+ validates_presence(:password) if new?
104
+ end
105
+ end # User
@@ -0,0 +1,24 @@
1
+ # General Apache options
2
+ Options +FollowSymLinks +ExecCGI
3
+ AddHandler cgi-script cgi rb
4
+ <IfModule mod_fastcgi.c>
5
+ AddHandler fastcgi-script fcgi
6
+ </IfModule>
7
+ <IfModule mod_fcgid.c>
8
+ AddHandler fcgid-script fcgi
9
+ </IfModule>
10
+
11
+ # Redirect all requests not available on the filesystem to Ramaze.
12
+
13
+ RewriteEngine On
14
+ RewriteCond %{REQUEST_FILENAME} !-f
15
+ RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
16
+
17
+ # In case Ramaze experiences terminal errors.
18
+ # Instead of displaying this message you can supply a
19
+ # file here which will be rendered instead.
20
+ #
21
+ # Example:
22
+ # ErrorDocument 500 /500.html
23
+
24
+ ErrorDocument 500 "<h2>Application error</h2>Ramaze failed to start properly"
@@ -0,0 +1,107 @@
1
+ @charset "UTF-8";
2
+
3
+ /**
4
+ * Modified version of the CSS grid (aka 1140 CSS) that can be found at http://cssgrid.net
5
+ *
6
+ * This modified version has some extra enhancements to make it a bit easier to work with
7
+ * the grid. Along with these minor fixes I also renamed all grid classes to the names
8
+ * used by the 960 grid system as I find "grid_6" easier to write than "sixcol".
9
+ */
10
+ .container
11
+ {
12
+ overflow: hidden;
13
+ padding-left: 1%;
14
+ padding-right: 1%;
15
+ }
16
+
17
+ .row
18
+ {
19
+ max-width: 96%;
20
+ margin: 0 auto;
21
+ overflow: hidden;
22
+ width: 100%;
23
+ }
24
+
25
+ .grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6, .grid_7, .grid_8, .grid_9,
26
+ .grid_10, .grid_11
27
+ {
28
+ float: left;
29
+ margin-right: 3.8%;
30
+ min-height: 1px;
31
+ }
32
+
33
+ .row .grid_1
34
+ {
35
+ width: 4.85%;
36
+ }
37
+
38
+ .row .grid_2
39
+ {
40
+ width: 13.45%;
41
+ }
42
+
43
+ .row .grid_3
44
+ {
45
+ width: 22.05%;
46
+ }
47
+
48
+ .row .grid_4
49
+ {
50
+ width: 30.75%;
51
+ }
52
+
53
+ .row .grid_5
54
+ {
55
+ width: 39.45%;
56
+ }
57
+
58
+ .row .grid_6
59
+ {
60
+ width: 48%;
61
+ }
62
+
63
+ .row .grid_7
64
+ {
65
+ width: 56.75%;
66
+ }
67
+
68
+ .row .grid_8
69
+ {
70
+ width: 65.4%;
71
+ }
72
+
73
+ .row .grid_9
74
+ {
75
+ width: 74.05%;
76
+ }
77
+
78
+ .row .grid_10
79
+ {
80
+ width: 82.7%;
81
+ }
82
+
83
+ .row .grid_11
84
+ {
85
+ width: 91.35%;
86
+ }
87
+
88
+ .row .grid_12
89
+ {
90
+ float: left;
91
+ width: 100%;
92
+ }
93
+
94
+ .last, .row > *:last-child
95
+ {
96
+ margin-right: 0px;
97
+ }
98
+
99
+ img, object, embed
100
+ {
101
+ max-width: 100%;
102
+ }
103
+
104
+ img
105
+ {
106
+ height: auto;
107
+ }
@@ -0,0 +1,203 @@
1
+ /**
2
+ * Stylesheet used for the layout of most elements.
3
+ *
4
+ * @author Yorick Peterse
5
+ * @link http://yorickpeterse.com/
6
+ */
7
+ #container
8
+ {
9
+ margin: 20px auto;
10
+ width: 940px;
11
+ }
12
+
13
+ #content
14
+ {
15
+ background: #fff;
16
+ border: 1px solid #ddd;
17
+ padding: 20px;
18
+ width: 898px;
19
+ }
20
+
21
+ /* Top part of the website, contains the title and the navigation menu */
22
+ #top
23
+ {
24
+ background: #E33F1E;
25
+ height: 70px;
26
+ margin-bottom: 20px;
27
+ padding: 0px 10px;
28
+ }
29
+
30
+ #top header h1
31
+ {
32
+ color: #fff;
33
+ font-size: 38px;
34
+ margin: 10px 0px 0px 0px;
35
+ padding: 0px;
36
+ }
37
+
38
+ #top nav ul
39
+ {
40
+ float: right;
41
+ margin-right: 15px;
42
+ }
43
+
44
+ #top nav ul li
45
+ {
46
+ float: left;
47
+ font-size: 16px;
48
+ list-style-type: none;
49
+ margin-right: 10px;
50
+ }
51
+
52
+ #top nav ul li:last-child
53
+ {
54
+ margin-right: 0px;
55
+ }
56
+
57
+ #top nav ul li a
58
+ {
59
+ color: #fff;
60
+ display: block;
61
+ height: 45px;
62
+ padding: 25px 10px 0px 10px;
63
+ text-decoration: none;
64
+ }
65
+
66
+ #top nav ul li a:hover
67
+ {
68
+ background: #D43919;
69
+ }
70
+
71
+ /* Footer at the bottom of the page */
72
+ #footer
73
+ {
74
+ text-align: center;
75
+ }
76
+
77
+ #footer p
78
+ {
79
+ font-size: 13px;
80
+ margin-bottom: 10px;
81
+ }
82
+
83
+ form label
84
+ {
85
+ display: block;
86
+ }
87
+
88
+ form label span.error
89
+ {
90
+ color: #E33F1E;
91
+ }
92
+
93
+ form input[type="text"], form textarea, form input[type="password"]
94
+ {
95
+ border: 1px solid #ccc;
96
+ font-size: 14px;
97
+ padding: 5px;
98
+ width: 300px;
99
+ }
100
+
101
+ form textarea
102
+ {
103
+ width: auto;
104
+ }
105
+
106
+ form input[type="submit"]
107
+ {
108
+ background: #fff;
109
+ border: 1px solid #ccc;
110
+ font-size: 14px;
111
+ padding: 3px 5px;
112
+ }
113
+
114
+ form input[type="submit"]:hover
115
+ {
116
+ background: #eee;
117
+ }
118
+
119
+ /* Comments */
120
+ #comments > h1
121
+ {
122
+ margin-bottom: 10px;
123
+ }
124
+
125
+ #comments article header h1
126
+ {
127
+ font-size: 16px;
128
+ }
129
+
130
+ #comments article header .meta
131
+ {
132
+ margin-bottom: 10px;
133
+ }
134
+
135
+ /* Notifications */
136
+ .message
137
+ {
138
+ margin-bottom: 20px;
139
+ text-align: center;
140
+ }
141
+
142
+ .message p
143
+ {
144
+ margin-bottom: 0px;
145
+ padding: 5px;
146
+ }
147
+
148
+ .message.success
149
+ {
150
+ background: #DAEDA6;
151
+ color: #000;
152
+ }
153
+
154
+ .message.error
155
+ {
156
+ background: #E33F1E;
157
+ color: #fff;
158
+ }
159
+
160
+ /* Pagination system */
161
+ .pager span
162
+ {
163
+ display: none;
164
+ }
165
+
166
+ .pager a
167
+ {
168
+ border: 1px solid #ccc;
169
+ display: inline-block;
170
+ margin-right: 8px;
171
+ min-width: 20px;
172
+ padding: 5px;
173
+ text-decoration: none;
174
+ text-align: center;
175
+ }
176
+
177
+ .pager a:hover, .pager a.current
178
+ {
179
+ background: #eee;
180
+ color: #000;
181
+ }
182
+
183
+ table
184
+ {
185
+ margin-bottom: 10px;
186
+ text-align: left;
187
+ }
188
+
189
+ table thead tr th
190
+ {
191
+ border-bottom: 2px solid #ccc!important;
192
+ }
193
+
194
+ table thead tr th, table tbody tr td
195
+ {
196
+ border-bottom: 1px solid #ccc;
197
+ padding: 8px 3px;
198
+ }
199
+
200
+ table tbody tr:last-child td
201
+ {
202
+ border-bottom: none;
203
+ }
@@ -0,0 +1,123 @@
1
+ @charset "UTF-8";
2
+
3
+ /**
4
+ * http://meyerweb.com/eric/tools/css/reset/
5
+ * v2.0 | 20110126
6
+ * License: none (public domain)
7
+ */
8
+ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre,
9
+ a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small,
10
+ strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset,
11
+ form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside,
12
+ canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output,
13
+ ruby, section, summary, time, mark, audio, video
14
+ {
15
+ border: 0;
16
+ font-size: 100%;
17
+ font: inherit;
18
+ margin: 0;
19
+ padding: 0;
20
+ vertical-align: baseline;
21
+ }
22
+
23
+ /* HTML5 display-role reset for older browsers */
24
+ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section
25
+ {
26
+ display: block;
27
+ }
28
+
29
+ body
30
+ {
31
+ line-height: 1.3;
32
+ }
33
+
34
+ ol, ul, ol li, ul li
35
+ {
36
+ list-style-type: none;
37
+ margin: 0px;
38
+ padding: 0px;
39
+ }
40
+
41
+ blockquote, q
42
+ {
43
+ quotes: none;
44
+ }
45
+
46
+ blockquote:before, blockquote:after, q:before, q:after
47
+ {
48
+ content: '';
49
+ content: none;
50
+ }
51
+
52
+ table
53
+ {
54
+ /**
55
+ * Instead of "collapse" I'm using "separate" as that allows me to give table cells
56
+ * a border without having to go through a lot of trouble
57
+ */
58
+ border-collapse: separate;
59
+ border-spacing: 0;
60
+ width: 100%;
61
+ }
62
+
63
+ table th
64
+ {
65
+ font-weight: bold;
66
+ }
67
+
68
+ pre, code
69
+ {
70
+ font-size: 13px;
71
+ font-family: monospace;
72
+ }
73
+
74
+ /**
75
+ * These form elements usually don't trigger any special cursor and thus can confuse
76
+ * users when these elements have custom styles (e.g. a background image).
77
+ */
78
+ input[type="submit"], input[type="button"], input[type="checkbox"], input[type="radio"],
79
+ button, select
80
+ {
81
+ cursor: pointer;
82
+ }
83
+
84
+ *[disabled], *[disabled="disabled"]
85
+ {
86
+ cursor: not-allowed;
87
+ }
88
+
89
+ textarea
90
+ {
91
+ overflow: auto;
92
+ }
93
+
94
+ acronym, abbr
95
+ {
96
+ cursor: help;
97
+ }
98
+
99
+ /* Some typography related styles */
100
+ body
101
+ {
102
+ font-size: 16px;
103
+ }
104
+
105
+ h1, h2, h3, h4, h5, h6
106
+ {
107
+ font-weight: bold;
108
+ }
109
+
110
+ a:hover, a:active
111
+ {
112
+ outline: none;
113
+ }
114
+
115
+ strong
116
+ {
117
+ font-weight: bold;
118
+ }
119
+
120
+ small
121
+ {
122
+ font-size: 11px;
123
+ }