trickster 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. data/.gitignore +16 -0
  2. data/.rvmrc +1 -0
  3. data/Gemfile +2 -0
  4. data/README.rdoc +57 -13
  5. data/Rakefile +120 -0
  6. data/TODO +4 -0
  7. data/bin/trickster +66 -24
  8. data/css/themes-orig/arta.css +155 -0
  9. data/css/themes-orig/ascetic.css +50 -0
  10. data/css/themes-orig/brown_paper.css +102 -0
  11. data/css/themes-orig/brown_papersq.png +0 -0
  12. data/css/themes-orig/dark.css +101 -0
  13. data/css/themes-orig/default.css +132 -0
  14. data/css/themes-orig/far.css +111 -0
  15. data/css/themes-orig/github.css +131 -0
  16. data/css/themes-orig/googlecode.css +144 -0
  17. data/css/themes-orig/idea.css +121 -0
  18. data/css/themes-orig/ir_black.css +98 -0
  19. data/css/themes-orig/magula.css +119 -0
  20. data/css/themes-orig/monokai.css +112 -0
  21. data/css/themes-orig/pojoaque.css +104 -0
  22. data/css/themes-orig/pojoaque.jpg +0 -0
  23. data/css/themes-orig/rainbow.css +114 -0
  24. data/css/themes-orig/school_book.css +109 -0
  25. data/css/themes-orig/school_book.png +0 -0
  26. data/css/themes-orig/solarized_dark.css +88 -0
  27. data/css/themes-orig/solarized_light.css +88 -0
  28. data/css/themes-orig/sunburst.css +148 -0
  29. data/css/themes-orig/tomorrow-night-blue.css +42 -0
  30. data/css/themes-orig/tomorrow-night-bright.css +41 -0
  31. data/css/themes-orig/tomorrow-night-eighties.css +41 -0
  32. data/css/themes-orig/tomorrow-night.css +42 -0
  33. data/css/themes-orig/tomorrow.css +39 -0
  34. data/css/themes-orig/vs.css +85 -0
  35. data/css/themes-orig/xcode.css +154 -0
  36. data/css/themes-orig/zenburn.css +113 -0
  37. data/css/themes/arta.css +186 -0
  38. data/css/themes/ascetic.css +81 -0
  39. data/css/themes/brown_paper.css +133 -0
  40. data/css/themes/custom.scss +322 -0
  41. data/css/themes/dark.css +132 -0
  42. data/css/themes/default.css +163 -0
  43. data/css/themes/far.css +142 -0
  44. data/css/themes/github.css +162 -0
  45. data/css/themes/googlecode.css +175 -0
  46. data/css/themes/idea.css +152 -0
  47. data/css/themes/ir_black.css +129 -0
  48. data/css/themes/magula.css +150 -0
  49. data/css/themes/monokai.css +143 -0
  50. data/css/themes/pojoaque.css +135 -0
  51. data/css/themes/rainbow.css +145 -0
  52. data/css/themes/school_book.css +140 -0
  53. data/css/themes/solarized_dark.css +119 -0
  54. data/css/themes/solarized_light.css +119 -0
  55. data/css/themes/sunburst.css +179 -0
  56. data/css/themes/tomorrow-night-blue.css +73 -0
  57. data/css/themes/tomorrow-night-bright.css +72 -0
  58. data/css/themes/tomorrow-night-eighties.css +72 -0
  59. data/css/themes/tomorrow-night.css +73 -0
  60. data/css/themes/tomorrow.css +70 -0
  61. data/css/themes/vs.css +116 -0
  62. data/css/themes/xcode.css +185 -0
  63. data/css/themes/zenburn.css +144 -0
  64. data/erb/index.html.erb +2 -2
  65. data/features/build.feature +18 -0
  66. data/features/init.feature +57 -0
  67. data/features/step_definitions/trickster_steps.rb +78 -0
  68. data/features/support/env.rb +15 -0
  69. data/features/update.feature +33 -0
  70. data/js/trickster.js +1 -1
  71. data/lib/trickster.rb +2 -0
  72. data/lib/trickster/copier.rb +11 -0
  73. data/lib/trickster/file_copier.rb +1 -8
  74. data/lib/trickster/renderer/code_renderer.rb +47 -10
  75. data/lib/trickster/theme_copier.rb +16 -0
  76. data/lib/trickster/version.rb +1 -1
  77. data/notes.txt.md +56 -0
  78. data/test/jasmine.yml +4 -0
  79. data/test/js/bullets_spec.js +82 -0
  80. data/test/js/sizer_spec.js +244 -0
  81. data/test/js/trickster_spec.js +10 -0
  82. data/test/js/utils_spec.js +56 -0
  83. data/test/slide_parser_test.rb +50 -0
  84. data/test/slide_renderer_test.rb +316 -0
  85. data/{css → test/slideshow-with-sass/css}/highlight-solarized_light.min.css +0 -0
  86. data/test/slideshow-with-sass/css/normalize.css +375 -0
  87. data/test/slideshow-with-sass/css/styles.scss +66 -0
  88. data/test/slideshow-with-sass/js/bullets.js +83 -0
  89. data/test/slideshow-with-sass/js/custom.js +11 -0
  90. data/test/slideshow-with-sass/js/lib/highlight-7.1.min.js +1 -0
  91. data/test/slideshow-with-sass/js/lib/jquery-1.8.0.min.js +2 -0
  92. data/test/slideshow-with-sass/js/lib/jquerytypewriter.js +54 -0
  93. data/test/slideshow-with-sass/js/lib/underscore-1.3.3.min.js +32 -0
  94. data/test/slideshow-with-sass/js/sizer.js +149 -0
  95. data/test/slideshow-with-sass/js/trickster.js +216 -0
  96. data/test/slideshow-with-sass/js/utils.js +19 -0
  97. data/test/slideshow-with-sass/rudy.png +0 -0
  98. data/test/slideshow-with-sass/slides +47 -0
  99. data/test/slideshow/css/highlight-solarized_light.min.css +37 -0
  100. data/test/slideshow/css/normalize.css +375 -0
  101. data/test/slideshow/css/styles.css +66 -0
  102. data/test/slideshow/css/theme.css +163 -0
  103. data/test/slideshow/index.html +77 -0
  104. data/test/slideshow/js/bullets.js +83 -0
  105. data/test/slideshow/js/custom.js +11 -0
  106. data/test/slideshow/js/lib/highlight-7.1.min.js +1 -0
  107. data/test/slideshow/js/lib/jquery-1.8.0.min.js +2 -0
  108. data/test/slideshow/js/lib/jquerytypewriter.js +54 -0
  109. data/test/slideshow/js/lib/underscore-1.3.3.min.js +32 -0
  110. data/test/slideshow/js/sizer.js +149 -0
  111. data/test/slideshow/js/trickster.js +216 -0
  112. data/test/slideshow/js/utils.js +19 -0
  113. data/test/slideshow/rudy.png +0 -0
  114. data/test/slideshow/slides +47 -0
  115. data/test/test_helper.rb +11 -0
  116. data/trickster.gemspec +27 -0
  117. data/trickster.rdoc +44 -8
  118. metadata +348 -62
  119. data/js/lib/highlight-fc32801.min.js +0 -4601
@@ -0,0 +1,10 @@
1
+ describe("Trickster",function() {
2
+ beforeEach(function() {
3
+ document.location.hash = "";
4
+ });
5
+ it("has a reasonable initial state", function() {
6
+ Trickster = TricksterLoader(TricksterDefaultConfig,{});
7
+ expect(Trickster.currentSlide).toBe(0);
8
+ expect(Trickster.totalSlides).toBe(1);
9
+ });
10
+ });
@@ -0,0 +1,56 @@
1
+ describe("Utils",function() {
2
+ describe("fOr",function() {
3
+ it("uses the first function if it's defined",function() {
4
+ // Given
5
+ var called = false;
6
+ var realFunction = function() {
7
+ called = true;
8
+ };
9
+ var otherCalled = false;
10
+ var otherFunction = function() {
11
+ otherCalled = true;
12
+ };
13
+
14
+ // When
15
+ Utils.fOr(realFunction,otherFunction)();
16
+
17
+ expect(called).toBe(true);
18
+ expect(otherCalled).toBe(false);
19
+ });
20
+ it("uses the other function if the first one is not defined",function() {
21
+ // Given
22
+ var otherCalled = false;
23
+ var otherFunction = function() {
24
+ otherCalled = true;
25
+ };
26
+
27
+ // When
28
+ Utils.fOr(undefined,otherFunction)();
29
+
30
+ expect(otherCalled).toBe(true);
31
+ });
32
+ });
33
+ describe("f",function() {
34
+ it("uses the real funciton passed",function() {
35
+ // Given
36
+ var returnValue = 42;
37
+ var realFunction = function() {
38
+ return returnValue;
39
+ };
40
+
41
+ // When
42
+ var func = Utils.f(realFunction);
43
+
44
+ // Then
45
+ expect(func()).toBe(returnValue);
46
+ });
47
+
48
+ it("uses a no-op function if none passed",function() {
49
+ // When
50
+ var func = Utils.f();
51
+
52
+ // Then
53
+ expect(func()).toBe(undefined);
54
+ });
55
+ });
56
+ });
@@ -0,0 +1,50 @@
1
+ require 'test_helper.rb'
2
+
3
+ class SlideParserTest < Clean::Test::TestCase
4
+
5
+ class RememberingRenderer
6
+ attr_reader :rendered_slides
7
+ def initialize
8
+ @rendered_slides = []
9
+ end
10
+ def render_slide(slide_type,content)
11
+ @rendered_slides << [slide_type,content]
12
+ end
13
+ def content
14
+ @rendered_slides.inspect
15
+ end
16
+ end
17
+
18
+ test_that "title is grabbed from the first line" do
19
+ Given {
20
+ @title = any_string
21
+ @lines = [ @title, any_string, any_string ]
22
+ @parser = Trickster::SlideParser.new(@lines,nil)
23
+ }
24
+ Then {
25
+ assert_equal @title,@parser.title
26
+ }
27
+ end
28
+
29
+ test_that "the renderer is called for each slide" do
30
+ Given {
31
+ @slides = [
32
+ ['TITLE',[any_string,any_string]],
33
+ ['BULLETS',[any_string,any_string]],
34
+ ];
35
+ lines = @slides.map { |(slide_type,content)|
36
+ ["!#{slide_type}",content]
37
+ }.flatten
38
+ lines.unshift(any_string)
39
+ @renderer = RememberingRenderer.new
40
+ @parser = Trickster::SlideParser.new(lines,@renderer)
41
+ }
42
+ When {
43
+ @resulting_content = @parser.body
44
+ }
45
+ Then {
46
+ assert_equal @slides.inspect,@resulting_content
47
+ assert_equal @slides,@renderer.rendered_slides
48
+ }
49
+ end
50
+ end
@@ -0,0 +1,316 @@
1
+ require 'test_helper.rb'
2
+
3
+ class SlideRendererTest < Clean::Test::TestCase
4
+ def setup
5
+ @renderer = Trickster::SlideRenderer.new
6
+ end
7
+
8
+ NORMAL_TYPES = ["TITLE","SECTION","NORMAL"]
9
+ NORMAL_TYPES.each do |slide_type|
10
+ test_that "a #{slide_type} slide gets first three lines rendered in HTML" do
11
+ Given {
12
+ @content = [
13
+ any_string,
14
+ any_string,
15
+ any_string,
16
+ any_string,
17
+ ]
18
+ }
19
+ When {
20
+ @renderer.render_slide(slide_type,@content)
21
+ }
22
+ Then {
23
+ assert_content(
24
+ slide_type,
25
+ [
26
+ "<h1>#{@content[0]}</h1>",
27
+ "<h2>#{@content[1]}</h2>",
28
+ "<h3>#{@content[2]}</h3>",
29
+ ],
30
+ @renderer.content)
31
+ }
32
+ end
33
+ test_that "a #{slide_type} slide gets first line rendered in HTML if there aren't three lines" do
34
+ Given {
35
+ @content = [
36
+ any_string,
37
+ ]
38
+ }
39
+ When {
40
+ @renderer.render_slide(slide_type,@content)
41
+ }
42
+ Then {
43
+ assert_content(slide_type,"<h1>#{@content[0]}</h1>",@renderer.content)
44
+ }
45
+ end
46
+ test_that "a #{slide_type} slide a background data element if specified in the options" do
47
+ Given {
48
+ @content = [
49
+ any_string,
50
+ ]
51
+ @background = any_string
52
+ }
53
+ When {
54
+ @renderer.render_slide(slide_type + ": background=#{@background}",@content)
55
+ }
56
+ Then {
57
+ assert_content(slide_type,"<h1>#{@content[0]}</h1>",@renderer.content,@background)
58
+ }
59
+ end
60
+ test_that "a #{slide_type} slide a transition time data element if specified in the options" do
61
+ Given {
62
+ @content = [
63
+ any_string,
64
+ ]
65
+ @transition = any_int
66
+ }
67
+ When {
68
+ @renderer.render_slide(slide_type + ": transition=#{@transition}",@content)
69
+ }
70
+ Then {
71
+ assert_content(slide_type,"<h1>#{@content[0]}</h1>",@renderer.content,nil,@transition)
72
+ }
73
+ end
74
+ end
75
+
76
+ test_that "an image just has its first line rendered in an img tag" do
77
+ Given {
78
+ @image_url = any_string
79
+ }
80
+ When {
81
+ @renderer.render_slide("IMAGE",[@image_url])
82
+ }
83
+ Then {
84
+ assert_content("IMAGE","<img src='#{@image_url}'>",@renderer.content)
85
+ }
86
+ end
87
+
88
+ test_that "bullets get the first line as title, remainder as bullets, removing the bullet char" do
89
+ Given {
90
+ @title = any_string
91
+ @bullet1 = any_string
92
+ @bullet2 = any_string
93
+ @bullet3 = any_string
94
+ @bullet4 = any_string
95
+ @content = [
96
+ @title,
97
+ "* #{@bullet1}",
98
+ "+ #{@bullet2}",
99
+ "- #{@bullet3}",
100
+ "#{@bullet4}",
101
+ ];
102
+ }
103
+ When {
104
+ @renderer.render_slide("BULLETS",@content)
105
+ }
106
+ Then {
107
+ assert_content(
108
+ "BULLETS",
109
+ [
110
+ "<h1>#{@title}</h1>",
111
+ "<ul>",
112
+ "<li>#{@bullet1}</li>",
113
+ "<li>#{@bullet2}</li>",
114
+ "<li>#{@bullet3}</li>",
115
+ "<li>#{@bullet4}</li>",
116
+ "</ul>",
117
+ ],
118
+ @renderer.content)
119
+ }
120
+ end
121
+
122
+ test_that "COMMANDLINE puts every other line as a command" do
123
+ Given {
124
+ @command1 = any_string
125
+ @result1 = any_string
126
+ @command2 = any_string
127
+ @result2 = any_string
128
+ @content = [
129
+ ">" + @command1,
130
+ @result1,
131
+ "%" + @command2,
132
+ @result2,
133
+ ]
134
+ }
135
+ When {
136
+ @renderer.render_slide("COMMANDLINE",@content)
137
+ }
138
+ Then {
139
+ assert_content(
140
+ "COMMANDLINE",
141
+ [
142
+ "<pre><code class='no-highlight'><span class='cli-prompt'>&gt;</span> <span class='cli-element cli-command cli-line'>#{@command1}</span>",
143
+ "<span class='cli-element cli-result'><span class='cli-line'>#{@result1}</span></span>",
144
+ "<span class='cli-prompt'>%</span> <span class='cli-element cli-command cli-line'>#{@command2}</span>",
145
+ "<span class='cli-element cli-result'><span class='cli-line'>#{@result2}</span></span>",
146
+ "</code></pre>",
147
+ ],
148
+ @renderer.content)
149
+ }
150
+ end
151
+
152
+ test_that "COMMANDLINE groups commands and responses together" do
153
+ Given {
154
+ @command1 = any_string :max => 10
155
+ @result1a = any_string :max => 10
156
+ @result1b = any_string :max => 10
157
+ @command2 = any_string :max => 10
158
+ @result2 = any_string :max => 10
159
+ @command3 = any_string :max => 10
160
+ @content = [
161
+ ">" + @command1,
162
+ @result1a,
163
+ @result1b,
164
+ "%" + @command2,
165
+ @result2,
166
+ ">" + @command3,
167
+ ]
168
+ }
169
+ When {
170
+ @renderer.render_slide("COMMANDLINE",@content)
171
+ }
172
+ Then {
173
+ assert_content(
174
+ "COMMANDLINE",
175
+ [
176
+ "<pre><code class='no-highlight'><span class='cli-prompt'>&gt;</span> <span class='cli-element cli-command cli-line'>#{@command1}</span>",
177
+ "<span class='cli-element cli-result'><span class='cli-line'>#{@result1a}</span>",
178
+ "<span class='cli-line'>#{@result1b}</span></span>",
179
+ "<span class='cli-prompt'>%</span> <span class='cli-element cli-command cli-line'>#{@command2}</span>",
180
+ "<span class='cli-element cli-result'><span class='cli-line'>#{@result2}</span></span>",
181
+ "<span class='cli-prompt'>&gt;</span> <span class='cli-element cli-command cli-line'>#{@command3}</span>",
182
+ "</code></pre>",
183
+ ],
184
+ @renderer.content)
185
+ }
186
+ end
187
+
188
+ test_that "CODE wraps the code in a pre/code block" do
189
+ Given {
190
+ @code = [
191
+ "#{any_string}",
192
+ " #{any_string}",
193
+ " #{any_string} #{any_string}",
194
+ "#{any_string}",
195
+ ]
196
+ }
197
+ When {
198
+ @renderer.render_slide("CODE",@code)
199
+ }
200
+ Then {
201
+ assert_content(
202
+ "CODE",
203
+ [
204
+ "<pre><code data-strikeouts='' data-callout-lines=''>#{wrap_line(@code[0],1)}",
205
+ wrap_line(@code[1],2),
206
+ wrap_line(@code[2],3),
207
+ "#{wrap_line(@code[3],4)}</code></pre>",
208
+ ],
209
+ @renderer.content)
210
+ }
211
+ end
212
+ test_that "CODE uses the language specified in the options" do
213
+ Given {
214
+ @code = [
215
+ "#{any_string}",
216
+ " #{any_string}",
217
+ " #{any_string} #{any_string}",
218
+ "#{any_string}",
219
+ ]
220
+ @language = any_string
221
+ }
222
+ When {
223
+ @renderer.render_slide("CODE: language=#{@language}",@code)
224
+ }
225
+ Then {
226
+ assert_content(
227
+ "CODE",
228
+ [
229
+ "<pre><code class='#{@language}' data-strikeouts='' data-callout-lines=''>#{wrap_line(@code[0],1)}",
230
+ wrap_line(@code[1],2),
231
+ wrap_line(@code[2],3),
232
+ "#{wrap_line(@code[3],4)}</code></pre>",
233
+ ],
234
+ @renderer.content)
235
+ }
236
+ end
237
+
238
+ test_that "CODE that has callouts, with strikouts, as those added to the proper data attributes" do
239
+ Given {
240
+ @code = [
241
+ "#{any_string}",
242
+ " #{any_string}",
243
+ " #{any_string} #{any_string}",
244
+ "#{any_string}",
245
+ ]
246
+ }
247
+ When {
248
+ @renderer.render_slide("CODE: callout=1,-2,3",@code)
249
+ }
250
+ Then {
251
+ assert_content(
252
+ "CODE",
253
+ [
254
+ "<pre><code data-strikeouts='2' data-callout-lines='1,2,3'><div class='lines-callout'>#{wrap_line(@code[0],1,true)}",
255
+ wrap_line(@code[1],2,true),
256
+ wrap_line(@code[2],3,true),
257
+ "</div>#{wrap_line(@code[3],4)}</code></pre>",
258
+ ],
259
+ @renderer.content)
260
+ }
261
+ end
262
+
263
+ test_that "CODE can be read from a file" do
264
+ Given {
265
+ @code = [
266
+ "#{any_string}",
267
+ " #{any_string}",
268
+ " #{any_string} #{any_string}",
269
+ "#{any_string}",
270
+ ]
271
+ @filename = "/tmp/#{$$}.code"
272
+ File.open(@filename,'w') do |file|
273
+ @code.each do |line|
274
+ file.puts line
275
+ end
276
+ end
277
+ }
278
+ When {
279
+ @renderer.render_slide("CODE",["file://" + @filename])
280
+ }
281
+ Then {
282
+ assert_content(
283
+ "CODE",
284
+ [
285
+ "<pre><code data-strikeouts='' data-callout-lines=''>#{wrap_line(@code[0],1)}",
286
+ wrap_line(@code[1],2),
287
+ wrap_line(@code[2],3),
288
+ "#{wrap_line(@code[3],4)}</code></pre>",
289
+ ],
290
+ @renderer.content)
291
+ }
292
+ end
293
+
294
+ private
295
+
296
+ def assert_content(slide_type,lines,content,background_attribute=nil,transition_attribute=nil)
297
+ expected_content = [
298
+ "<section class='#{slide_type}'#{extra_attributes(background_attribute,transition_attribute)}>",
299
+ lines,
300
+ "</section>",
301
+ "",
302
+ ].flatten.join("\n")
303
+ assert_equal expected_content,content
304
+ end
305
+
306
+ def extra_attributes(background_attribute,transition_attribute)
307
+ background = background_attribute.nil? ? '' : " data-background='#{background_attribute}'"
308
+ transition = transition_attribute.nil? ? '' : " data-transition='#{transition_attribute}'"
309
+
310
+ return background + transition
311
+ end
312
+
313
+ def wrap_line(line,index,callout=false)
314
+ "<span class='line line-#{index} #{callout ? 'line-callout' : ''}' >#{line}</span>"
315
+ end
316
+ end
@@ -0,0 +1,375 @@
1
+ /*! normalize.css v2.0.1 | MIT License | git.io/normalize */
2
+
3
+ /* ==========================================================================
4
+ HTML5 display definitions
5
+ ========================================================================== */
6
+
7
+ /*
8
+ * Corrects `block` display not defined in IE 8/9.
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 IE 8/9.
27
+ */
28
+
29
+ audio,
30
+ canvas,
31
+ video {
32
+ display: inline-block;
33
+ }
34
+
35
+ /*
36
+ * Prevents modern browsers from displaying `audio` without controls.
37
+ * Remove excess height in iOS 5 devices.
38
+ */
39
+
40
+ audio:not([controls]) {
41
+ display: none;
42
+ height: 0;
43
+ }
44
+
45
+ /*
46
+ * Addresses styling for `hidden` attribute not present in IE 8/9.
47
+ */
48
+
49
+ [hidden] {
50
+ display: none;
51
+ }
52
+
53
+ /* ==========================================================================
54
+ Base
55
+ ========================================================================== */
56
+
57
+ /*
58
+ * 1. Sets default font family to sans-serif.
59
+ * 2. Prevents iOS text size adjust after orientation change, without disabling
60
+ * user zoom.
61
+ */
62
+
63
+ html {
64
+ font-family: sans-serif; /* 1 */
65
+ -webkit-text-size-adjust: 100%; /* 2 */
66
+ -ms-text-size-adjust: 100%; /* 2 */
67
+ }
68
+
69
+ /*
70
+ * Removes default margin.
71
+ */
72
+
73
+ body {
74
+ margin: 0;
75
+ }
76
+
77
+ /* ==========================================================================
78
+ Links
79
+ ========================================================================== */
80
+
81
+ /*
82
+ * Addresses `outline` inconsistency between Chrome and other browsers.
83
+ */
84
+
85
+ a:focus {
86
+ outline: thin dotted;
87
+ }
88
+
89
+ /*
90
+ * Improves readability when focused and also mouse hovered in all browsers.
91
+ */
92
+
93
+ a:active,
94
+ a:hover {
95
+ outline: 0;
96
+ }
97
+
98
+ /* ==========================================================================
99
+ Typography
100
+ ========================================================================== */
101
+
102
+ /*
103
+ * Addresses `h1` font sizes within `section` and `article` in Firefox 4+,
104
+ * Safari 5, and Chrome.
105
+ */
106
+
107
+ h1 {
108
+ font-size: 2em;
109
+ }
110
+
111
+ /*
112
+ * Addresses styling not present in IE 8/9, Safari 5, and Chrome.
113
+ */
114
+
115
+ abbr[title] {
116
+ border-bottom: 1px dotted;
117
+ }
118
+
119
+ /*
120
+ * Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
121
+ */
122
+
123
+ b,
124
+ strong {
125
+ font-weight: bold;
126
+ }
127
+
128
+ /*
129
+ * Addresses styling not present in Safari 5 and Chrome.
130
+ */
131
+
132
+ dfn {
133
+ font-style: italic;
134
+ }
135
+
136
+ /*
137
+ * Addresses styling not present in IE 8/9.
138
+ */
139
+
140
+ mark {
141
+ background: #ff0;
142
+ color: #000;
143
+ }
144
+
145
+
146
+ /*
147
+ * Corrects font family set oddly in Safari 5 and Chrome.
148
+ */
149
+
150
+ code,
151
+ kbd,
152
+ pre,
153
+ samp {
154
+ font-family: monospace, serif;
155
+ font-size: 1em;
156
+ }
157
+
158
+ /*
159
+ * Improves readability of pre-formatted text in all browsers.
160
+ */
161
+
162
+ pre {
163
+ white-space: pre;
164
+ white-space: pre-wrap;
165
+ word-wrap: break-word;
166
+ }
167
+
168
+ /*
169
+ * Sets consistent quote types.
170
+ */
171
+
172
+ q {
173
+ quotes: "\201C" "\201D" "\2018" "\2019";
174
+ }
175
+
176
+ /*
177
+ * Addresses inconsistent and variable font size in all browsers.
178
+ */
179
+
180
+ small {
181
+ font-size: 80%;
182
+ }
183
+
184
+ /*
185
+ * Prevents `sub` and `sup` affecting `line-height` in all browsers.
186
+ */
187
+
188
+ sub,
189
+ sup {
190
+ font-size: 75%;
191
+ line-height: 0;
192
+ position: relative;
193
+ vertical-align: baseline;
194
+ }
195
+
196
+ sup {
197
+ top: -0.5em;
198
+ }
199
+
200
+ sub {
201
+ bottom: -0.25em;
202
+ }
203
+
204
+ /* ==========================================================================
205
+ Embedded content
206
+ ========================================================================== */
207
+
208
+ /*
209
+ * Removes border when inside `a` element in IE 8/9.
210
+ */
211
+
212
+ img {
213
+ border: 0;
214
+ }
215
+
216
+ /*
217
+ * Corrects overflow displayed oddly in IE 9.
218
+ */
219
+
220
+ svg:not(:root) {
221
+ overflow: hidden;
222
+ }
223
+
224
+ /* ==========================================================================
225
+ Figures
226
+ ========================================================================== */
227
+
228
+ /*
229
+ * Addresses margin not present in IE 8/9 and Safari 5.
230
+ */
231
+
232
+ figure {
233
+ margin: 0;
234
+ }
235
+
236
+ /* ==========================================================================
237
+ Forms
238
+ ========================================================================== */
239
+
240
+ /*
241
+ * Define consistent border, margin, and padding.
242
+ */
243
+
244
+ fieldset {
245
+ border: 1px solid #c0c0c0;
246
+ margin: 0 2px;
247
+ padding: 0.35em 0.625em 0.75em;
248
+ }
249
+
250
+ /*
251
+ * 1. Corrects color not being inherited in IE 8/9.
252
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
253
+ */
254
+
255
+ legend {
256
+ border: 0; /* 1 */
257
+ padding: 0; /* 2 */
258
+ }
259
+
260
+ /*
261
+ * 1. Corrects font family not being inherited in all browsers.
262
+ * 2. Corrects font size not being inherited in all browsers.
263
+ * 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome
264
+ */
265
+
266
+ button,
267
+ input,
268
+ select,
269
+ textarea {
270
+ font-family: inherit; /* 1 */
271
+ font-size: 100%; /* 2 */
272
+ margin: 0; /* 3 */
273
+ }
274
+
275
+ /*
276
+ * Addresses Firefox 4+ setting `line-height` on `input` using `!important` in
277
+ * the UA stylesheet.
278
+ */
279
+
280
+ button,
281
+ input {
282
+ line-height: normal;
283
+ }
284
+
285
+ /*
286
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
287
+ * and `video` controls.
288
+ * 2. Corrects inability to style clickable `input` types in iOS.
289
+ * 3. Improves usability and consistency of cursor style between image-type
290
+ * `input` and others.
291
+ */
292
+
293
+ button,
294
+ html input[type="button"], /* 1 */
295
+ input[type="reset"],
296
+ input[type="submit"] {
297
+ -webkit-appearance: button; /* 2 */
298
+ cursor: pointer; /* 3 */
299
+ }
300
+
301
+ /*
302
+ * Re-set default cursor for disabled elements.
303
+ */
304
+
305
+ button[disabled],
306
+ input[disabled] {
307
+ cursor: default;
308
+ }
309
+
310
+ /*
311
+ * 1. Addresses box sizing set to `content-box` in IE 8/9.
312
+ * 2. Removes excess padding in IE 8/9.
313
+ */
314
+
315
+ input[type="checkbox"],
316
+ input[type="radio"] {
317
+ box-sizing: border-box; /* 1 */
318
+ padding: 0; /* 2 */
319
+ }
320
+
321
+ /*
322
+ * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.
323
+ * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome
324
+ * (include `-moz` to future-proof).
325
+ */
326
+
327
+ input[type="search"] {
328
+ -webkit-appearance: textfield; /* 1 */
329
+ -moz-box-sizing: content-box;
330
+ -webkit-box-sizing: content-box; /* 2 */
331
+ box-sizing: content-box;
332
+ }
333
+
334
+ /*
335
+ * Removes inner padding and search cancel button in Safari 5 and Chrome
336
+ * on OS X.
337
+ */
338
+
339
+ input[type="search"]::-webkit-search-cancel-button,
340
+ input[type="search"]::-webkit-search-decoration {
341
+ -webkit-appearance: none;
342
+ }
343
+
344
+ /*
345
+ * Removes inner padding and border in Firefox 4+.
346
+ */
347
+
348
+ button::-moz-focus-inner,
349
+ input::-moz-focus-inner {
350
+ border: 0;
351
+ padding: 0;
352
+ }
353
+
354
+ /*
355
+ * 1. Removes default vertical scrollbar in IE 8/9.
356
+ * 2. Improves readability and alignment in all browsers.
357
+ */
358
+
359
+ textarea {
360
+ overflow: auto; /* 1 */
361
+ vertical-align: top; /* 2 */
362
+ }
363
+
364
+ /* ==========================================================================
365
+ Tables
366
+ ========================================================================== */
367
+
368
+ /*
369
+ * Remove most spacing between table cells.
370
+ */
371
+
372
+ table {
373
+ border-collapse: collapse;
374
+ border-spacing: 0;
375
+ }