simulacrum 0.1.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/.cane +9 -0
  3. data/.env.example +2 -0
  4. data/.gitignore +10 -0
  5. data/.rspec +3 -0
  6. data/.rubocop.yml +14 -0
  7. data/.travis.yml +28 -0
  8. data/Gemfile +2 -0
  9. data/README.md +78 -19
  10. data/Rakefile +20 -0
  11. data/examples/README.md +3 -0
  12. data/examples/basic/Gemfile +4 -0
  13. data/examples/basic/README.md +13 -0
  14. data/examples/basic/config.ru +3 -0
  15. data/examples/basic/example_app.rb +7 -0
  16. data/examples/basic/public/button.html +13 -0
  17. data/examples/basic/public/index.html +22 -0
  18. data/examples/basic/public/panel.html +13 -0
  19. data/examples/basic/public/stylesheets/button.css +15 -0
  20. data/examples/basic/public/stylesheets/main.css +3 -0
  21. data/examples/basic/public/stylesheets/normalize.css +425 -0
  22. data/examples/basic/script/start +4 -0
  23. data/examples/basic/spec/simulacrum_helper.rb +9 -0
  24. data/examples/basic/spec/ui/button_spec.rb +10 -0
  25. data/exe/simulacrum +5 -0
  26. data/features/command_line/help.feature +8 -0
  27. data/features/exit_codes/failing.feature +24 -0
  28. data/features/exit_codes/passing.feature +24 -0
  29. data/features/exit_codes/pending.feature +22 -0
  30. data/features/output/candidate.feature +32 -0
  31. data/features/output/diff.feature +5 -0
  32. data/features/step_definitions/dummy_steps.rb +15 -0
  33. data/features/step_definitions/file_steps.rb +19 -0
  34. data/features/support/env.rb +15 -0
  35. data/fixtures/a1.png +0 -0
  36. data/fixtures/app/fixture_app.rb +12 -0
  37. data/fixtures/app/public/images/a1.png +0 -0
  38. data/fixtures/app/public/ui_component.html +10 -0
  39. data/fixtures/app/spec/component_spec.rb +9 -0
  40. data/fixtures/app/spec/simulacrum_helper.rb +37 -0
  41. data/fixtures/app/spec/ui/references/ui_component/test_driver/candidate.png +0 -0
  42. data/fixtures/diff.png +0 -0
  43. data/lib/simulacrum.rb +74 -15
  44. data/lib/simulacrum/cli.rb +38 -0
  45. data/lib/simulacrum/cli/parser.rb +152 -0
  46. data/lib/simulacrum/comparator.rb +15 -15
  47. data/lib/simulacrum/component.rb +22 -11
  48. data/lib/simulacrum/configuration.rb +20 -13
  49. data/lib/simulacrum/diff.rb +2 -0
  50. data/lib/simulacrum/diff/rmagick.rb +8 -6
  51. data/lib/simulacrum/driver.rb +45 -0
  52. data/lib/simulacrum/matchers.rb +6 -16
  53. data/lib/simulacrum/methods.rb +1 -0
  54. data/lib/simulacrum/renderer.rb +23 -8
  55. data/lib/simulacrum/runner.rb +44 -0
  56. data/lib/simulacrum/version.rb +2 -1
  57. data/rubocop-todo.yml +29 -0
  58. data/script/bootstrap +3 -0
  59. data/script/quality +7 -0
  60. data/script/spec +10 -0
  61. data/simulacrum.gemspec +52 -0
  62. data/spec/lib/simulacrum/cli/parser_spec.rb +113 -0
  63. data/spec/lib/simulacrum/cli_spec.rb +18 -0
  64. data/spec/lib/simulacrum/comparator_spec.rb +75 -0
  65. data/spec/lib/simulacrum/component_spec.rb +208 -0
  66. data/spec/lib/simulacrum/driver/local_spec.rb +11 -0
  67. data/spec/lib/simulacrum/version_spec.rb +12 -0
  68. data/spec/lib/simulacrum_spec.rb +53 -0
  69. data/spec/spec_helper.rb +13 -8
  70. data/spec/use_codeclimate.rb +3 -0
  71. data/spec/use_simplecov.rb +5 -12
  72. metadata +217 -32
  73. data/lib/simulacrum/diff/pdiff.rb +0 -47
  74. data/spec/fixtures/a.png +0 -0
  75. data/spec/fixtures/a2.png +0 -0
  76. data/spec/use_coveralls.rb +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d1b6233672c83d949f344855c79433f80bcd2ba
4
- data.tar.gz: 072cbe46dfb9e299a6984e297f90c482b5cb078f
3
+ metadata.gz: 1b5b48daea9a3ccb62a51dbfaa8ead40fa214479
4
+ data.tar.gz: 52f41223d9880503bf2e783d602d41c30c5bed49
5
5
  SHA512:
6
- metadata.gz: 9e244c3e86ea41cf169d19d89fc2efd97b00dad9ddee1791137e7e265f92df59af52bceed9d2a4f0dcd2abed0fa91cc9e1a21e705910ccb7d83e5e574517c961
7
- data.tar.gz: 942d760733846fb7848c9b7bf638709ae341f719a3544b9c62bc18e8fdf955a9badf38a3f4d1bd5bd309337b0aec1e89758bceff4a9e8bf464be0940636e379a
6
+ metadata.gz: b1bbad472aac323605eec0c96cb07ec5357d2727e6ec9350eeacbf61e4aa9b7bfde72441f0a817d1cb627f8fa15fad0e1597f8354d27c00abc11e185726292da
7
+ data.tar.gz: 3ad97708041025834d64e6499a3bbb45b524e6883abd74e7a14758653c617c042dbba5600e9e520382fbdfc089a04db645f3d0efc8b8b493d340fb336a9fc3b3
data/.cane ADDED
@@ -0,0 +1,9 @@
1
+ --abc-max 10
2
+ --no-style
3
+ --color
4
+ --abc-exclude Simulacrum::Runner::Base#configure_rspec
5
+ --abc-exclude Simulacrum::Driver::BrowserstackDriver#capabilities
6
+ --abc-exclude Simulacrum::Runner::BrowserstackRunner#configure_environment
7
+ --abc-exclude Simulacrum::CLI::Parser#add_runner_options
8
+ --abc-exclude Simulacrum::Browserstack::Summary#dump_commands_to_rerun_failed_examples
9
+ --abc-exclude Simulacrum::Browserstack::Tunnel#ensure_open
data/.env.example ADDED
@@ -0,0 +1,2 @@
1
+ SAUCE_USERNAME=
2
+ SAUCE_ACCESS_KEY=
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ bin
2
+ /pkg
3
+ /tmp
4
+ /coverage
5
+ /examples/**/references/**/*
6
+ .bundle
7
+ *.sublime-workspace
8
+ *.sublime-project
9
+ Gemfile.lock
10
+ .env
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --profile
3
+ --format progress
data/.rubocop.yml ADDED
@@ -0,0 +1,14 @@
1
+ inherit_from: rubocop-todo.yml
2
+
3
+ AllCops:
4
+ Include:
5
+ - bin/simulacrum
6
+ Exclude:
7
+ - examples/*
8
+ - examples/**/*
9
+ - bin/*
10
+ - spec/use_simplecov.rb
11
+
12
+ TrivialAccessors:
13
+ Exclude:
14
+ - lib/simulacrum.rb
data/.travis.yml ADDED
@@ -0,0 +1,28 @@
1
+ language: ruby
2
+ rvm:
3
+ - ruby-head
4
+ - 2.1.1
5
+ - 2.0
6
+ bundler_args: "--binstubs --standalone --without documentation --path ../bundle"
7
+ cache: bundler
8
+ script:
9
+ - script/spec
10
+ addons:
11
+ sauce_connect: true
12
+ code_climate:
13
+ repo_token: e5d708da3fc981c10c3d7f95725436b02a0577d21e7ef84514e82057bf2559f0
14
+ matrix:
15
+ include:
16
+ - rvm: 2.1.1
17
+ env: COVERAGE=true
18
+ allow_failures:
19
+ - rvm: ruby-head
20
+ fast_finish: true
21
+ env:
22
+ global:
23
+ - AUTOMATE_PROJECT="$TRAVIS_REPO_SLUG"
24
+ - AUTOMATE_BUILD="Travis build No. $TRAVIS_BUILD_NUMBER for $TRAVIS_REPO_SLUG"
25
+ - secure: I3cJCwxNLnMsszfwZJNKLhEiseXi2aoz/2PmMa+6sJoPFfRYN6iVTBVtUEHipX3FnGx+rba8tRggcrDfVdvz4h8Pkq+znUfgXpbbta2yRw/zmQjvxxNxsKXAJJvgQ1vPArFukdEXURckIXMxZAHmmeU0NSV61MPD3zbJu36w5OA=
26
+ - secure: VlisKWdR03cbqSw530do5gnfkmttz1mctdOA4FwMp+KFurfPLFYoMpldxvHzricuB97OuiroBiopEas4Xey5XDjGr1Puklb47UIhqxx+XsBQ0xhd4ZfRZ1hvBCEI1dMSBrwwwq9QXt0gKp0f4ORGqOv6Fg7MrSExthQT9W8AfXs=
27
+ - secure: PcVAVdrUj1z7fztYklzExbkxCkwEgdKaaSt4eQNNuxdBvj8MwDAp7JvKasqAALBLJgcthj+jt+BU2l3LABPZyZPkl6A6FstoXvmK0fUAPr2k9InuiFX6UgybNKvhIQOyF++9bw0kCTZlkGn3KSw0vLZAx10/+XCb8mu7ghwylrI=
28
+ - secure: IO5ls6xcCpbgxEJFpKJhh5WT1FxwZOiwdhXs2OMElPCDAoMrQcooClvlSG6MWAY344F9p6jS3JFy0m8AZWw9IuJr5HeS36o5HS1Zf1+A/Awe8BDkyfHZTORZPU6VucFfLmZxgDXSFAmKxTaXUPhPQGXGbXuvT8KdkbqT43eA2HI=
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
data/README.md CHANGED
@@ -1,45 +1,104 @@
1
1
  ## Simulacrum
2
2
 
3
- An opinionated UI component regression testing tool built to be tightly integrated with RSpec, Selenium and tools you already use.
3
+ [![Build Status](http://img.shields.io/travis/plasticine/simulacrum.svg?style=flat)][travis]
4
+ [![Code Climate](http://img.shields.io/codeclimate/github/plasticine/simulacrum.svg?style=flat)][codeclimate]
5
+ [![Code Climate](http://img.shields.io/codeclimate/coverage/github/plasticine/simulacrum.svg?style=flat)][codeclimate]
6
+ [![Dependency Status](http://img.shields.io/gemnasium/plasticine/simulacrum.svg?style=flat)][gemnasium]
7
+ [![Gem Version](http://img.shields.io/gem/v/simulacrum.svg?style=flat)][gem_version]
8
+
9
+ **Simulacrum is a UI regression testing tool. It helps you write unit-like tests for
10
+ user-interface components in web applications.**
11
+
12
+ It is built around common tools such as [RSpec], [Capybara] & [Selenium Webdriver].
13
+
14
+ Support for 3rd party Selenium Webdriver services (such as [Browserstack], and [Saucelabs]) is provided via additional collaborating gems;
15
+
16
+ | | | Status |
17
+ | ---------------- |:------------------------------------------------------------------------------------------- |:------:|
18
+ | **Browserstack** | [plasticine/simulacrum-browserstack](https://github.com/plasticine/simulacrum-browserstack) | WIP 🚧 |
19
+ | **Saucelabs** | [plasticine/simulacrum-saucelabs](https://github.com/plasticine/simulacrum-saucelabs) | WIP 🚧 |
20
+
21
+ #### Does this sound like something you might be interested in?
22
+
23
+ - Test your UI components visually
24
+ - Know when a component is visually altered
25
+ - Integrate with
26
+ - Test component behaviour (JS) that manipulates visual appearance
4
27
 
5
28
  ***
6
29
 
7
- ### Installing
8
- `gem 'simulacrum'`
30
+ ### UI Regression Testing
9
31
 
10
- ### Configuring
32
+ Explain the use-case better.
33
+
34
+ ### Opinions
35
+
36
+ Simulacrum is a little bit opinionated about a few things;
37
+
38
+ - selenium webdriver (browserstack)
39
+ - testing components
40
+
41
+ It would be good to explain these opinions, the reason for them and why they are good.
42
+
43
+ ## Setup
44
+ Simulacrum requires Ruby 1.9.3 or later. To install, add this line to your Gemfile and run `bundle install`:
45
+
46
+ Create a spec helper file for simulacrum — `simulacrum_helper.rb` — and throw this junk in it:
11
47
 
12
48
  ```ruby
13
- RSpec.configure do |config|
14
- include Simulacrum
15
- end
49
+ gem 'simulacrum'
50
+ ```
51
+
52
+ The next step is to create a `simulacrum_helper.rb` helper file, and then require Simulacrum there:
53
+
54
+ ```ruby
55
+ require 'simulacrum'
16
56
  ```
17
57
 
18
- Simulacrum can also be configured once included;
58
+ Then you can configure Simulacrum within Rspec:
19
59
 
20
60
  ```ruby
21
61
  RSpec.configure do |config|
22
- include Simulacrum
62
+ include Simulacrum
23
63
 
24
- Simulacrum.configure do |simulacrum|
25
- simulacrum.images_path = 'somewhere/example/spec/ui_specs'
26
- simulacrum.acceptable_delta = 0.1 # allow a maximum of 0.1% difference
27
- config.defaults.capture_selector = '.kayessess__examples'
28
- end
64
+ Simulacrum.configure do |config|
65
+ config.defaults.acceptable_delta = 1 # up to 1% percentage change allowed
66
+ config.defaults.capture_selector = '.components__examples' # CSS selector to crop reference image to
67
+ end
29
68
  end
30
69
  ```
31
70
 
32
- ### Opinions
71
+ ## Usage
33
72
 
34
- ### Usage
73
+ ```shell
74
+ simulacrum --help
75
+ ```
35
76
 
36
- Simulacrum provides a small DSL for configuring and managing UI tests from within Rspec. Basically it boils down to these three methods;
77
+
78
+
79
+
80
+ <!-- Simulacrum provides a small DSL for configuring and managing UI tests from within Rspec. Basically it boils down to these three methods;
37
81
 
38
82
  - `component`
39
83
  - `configure_browser`
40
- - `look_the_same`
84
+ - `look_the_same` -->
41
85
 
42
- #### Inspiration
86
+ ***
87
+
88
+ #### Inspiration / Similar tools
43
89
 
44
90
  - Huxley
45
91
  - Green Onion
92
+
93
+
94
+ [huxley]: https://github.com/facebook/huxley
95
+ [green_onion]: http://intridea.github.io/green_onion
96
+ [Browserstack]: http://www.browserstack.com
97
+ [Saucelabs]: https://saucelabs.com
98
+ [RSpec]: http://rspec.info
99
+ [Capybara]: https://github.com/jnicklas/capybara
100
+ [Selenium Webdriver]: http://docs.seleniumhq.org/projects/webdriver/
101
+ [codeclimate]: https://codeclimate.com/github/plasticine/simulacrum
102
+ [travis]: https://travis-ci.org/plasticine/simulacrum
103
+ [gemnasium]: https://gemnasium.com/plasticine/simulacrum
104
+ [gem_version]: http://badge.fury.io/rb/simulacrum
data/Rakefile ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env rake
2
+ require 'rspec/core/rake_task'
3
+ require 'cane/rake_task'
4
+ require 'rdoc/task'
5
+ require 'bundler'
6
+ Bundler::GemHelper.install_tasks
7
+
8
+ desc 'Generate documentation for the Simulacrum plugin.'
9
+ Rake::RDocTask.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Simulacrum'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ desc 'Run cane to check quality metrics'
18
+ Cane::RakeTask.new(:quality) do |cane|
19
+ cane.canefile = '.cane'
20
+ end
@@ -0,0 +1,3 @@
1
+ # Simulacrum Usage Examples
2
+
3
+ - Basic usage
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'sinatra'
4
+ gem 'simulacrum', path: '../../'
@@ -0,0 +1,13 @@
1
+ # Simulacrum Example App
2
+
3
+ Serve some files;
4
+
5
+ ```
6
+ ./script/start
7
+ ```
8
+
9
+ Then in a new terminal window:
10
+
11
+ ```
12
+ simulacrum
13
+ ```
@@ -0,0 +1,3 @@
1
+ require './example_app'
2
+
3
+ run ExampleApp.new
@@ -0,0 +1,7 @@
1
+ require 'sinatra/base'
2
+
3
+ class ExampleApp < Sinatra::Application
4
+ set :public_folder, File.dirname(__FILE__) + '/public'
5
+
6
+ run! if app_file == $PROGRAM_NAME
7
+ end
@@ -0,0 +1,13 @@
1
+ <html>
2
+ <head>
3
+ <meta charset="UTF-8">
4
+ <title>Simulacrum Example — Button</title>
5
+ <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no,user-scalable=0">
6
+ <link rel="stylesheet" href="/stylesheets/normalize.css">
7
+ <link rel="stylesheet" href="/stylesheets/main.css">
8
+ <link rel="stylesheet" href="/stylesheets/button.css">
9
+ </head>
10
+ <body>
11
+ <a href="#" class="button">This is my super sweet example button!</a>
12
+ </body>
13
+ </html>
@@ -0,0 +1,22 @@
1
+ <html>
2
+ <head>
3
+ <meta charset="UTF-8">
4
+ <title>Simulacrum Example — Index</title>
5
+ <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no,user-scalable=0">
6
+ <link rel="stylesheet" href="/stylesheets/normalize.css">
7
+ <link rel="stylesheet" href="/stylesheets/main.css">
8
+ </head>
9
+ <body>
10
+ <h4>Example Components</h4>
11
+ <nav>
12
+ <ul>
13
+ <li>
14
+ <a href="/button.html">Button</a>
15
+ </li>
16
+ <li>
17
+ <a href="/panel.html">Panel</a>
18
+ </li>
19
+ </ul>
20
+ </nav>
21
+ </body>
22
+ </html>
@@ -0,0 +1,13 @@
1
+ <html>
2
+ <head>
3
+ <meta charset="UTF-8">
4
+ <title>Simulacrum Example — Panel</title>
5
+ <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no,user-scalable=0">
6
+ <link rel="stylesheet" href="/stylesheets/normalize.css">
7
+ <link rel="stylesheet" href="/stylesheets/main.css">
8
+ <link rel="stylesheet" href="/stylesheets/panel.css">
9
+ </head>
10
+ <body>
11
+ TODO
12
+ </body>
13
+ </html>
@@ -0,0 +1,15 @@
1
+ .button {
2
+ border-radius: 5px;
3
+ border: 3px solid currentColor;
4
+ color: #4A90E2;
5
+ display: inline-block;
6
+ font-weight: 600;
7
+ padding: 1em 2em;
8
+ text-decoration: none;
9
+ }
10
+
11
+ .button:hover {
12
+ background-color: #4A90E2;
13
+ color: #fff;
14
+ border-color: #4A90E2;
15
+ }
@@ -0,0 +1,3 @@
1
+ html {
2
+ padding: 3em;
3
+ }
@@ -0,0 +1,425 @@
1
+ /*! normalize.css v3.0.1 | MIT License | git.io/normalize */
2
+
3
+ /**
4
+ * 1. Set default font family to sans-serif.
5
+ * 2. Prevent iOS text size adjust after orientation change, without disabling
6
+ * user zoom.
7
+ */
8
+
9
+ html {
10
+ font-family: sans-serif; /* 1 */
11
+ -ms-text-size-adjust: 100%; /* 2 */
12
+ -webkit-text-size-adjust: 100%; /* 2 */
13
+ }
14
+
15
+ /**
16
+ * Remove default margin.
17
+ */
18
+
19
+ body {
20
+ margin: 0;
21
+ }
22
+
23
+ /* HTML5 display definitions
24
+ ========================================================================== */
25
+
26
+ /**
27
+ * Correct `block` display not defined for any HTML5 element in IE 8/9.
28
+ * Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox.
29
+ * Correct `block` display not defined for `main` in IE 11.
30
+ */
31
+
32
+ article,
33
+ aside,
34
+ details,
35
+ figcaption,
36
+ figure,
37
+ footer,
38
+ header,
39
+ hgroup,
40
+ main,
41
+ nav,
42
+ section,
43
+ summary {
44
+ display: block;
45
+ }
46
+
47
+ /**
48
+ * 1. Correct `inline-block` display not defined in IE 8/9.
49
+ * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
50
+ */
51
+
52
+ audio,
53
+ canvas,
54
+ progress,
55
+ video {
56
+ display: inline-block; /* 1 */
57
+ vertical-align: baseline; /* 2 */
58
+ }
59
+
60
+ /**
61
+ * Prevent modern browsers from displaying `audio` without controls.
62
+ * Remove excess height in iOS 5 devices.
63
+ */
64
+
65
+ audio:not([controls]) {
66
+ display: none;
67
+ height: 0;
68
+ }
69
+
70
+ /**
71
+ * Address `[hidden]` styling not present in IE 8/9/10.
72
+ * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
73
+ */
74
+
75
+ [hidden],
76
+ template {
77
+ display: none;
78
+ }
79
+
80
+ /* Links
81
+ ========================================================================== */
82
+
83
+ /**
84
+ * Remove the gray background color from active links in IE 10.
85
+ */
86
+
87
+ a {
88
+ background: transparent;
89
+ }
90
+
91
+ /**
92
+ * Improve readability when focused and also mouse hovered in all browsers.
93
+ */
94
+
95
+ a:active,
96
+ a:hover {
97
+ outline: 0;
98
+ }
99
+
100
+ /* Text-level semantics
101
+ ========================================================================== */
102
+
103
+ /**
104
+ * Address styling not present in IE 8/9/10/11, Safari, and Chrome.
105
+ */
106
+
107
+ abbr[title] {
108
+ border-bottom: 1px dotted;
109
+ }
110
+
111
+ /**
112
+ * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
113
+ */
114
+
115
+ b,
116
+ strong {
117
+ font-weight: bold;
118
+ }
119
+
120
+ /**
121
+ * Address styling not present in Safari and Chrome.
122
+ */
123
+
124
+ dfn {
125
+ font-style: italic;
126
+ }
127
+
128
+ /**
129
+ * Address variable `h1` font-size and margin within `section` and `article`
130
+ * contexts in Firefox 4+, Safari, and Chrome.
131
+ */
132
+
133
+ h1 {
134
+ font-size: 2em;
135
+ margin: 0.67em 0;
136
+ }
137
+
138
+ /**
139
+ * Address styling not present in IE 8/9.
140
+ */
141
+
142
+ mark {
143
+ background: #ff0;
144
+ color: #000;
145
+ }
146
+
147
+ /**
148
+ * Address inconsistent and variable font size in all browsers.
149
+ */
150
+
151
+ small {
152
+ font-size: 80%;
153
+ }
154
+
155
+ /**
156
+ * Prevent `sub` and `sup` affecting `line-height` in all browsers.
157
+ */
158
+
159
+ sub,
160
+ sup {
161
+ font-size: 75%;
162
+ line-height: 0;
163
+ position: relative;
164
+ vertical-align: baseline;
165
+ }
166
+
167
+ sup {
168
+ top: -0.5em;
169
+ }
170
+
171
+ sub {
172
+ bottom: -0.25em;
173
+ }
174
+
175
+ /* Embedded content
176
+ ========================================================================== */
177
+
178
+ /**
179
+ * Remove border when inside `a` element in IE 8/9/10.
180
+ */
181
+
182
+ img {
183
+ border: 0;
184
+ }
185
+
186
+ /**
187
+ * Correct overflow not hidden in IE 9/10/11.
188
+ */
189
+
190
+ svg:not(:root) {
191
+ overflow: hidden;
192
+ }
193
+
194
+ /* Grouping content
195
+ ========================================================================== */
196
+
197
+ /**
198
+ * Address margin not present in IE 8/9 and Safari.
199
+ */
200
+
201
+ figure {
202
+ margin: 1em 40px;
203
+ }
204
+
205
+ /**
206
+ * Address differences between Firefox and other browsers.
207
+ */
208
+
209
+ hr {
210
+ -moz-box-sizing: content-box;
211
+ box-sizing: content-box;
212
+ height: 0;
213
+ }
214
+
215
+ /**
216
+ * Contain overflow in all browsers.
217
+ */
218
+
219
+ pre {
220
+ overflow: auto;
221
+ }
222
+
223
+ /**
224
+ * Address odd `em`-unit font size rendering in all browsers.
225
+ */
226
+
227
+ code,
228
+ kbd,
229
+ pre,
230
+ samp {
231
+ font-family: monospace, monospace;
232
+ font-size: 1em;
233
+ }
234
+
235
+ /* Forms
236
+ ========================================================================== */
237
+
238
+ /**
239
+ * Known limitation: by default, Chrome and Safari on OS X allow very limited
240
+ * styling of `select`, unless a `border` property is set.
241
+ */
242
+
243
+ /**
244
+ * 1. Correct color not being inherited.
245
+ * Known issue: affects color of disabled elements.
246
+ * 2. Correct font properties not being inherited.
247
+ * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
248
+ */
249
+
250
+ button,
251
+ input,
252
+ optgroup,
253
+ select,
254
+ textarea {
255
+ color: inherit; /* 1 */
256
+ font: inherit; /* 2 */
257
+ margin: 0; /* 3 */
258
+ }
259
+
260
+ /**
261
+ * Address `overflow` set to `hidden` in IE 8/9/10/11.
262
+ */
263
+
264
+ button {
265
+ overflow: visible;
266
+ }
267
+
268
+ /**
269
+ * Address inconsistent `text-transform` inheritance for `button` and `select`.
270
+ * All other form control elements do not inherit `text-transform` values.
271
+ * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
272
+ * Correct `select` style inheritance in Firefox.
273
+ */
274
+
275
+ button,
276
+ select {
277
+ text-transform: none;
278
+ }
279
+
280
+ /**
281
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
282
+ * and `video` controls.
283
+ * 2. Correct inability to style clickable `input` types in iOS.
284
+ * 3. Improve usability and consistency of cursor style between image-type
285
+ * `input` and others.
286
+ */
287
+
288
+ button,
289
+ html input[type="button"], /* 1 */
290
+ input[type="reset"],
291
+ input[type="submit"] {
292
+ -webkit-appearance: button; /* 2 */
293
+ cursor: pointer; /* 3 */
294
+ }
295
+
296
+ /**
297
+ * Re-set default cursor for disabled elements.
298
+ */
299
+
300
+ button[disabled],
301
+ html input[disabled] {
302
+ cursor: default;
303
+ }
304
+
305
+ /**
306
+ * Remove inner padding and border in Firefox 4+.
307
+ */
308
+
309
+ button::-moz-focus-inner,
310
+ input::-moz-focus-inner {
311
+ border: 0;
312
+ padding: 0;
313
+ }
314
+
315
+ /**
316
+ * Address Firefox 4+ setting `line-height` on `input` using `!important` in
317
+ * the UA stylesheet.
318
+ */
319
+
320
+ input {
321
+ line-height: normal;
322
+ }
323
+
324
+ /**
325
+ * It's recommended that you don't attempt to style these elements.
326
+ * Firefox's implementation doesn't respect box-sizing, padding, or width.
327
+ *
328
+ * 1. Address box sizing set to `content-box` in IE 8/9/10.
329
+ * 2. Remove excess padding in IE 8/9/10.
330
+ */
331
+
332
+ input[type="checkbox"],
333
+ input[type="radio"] {
334
+ box-sizing: border-box; /* 1 */
335
+ padding: 0; /* 2 */
336
+ }
337
+
338
+ /**
339
+ * Fix the cursor style for Chrome's increment/decrement buttons. For certain
340
+ * `font-size` values of the `input`, it causes the cursor style of the
341
+ * decrement button to change from `default` to `text`.
342
+ */
343
+
344
+ input[type="number"]::-webkit-inner-spin-button,
345
+ input[type="number"]::-webkit-outer-spin-button {
346
+ height: auto;
347
+ }
348
+
349
+ /**
350
+ * 1. Address `appearance` set to `searchfield` in Safari and Chrome.
351
+ * 2. Address `box-sizing` set to `border-box` in Safari and Chrome
352
+ * (include `-moz` to future-proof).
353
+ */
354
+
355
+ input[type="search"] {
356
+ -webkit-appearance: textfield; /* 1 */
357
+ -moz-box-sizing: content-box;
358
+ -webkit-box-sizing: content-box; /* 2 */
359
+ box-sizing: content-box;
360
+ }
361
+
362
+ /**
363
+ * Remove inner padding and search cancel button in Safari and Chrome on OS X.
364
+ * Safari (but not Chrome) clips the cancel button when the search input has
365
+ * padding (and `textfield` appearance).
366
+ */
367
+
368
+ input[type="search"]::-webkit-search-cancel-button,
369
+ input[type="search"]::-webkit-search-decoration {
370
+ -webkit-appearance: none;
371
+ }
372
+
373
+ /**
374
+ * Define consistent border, margin, and padding.
375
+ */
376
+
377
+ fieldset {
378
+ border: 1px solid #c0c0c0;
379
+ margin: 0 2px;
380
+ padding: 0.35em 0.625em 0.75em;
381
+ }
382
+
383
+ /**
384
+ * 1. Correct `color` not being inherited in IE 8/9/10/11.
385
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
386
+ */
387
+
388
+ legend {
389
+ border: 0; /* 1 */
390
+ padding: 0; /* 2 */
391
+ }
392
+
393
+ /**
394
+ * Remove default vertical scrollbar in IE 8/9/10/11.
395
+ */
396
+
397
+ textarea {
398
+ overflow: auto;
399
+ }
400
+
401
+ /**
402
+ * Don't inherit the `font-weight` (applied by a rule above).
403
+ * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
404
+ */
405
+
406
+ optgroup {
407
+ font-weight: bold;
408
+ }
409
+
410
+ /* Tables
411
+ ========================================================================== */
412
+
413
+ /**
414
+ * Remove most spacing between table cells.
415
+ */
416
+
417
+ table {
418
+ border-collapse: collapse;
419
+ border-spacing: 0;
420
+ }
421
+
422
+ td,
423
+ th {
424
+ padding: 0;
425
+ }