staticpress 0.5.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. data/.rbenv-version +1 -1
  2. data/Gemfile +7 -0
  3. data/README.markdown +0 -14
  4. data/Rakefile +3 -16
  5. data/bin/staticpress +1 -2
  6. data/docs/config.ru +1 -2
  7. data/docs/content/docs.haml +15 -0
  8. data/docs/content/docs/build.markdown +3 -0
  9. data/docs/content/docs/content-types.markdown +1 -1
  10. data/docs/content/docs/deploy.markdown +1 -0
  11. data/docs/content/docs/help.markdown +1 -0
  12. data/docs/content/docs/plugins.markdown +1 -0
  13. data/docs/content/docs/setup.markdown +4 -0
  14. data/docs/content/docs/themes.markdown +1 -0
  15. data/docs/content/features.haml +6 -0
  16. data/docs/content/index.haml +6 -0
  17. data/features/editing_blog.feature +24 -0
  18. data/features/editing_blog_contents.feature +40 -0
  19. data/features/getting_started.feature +19 -0
  20. data/features/step_definitions/editing_blog_contents_steps.rb +128 -0
  21. data/features/step_definitions/editing_blog_steps.rb +52 -0
  22. data/features/step_definitions/getting_started_steps.rb +51 -0
  23. data/features/support/env.rb +26 -2
  24. data/lib/skeleton/config.ru +1 -2
  25. data/lib/staticpress.rb +39 -0
  26. data/lib/staticpress/cli.rb +0 -9
  27. data/lib/staticpress/configuration.rb +4 -19
  28. data/lib/staticpress/content/base.rb +2 -6
  29. data/lib/staticpress/content/category.rb +0 -5
  30. data/lib/staticpress/content/collection_content.rb +0 -3
  31. data/lib/staticpress/content/index.rb +0 -5
  32. data/lib/staticpress/content/page.rb +0 -6
  33. data/lib/staticpress/content/post.rb +0 -5
  34. data/lib/staticpress/content/resource_content.rb +0 -3
  35. data/lib/staticpress/content/static_content.rb +0 -2
  36. data/lib/staticpress/content/tag.rb +0 -5
  37. data/lib/staticpress/content/theme.rb +1 -6
  38. data/lib/staticpress/helpers.rb +0 -4
  39. data/lib/staticpress/integrations.rb +14 -0
  40. data/lib/staticpress/js_object.rb +0 -2
  41. data/lib/staticpress/metadata.rb +0 -3
  42. data/lib/staticpress/plugin.rb +0 -4
  43. data/lib/staticpress/plugins.rb +0 -2
  44. data/lib/staticpress/pusher.rb +0 -4
  45. data/lib/staticpress/route.rb +0 -3
  46. data/lib/staticpress/server.rb +0 -4
  47. data/lib/staticpress/settings.rb +0 -3
  48. data/lib/staticpress/site.rb +0 -10
  49. data/lib/staticpress/theme.rb +0 -3
  50. data/lib/staticpress/version.rb +1 -1
  51. data/lib/staticpress/view_helpers.rb +0 -5
  52. data/lib/themes/basic/assets/styles/_normalize.scss +520 -0
  53. data/lib/themes/basic/assets/styles/all.css.sass +65 -0
  54. data/staticpress.gemspec +12 -13
  55. data/tests/staticpress/content/base_test.rb +2 -10
  56. data/tests/staticpress/content/category_test.rb +0 -4
  57. data/tests/staticpress/content/index_test.rb +0 -4
  58. data/tests/staticpress/content/page_test.rb +0 -3
  59. data/tests/staticpress/content/post_test.rb +0 -3
  60. data/tests/staticpress/content/resource_content_test.rb +0 -3
  61. data/tests/staticpress/content/tag_test.rb +0 -3
  62. data/tests/staticpress/content/theme_test.rb +0 -3
  63. data/tests/staticpress/helpers_test.rb +0 -2
  64. data/tests/staticpress/js_object_test.rb +0 -2
  65. data/tests/staticpress/metadata_test.rb +0 -2
  66. data/tests/staticpress/route_test.rb +0 -2
  67. data/tests/staticpress/server_test.rb +0 -2
  68. data/tests/staticpress/site_test.rb +0 -5
  69. data/tests/staticpress/theme_test.rb +0 -3
  70. data/tests/staticpress/view_helpers_test.rb +0 -3
  71. data/tests/test_blog/config.ru +1 -2
  72. data/tests/test_case.rb +4 -4
  73. metadata +180 -84
  74. data.tar.gz.sig +0 -2
  75. data/docs/content/docs/deploying.markdown +0 -0
  76. data/docs/content/docs/diving-deeper.markdown +0 -3
  77. data/docs/content/docs/theme.markdown +0 -0
  78. data/docs/content/index.markdown +0 -1
  79. data/features/happy_path.feature +0 -202
  80. data/features/step_definitions/staticpress_steps.rb +0 -33
  81. data/lib/staticpress/booter.rb +0 -7
  82. metadata.gz.sig +0 -0
@@ -1,3 +1,27 @@
1
- $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../../lib'))
2
-
3
1
  require 'aruba/cucumber'
2
+
3
+ require 'compass'
4
+ require 'debugger'
5
+ require 'haml'
6
+ require 'redcarpet'
7
+ require 'sass'
8
+
9
+ require_relative '../../lib/staticpress'
10
+
11
+ module IntegrationHelpers
12
+ def create_sample_blog(title = 'Transient Thoughts')
13
+ blog_title = title ? "'#{title}'" : nil
14
+ run_simple "staticpress new temporary_blog #{blog_title}"
15
+ cd('temporary_blog')
16
+ end
17
+
18
+ def run_one_of(*commands)
19
+ run_simple commands.shuffle.first
20
+ end
21
+
22
+ def verify_directory_contains_file(directory, file)
23
+ check_directory_presence [directory], true
24
+ check_file_presence ["#{directory}/#{file}"], true
25
+ end
26
+ end
27
+ World IntegrationHelpers
@@ -1,5 +1,4 @@
1
- require 'staticpress/booter'
2
- require 'staticpress/server'
1
+ require 'staticpress'
3
2
 
4
3
  use Rack::ShowStatus
5
4
  use Rack::ShowExceptions
@@ -1,3 +1,11 @@
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('./Gemfile')
2
+
3
+ if File.exists?(ENV['BUNDLE_GEMFILE'])
4
+ require 'bundler'
5
+
6
+ Bundler.require
7
+ end
8
+
1
9
  require 'pathname'
2
10
 
3
11
  module Staticpress
@@ -13,3 +21,34 @@ module Staticpress
13
21
  Pathname File.expand_path('..', __FILE__)
14
22
  end
15
23
  end
24
+
25
+ require 'staticpress/js_object'
26
+ require 'staticpress/error'
27
+ require 'staticpress/helpers'
28
+ require 'staticpress/configuration'
29
+
30
+ require 'staticpress/content/resource_content'
31
+ require 'staticpress/content/collection_content'
32
+ require 'staticpress/content/static_content'
33
+
34
+ require 'staticpress/content/base'
35
+ require 'staticpress/content/category'
36
+ require 'staticpress/content/index'
37
+ require 'staticpress/content/page'
38
+ require 'staticpress/content/post'
39
+ require 'staticpress/content/tag'
40
+ require 'staticpress/content/theme'
41
+
42
+ require 'staticpress/cli'
43
+ require 'staticpress/integrations'
44
+ require 'staticpress/metadata'
45
+ require 'staticpress/plugin'
46
+ require 'staticpress/plugins'
47
+ require 'staticpress/pusher'
48
+ require 'staticpress/route'
49
+ require 'staticpress/server'
50
+ require 'staticpress/settings'
51
+ require 'staticpress/site'
52
+ require 'staticpress/theme'
53
+ require 'staticpress/version'
54
+ require 'staticpress/view_helpers'
@@ -4,15 +4,6 @@ require 'fileutils'
4
4
  require 'rack'
5
5
  require 'thor'
6
6
 
7
- require 'staticpress'
8
- require 'staticpress/error'
9
- require 'staticpress/helpers'
10
- require 'staticpress/plugin'
11
- require 'staticpress/pusher'
12
- require 'staticpress/settings'
13
- require 'staticpress/site'
14
- require 'staticpress/version'
15
-
16
7
  module Staticpress
17
8
  class CLI < Thor
18
9
  include Thor::Actions
@@ -1,8 +1,5 @@
1
1
  require 'yaml'
2
2
 
3
- require 'staticpress'
4
- require 'staticpress/js_object'
5
-
6
3
  module Staticpress
7
4
  # IDEA look into configatron https://github.com/markbates/configatron
8
5
  # FIXME this class is hard to test
@@ -15,25 +12,13 @@ module Staticpress
15
12
  end
16
13
 
17
14
  def self.default
18
- @default ||= lambda do
19
- reply = YAML.load_file(Staticpress.root + 'skeleton' + 'config.yml')
20
-
21
- reply[:template_engine_options] ||= {}
22
-
23
- if defined? Compass
24
- [ :sass, :scss ].each do |template_engine|
25
- (reply[:template_engine_options][template_engine] ||= {}).merge!(Compass.sass_engine_options) do |key, first_choice, second_choice|
26
- reply[:template_engine_options][template_engine].key?(key) ? first_choice : second_choice
27
- end
28
- end
29
- end
30
-
31
- new reply
32
- end.call
15
+ @default ||= new(YAML.load_file(Staticpress.root + 'skeleton' + 'config.yml'))
33
16
  end
34
17
 
35
18
  def self.instance
36
- new(default.to_hash.merge(YAML.load_file(Staticpress.blog_path + 'config.yml')))
19
+ custom_file = Staticpress.blog_path + 'config.yml'
20
+ custom = custom_file.file? ? YAML.load_file(custom_file) : {}
21
+ new(default.to_hash.merge(custom))
37
22
  end
38
23
  end
39
24
  end
@@ -3,12 +3,6 @@ require 'rack/mime'
3
3
  require 'tilt'
4
4
  require 'yaml'
5
5
 
6
- require 'staticpress'
7
- require 'staticpress/metadata'
8
- require 'staticpress/route'
9
- require 'staticpress/theme'
10
- require 'staticpress/view_helpers'
11
-
12
6
  module Staticpress::Content
13
7
  class Base
14
8
  extend Staticpress::Helpers
@@ -39,8 +33,10 @@ module Staticpress::Content
39
33
  def content
40
34
  return @content if @content
41
35
 
36
+ # regex_frontmatter = /^\<!-{2,}${1}(?<frontmatter>.*)^-+>${1}/m
42
37
  regex_frontmatter = /^-{3}${1}(?<frontmatter>.*)^-{3}${1}/m
43
38
  regex_text = /(?<text>.*)/m
39
+ # regex = /(#{regex_frontmatter})?#{regex_text}/
44
40
  regex = /#{regex_frontmatter}#{regex_text}/
45
41
 
46
42
  c = template_path_content
@@ -1,8 +1,3 @@
1
- require 'staticpress'
2
- require 'staticpress/content/base'
3
- require 'staticpress/content/collection_content'
4
- require 'staticpress/content/resource_content'
5
-
6
1
  module Staticpress::Content
7
2
  class Category < Base
8
3
  include CollectionContent
@@ -1,6 +1,3 @@
1
- require 'staticpress'
2
- require 'staticpress/content/resource_content'
3
-
4
1
  module Staticpress::Content
5
2
  module CollectionContent
6
3
  include ResourceContent
@@ -1,8 +1,3 @@
1
- require 'staticpress'
2
- require 'staticpress/content/base'
3
- require 'staticpress/content/post'
4
- require 'staticpress/content/collection_content'
5
-
6
1
  module Staticpress::Content
7
2
  class Index < Base
8
3
  include CollectionContent
@@ -1,11 +1,5 @@
1
1
  require 'pathname'
2
2
 
3
- require 'staticpress'
4
- require 'staticpress/content/base'
5
- require 'staticpress/content/resource_content'
6
- require 'staticpress/content/static_content'
7
- require 'staticpress/route'
8
-
9
3
  module Staticpress::Content
10
4
  class Page < Base
11
5
  include StaticContent
@@ -1,8 +1,3 @@
1
- require 'staticpress'
2
- require 'staticpress/content/base'
3
- require 'staticpress/content/resource_content'
4
- require 'staticpress/route'
5
-
6
1
  module Staticpress::Content
7
2
  class Post < Base
8
3
  include ResourceContent
@@ -1,8 +1,5 @@
1
1
  require 'pathname'
2
2
 
3
- require 'staticpress'
4
- require 'staticpress/content/static_content'
5
-
6
3
  module Staticpress::Content
7
4
  module ResourceContent
8
5
  def find_supported_extensions(path)
@@ -1,7 +1,5 @@
1
1
  require 'tilt'
2
2
 
3
- require 'staticpress'
4
-
5
3
  module Staticpress::Content
6
4
  module StaticContent
7
5
  # layout not needed for binary files
@@ -1,8 +1,3 @@
1
- require 'staticpress'
2
- require 'staticpress/content/base'
3
- require 'staticpress/content/collection_content'
4
- require 'staticpress/content/resource_content'
5
-
6
1
  module Staticpress::Content
7
2
  class Tag < Base
8
3
  include CollectionContent
@@ -1,9 +1,3 @@
1
- require 'staticpress'
2
- require 'staticpress/content/base'
3
- require 'staticpress/content/resource_content'
4
- require 'staticpress/content/static_content'
5
- require 'staticpress/route'
6
-
7
1
  module Staticpress::Content
8
2
  class Theme < Base
9
3
  include ResourceContent
@@ -20,6 +14,7 @@ module Staticpress::Content
20
14
  (Staticpress::Theme.new(params[:theme]).root + 'assets' + params[:asset_type] + params[:slug]).file?
21
15
  end
22
16
 
17
+ # https://github.com/sstephenson/hike
23
18
  def template_path
24
19
  Staticpress::Theme.new(params[:theme]).root + 'assets' + params[:asset_type] + "#{params[:slug]}#{template_extension}"
25
20
  end
@@ -1,9 +1,5 @@
1
1
  require 'pathname'
2
2
 
3
- require 'staticpress'
4
- require 'staticpress/configuration'
5
- require 'staticpress/settings'
6
-
7
3
  module Staticpress
8
4
  module Helpers
9
5
  def config
@@ -0,0 +1,14 @@
1
+ if defined? Sass
2
+ theme_name = Staticpress::Configuration.instance.theme
3
+
4
+ sass_paths = [
5
+ (Staticpress.blog_path + 'themes' + theme_name + 'assets' + 'styles'),
6
+ (Staticpress.root + 'themes' + theme_name + 'assets' + 'styles')
7
+ ]
8
+
9
+ sass_paths << Compass.sass_engine_options[:load_paths] if defined? Compass
10
+
11
+ (sass_paths.flatten - Sass.load_paths).each do |path|
12
+ Sass.load_paths << path
13
+ end
14
+ end
@@ -1,7 +1,5 @@
1
1
  require 'ostruct'
2
2
 
3
- require 'staticpress'
4
-
5
3
  module Staticpress
6
4
  class JSObject < OpenStruct
7
5
  def -(other)
@@ -1,6 +1,3 @@
1
- require 'staticpress'
2
- require 'staticpress/js_object'
3
-
4
1
  module Staticpress
5
2
  class Metadata < JSObject
6
3
  def <<(other)
@@ -1,7 +1,3 @@
1
- require 'staticpress'
2
- require 'staticpress/error'
3
- require 'staticpress/helpers'
4
-
5
1
  module Staticpress
6
2
  module Plugin
7
3
  extend Staticpress::Helpers
@@ -1,5 +1,3 @@
1
- require 'staticpress'
2
-
3
1
  module Staticpress
4
2
  module Plugins
5
3
  end
@@ -1,7 +1,3 @@
1
- require 'staticpress'
2
- require 'staticpress/error'
3
- require 'staticpress/helpers'
4
-
5
1
  module Staticpress
6
2
  class Pusher
7
3
  extend Staticpress::Helpers
@@ -1,6 +1,3 @@
1
- require 'staticpress'
2
- require 'staticpress/helpers'
3
-
4
1
  module Staticpress
5
2
  module Route
6
3
  extend Staticpress::Helpers
@@ -1,7 +1,3 @@
1
- require 'staticpress'
2
- require 'staticpress/error'
3
- require 'staticpress/site'
4
-
5
1
  module Staticpress
6
2
  class Server
7
3
  def initialize
@@ -1,6 +1,3 @@
1
- require 'staticpress'
2
- require 'staticpress/js_object'
3
-
4
1
  module Staticpress
5
2
  class Settings < JSObject
6
3
  def self.default
@@ -1,15 +1,5 @@
1
1
  require 'fileutils'
2
2
 
3
- require 'staticpress'
4
- require 'staticpress/content/index'
5
- require 'staticpress/content/category'
6
- require 'staticpress/content/tag'
7
- require 'staticpress/content/page'
8
- require 'staticpress/content/post'
9
- require 'staticpress/content/theme'
10
- require 'staticpress/helpers'
11
- require 'staticpress/metadata'
12
-
13
3
  module Staticpress
14
4
  class Site
15
5
  # ordered by priority
@@ -1,6 +1,3 @@
1
- require 'staticpress'
2
- require 'staticpress/helpers'
3
-
4
1
  module Staticpress
5
2
  class Theme
6
3
  extend Staticpress::Helpers
@@ -2,7 +2,7 @@ module Staticpress
2
2
  class Version
3
3
  extend Comparable
4
4
 
5
- SIGNATURE = [0, 5, 2]
5
+ SIGNATURE = [0, 6, 0]
6
6
 
7
7
  def self.<=>(other)
8
8
  other = other.split('.').map(&:to_i) if other.respond_to? :split
@@ -1,8 +1,3 @@
1
- require 'staticpress'
2
- require 'staticpress/helpers'
3
- require 'staticpress/plugin'
4
- require 'staticpress/plugins'
5
-
6
1
  module Staticpress
7
2
  class ViewHelpers
8
3
  include Staticpress::Helpers
@@ -0,0 +1,520 @@
1
+ /*! normalize.css 2012-03-09T22:11 UTC - http://github.com/necolas/normalize.css */
2
+
3
+ /* =============================================================================
4
+ HTML5 display definitions
5
+ ========================================================================== */
6
+
7
+ /*
8
+ * Corrects block display not defined in IE6/7/8/9 & FF3
9
+ */
10
+
11
+ article,
12
+ aside,
13
+ details,
14
+ figcaption,
15
+ figure,
16
+ footer,
17
+ header,
18
+ hgroup,
19
+ nav,
20
+ section,
21
+ summary {
22
+ display: block;
23
+ }
24
+
25
+ /*
26
+ * Corrects inline-block display not defined in IE6/7/8/9 & FF3
27
+ */
28
+
29
+ audio,
30
+ canvas,
31
+ video {
32
+ display: inline-block;
33
+ *display: inline;
34
+ *zoom: 1;
35
+ }
36
+
37
+ /*
38
+ * Prevents modern browsers from displaying 'audio' without controls
39
+ * Remove excess height in iOS5 devices
40
+ */
41
+
42
+ audio:not([controls]) {
43
+ display: none;
44
+ height: 0;
45
+ }
46
+
47
+ /*
48
+ * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4
49
+ * Known issue: no IE6 support
50
+ */
51
+
52
+ [hidden] {
53
+ display: none;
54
+ }
55
+
56
+
57
+ /* =============================================================================
58
+ Base
59
+ ========================================================================== */
60
+
61
+ /*
62
+ * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units
63
+ * http://clagnut.com/blog/348/#c790
64
+ * 2. Prevents iOS text size adjust after orientation change, without disabling user zoom
65
+ * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
66
+ */
67
+
68
+ html {
69
+ font-size: 100%; /* 1 */
70
+ -webkit-text-size-adjust: 100%; /* 2 */
71
+ -ms-text-size-adjust: 100%; /* 2 */
72
+ }
73
+
74
+ /*
75
+ * Addresses font-family inconsistency between 'textarea' and other form elements.
76
+ */
77
+
78
+ html,
79
+ button,
80
+ input,
81
+ select,
82
+ textarea {
83
+ font-family: sans-serif;
84
+ }
85
+
86
+ /*
87
+ * Addresses margins handled incorrectly in IE6/7
88
+ */
89
+
90
+ body {
91
+ margin: 0;
92
+ }
93
+
94
+
95
+ /* =============================================================================
96
+ Links
97
+ ========================================================================== */
98
+
99
+ /*
100
+ * Addresses outline displayed oddly in Chrome
101
+ */
102
+
103
+ a:focus {
104
+ outline: thin dotted;
105
+ }
106
+
107
+ /*
108
+ * Improves readability when focused and also mouse hovered in all browsers
109
+ * people.opera.com/patrickl/experiments/keyboard/test
110
+ */
111
+
112
+ a:hover,
113
+ a:active {
114
+ outline: 0;
115
+ }
116
+
117
+
118
+ /* =============================================================================
119
+ Typography
120
+ ========================================================================== */
121
+
122
+ /*
123
+ * Addresses font sizes and margins set differently in IE6/7
124
+ * Addresses font sizes within 'section' and 'article' in FF4+, Chrome, S5
125
+ */
126
+
127
+ h1 {
128
+ font-size: 2em;
129
+ margin: 0.67em 0;
130
+ }
131
+
132
+ h2 {
133
+ font-size: 1.5em;
134
+ margin: 0.83em 0;
135
+ }
136
+
137
+ h3 {
138
+ font-size: 1.17em;
139
+ margin: 1em 0;
140
+ }
141
+
142
+ h4 {
143
+ font-size: 1em;
144
+ margin: 1.33em 0;
145
+ }
146
+
147
+ h5 {
148
+ font-size: 0.83em;
149
+ margin: 1.67em 0;
150
+ }
151
+
152
+ h6 {
153
+ font-size: 0.75em;
154
+ margin: 2.33em 0;
155
+ }
156
+
157
+ /*
158
+ * Addresses styling not present in IE7/8/9, S5, Chrome
159
+ */
160
+
161
+ abbr[title] {
162
+ border-bottom: 1px dotted;
163
+ }
164
+
165
+ /*
166
+ * Addresses style set to 'bolder' in FF3+, S4/5, Chrome
167
+ */
168
+
169
+ b,
170
+ strong {
171
+ font-weight: bold;
172
+ }
173
+
174
+ blockquote {
175
+ margin: 1em 40px;
176
+ }
177
+
178
+ /*
179
+ * Addresses styling not present in S5, Chrome
180
+ */
181
+
182
+ dfn {
183
+ font-style: italic;
184
+ }
185
+
186
+ /*
187
+ * Addresses styling not present in IE6/7/8/9
188
+ */
189
+
190
+ mark {
191
+ background: #ff0;
192
+ color: #000;
193
+ }
194
+
195
+ /*
196
+ * Addresses margins set differently in IE6/7
197
+ */
198
+
199
+ p,
200
+ pre {
201
+ margin: 1em 0;
202
+ }
203
+
204
+ /*
205
+ * Corrects font family set oddly in IE6, S4/5, Chrome
206
+ * en.wikipedia.org/wiki/User:Davidgothberg/Test59
207
+ */
208
+
209
+ pre,
210
+ code,
211
+ kbd,
212
+ samp {
213
+ font-family: monospace, serif;
214
+ _font-family: 'courier new', monospace;
215
+ font-size: 1em;
216
+ }
217
+
218
+ /*
219
+ * Improves readability of pre-formatted text in all browsers
220
+ */
221
+
222
+ pre {
223
+ white-space: pre;
224
+ white-space: pre-wrap;
225
+ word-wrap: break-word;
226
+ }
227
+
228
+ /*
229
+ * 1. Addresses CSS quotes not supported in IE6/7
230
+ * 2. Addresses quote property not supported in S4
231
+ */
232
+
233
+ /* 1 */
234
+
235
+ q {
236
+ quotes: none;
237
+ }
238
+
239
+ /* 2 */
240
+
241
+ q:before,
242
+ q:after {
243
+ content: '';
244
+ content: none;
245
+ }
246
+
247
+ small {
248
+ font-size: 75%;
249
+ }
250
+
251
+ /*
252
+ * Prevents sub and sup affecting line-height in all browsers
253
+ * gist.github.com/413930
254
+ */
255
+
256
+ sub,
257
+ sup {
258
+ font-size: 75%;
259
+ line-height: 0;
260
+ position: relative;
261
+ vertical-align: baseline;
262
+ }
263
+
264
+ sup {
265
+ top: -0.5em;
266
+ }
267
+
268
+ sub {
269
+ bottom: -0.25em;
270
+ }
271
+
272
+
273
+ /* =============================================================================
274
+ Lists
275
+ ========================================================================== */
276
+
277
+ /*
278
+ * Addresses margins set differently in IE6/7
279
+ */
280
+
281
+ dl,
282
+ menu,
283
+ ol,
284
+ ul {
285
+ margin: 1em 0;
286
+ }
287
+
288
+ dd {
289
+ margin: 0 0 0 40px;
290
+ }
291
+
292
+ /*
293
+ * Addresses paddings set differently in IE6/7
294
+ */
295
+
296
+ menu,
297
+ ol,
298
+ ul {
299
+ padding: 0 0 0 40px;
300
+ }
301
+
302
+ /*
303
+ * Corrects list images handled incorrectly in IE7
304
+ */
305
+
306
+ nav ul,
307
+ nav ol {
308
+ list-style: none;
309
+ list-style-image: none;
310
+ }
311
+
312
+
313
+ /* =============================================================================
314
+ Embedded content
315
+ ========================================================================== */
316
+
317
+ /*
318
+ * 1. Removes border when inside 'a' element in IE6/7/8/9, FF3
319
+ * 2. Improves image quality when scaled in IE7
320
+ * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
321
+ */
322
+
323
+ img {
324
+ border: 0; /* 1 */
325
+ -ms-interpolation-mode: bicubic; /* 2 */
326
+ }
327
+
328
+ /*
329
+ * Corrects overflow displayed oddly in IE9
330
+ */
331
+
332
+ svg:not(:root) {
333
+ overflow: hidden;
334
+ }
335
+
336
+
337
+ /* =============================================================================
338
+ Figures
339
+ ========================================================================== */
340
+
341
+ /*
342
+ * Addresses margin not present in IE6/7/8/9, S5, O11
343
+ */
344
+
345
+ figure {
346
+ margin: 0;
347
+ }
348
+
349
+
350
+ /* =============================================================================
351
+ Forms
352
+ ========================================================================== */
353
+
354
+ /*
355
+ * Corrects margin displayed oddly in IE6/7
356
+ */
357
+
358
+ form {
359
+ margin: 0;
360
+ }
361
+
362
+ /*
363
+ * Define consistent border, margin, and padding
364
+ */
365
+
366
+ fieldset {
367
+ border: 1px solid #c0c0c0;
368
+ margin: 0 2px;
369
+ padding: 0.35em 0.625em 0.75em;
370
+ }
371
+
372
+ /*
373
+ * 1. Corrects color not being inherited in IE6/7/8/9
374
+ * 2. Corrects text not wrapping in FF3
375
+ * 3. Corrects alignment displayed oddly in IE6/7
376
+ */
377
+
378
+ legend {
379
+ border: 0; /* 1 */
380
+ padding: 0;
381
+ white-space: normal; /* 2 */
382
+ *margin-left: -7px; /* 3 */
383
+ }
384
+
385
+ /*
386
+ * 1. Corrects font size not being inherited in all browsers
387
+ * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome
388
+ * 3. Improves appearance and consistency in all browsers
389
+ */
390
+
391
+ button,
392
+ input,
393
+ select,
394
+ textarea {
395
+ font-size: 100%; /* 1 */
396
+ margin: 0; /* 2 */
397
+ vertical-align: baseline; /* 3 */
398
+ *vertical-align: middle; /* 3 */
399
+ }
400
+
401
+ /*
402
+ * Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet
403
+ */
404
+
405
+ button,
406
+ input {
407
+ line-height: normal; /* 1 */
408
+ }
409
+
410
+ /*
411
+ * 1. Improves usability and consistency of cursor style between image-type 'input' and others
412
+ * 2. Corrects inability to style clickable 'input' types in iOS
413
+ * 3. Removes inner spacing in IE7 without affecting normal text inputs
414
+ * Known issue: inner spacing remains in IE6
415
+ */
416
+
417
+ button,
418
+ input[type="button"],
419
+ input[type="reset"],
420
+ input[type="submit"] {
421
+ cursor: pointer; /* 1 */
422
+ -webkit-appearance: button; /* 2 */
423
+ *overflow: visible; /* 3 */
424
+ }
425
+
426
+ /*
427
+ * Re-set default cursor for disabled elements
428
+ */
429
+
430
+ button[disabled],
431
+ input[disabled] {
432
+ cursor: default;
433
+ }
434
+
435
+ /*
436
+ * 1. Addresses box sizing set to content-box in IE8/9
437
+ * 2. Removes excess padding in IE8/9
438
+ * 3. Removes excess padding in IE7
439
+ Known issue: excess padding remains in IE6
440
+ */
441
+
442
+ input[type="checkbox"],
443
+ input[type="radio"] {
444
+ box-sizing: border-box; /* 1 */
445
+ padding: 0; /* 2 */
446
+ *height: 13px; /* 3 */
447
+ *width: 13px; /* 3 */
448
+ }
449
+
450
+ /*
451
+ * 1. Addresses appearance set to searchfield in S5, Chrome
452
+ * 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof)
453
+ */
454
+
455
+ input[type="search"] {
456
+ -webkit-appearance: textfield; /* 1 */
457
+ -moz-box-sizing: content-box;
458
+ -webkit-box-sizing: content-box; /* 2 */
459
+ box-sizing: content-box;
460
+ }
461
+
462
+ /*
463
+ * Removes inner padding and search cancel button in S5, Chrome on OS X
464
+ */
465
+
466
+ input[type="search"]::-webkit-search-decoration,
467
+ input[type="search"]::-webkit-search-cancel-button {
468
+ -webkit-appearance: none;
469
+ }
470
+
471
+ /*
472
+ * Removes inner padding and border in FF3+
473
+ * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/
474
+ */
475
+
476
+ button::-moz-focus-inner,
477
+ input::-moz-focus-inner {
478
+ border: 0;
479
+ padding: 0;
480
+ }
481
+
482
+ /*
483
+ * 1. Removes default vertical scrollbar in IE6/7/8/9
484
+ * 2. Improves readability and alignment in all browsers
485
+ */
486
+
487
+ textarea {
488
+ overflow: auto; /* 1 */
489
+ vertical-align: top; /* 2 */
490
+ }
491
+
492
+ /*
493
+ * Addresses placeholder color unset in Firefox
494
+ */
495
+
496
+ :-moz-placeholder {
497
+ color: #a9a9a9;
498
+ }
499
+
500
+ /*
501
+ * Addresses placeholder text remaining visible on focus in Chrome
502
+ */
503
+
504
+ :focus::-webkit-input-placeholder {
505
+ color: transparent;
506
+ }
507
+
508
+
509
+ /* =============================================================================
510
+ Tables
511
+ ========================================================================== */
512
+
513
+ /*
514
+ * Remove most spacing between table cells
515
+ */
516
+
517
+ table {
518
+ border-collapse: collapse;
519
+ border-spacing: 0;
520
+ }