simulacrum 0.1.1 → 0.3.0
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.
- checksums.yaml +4 -4
- data/.cane +9 -0
- data/.env.example +2 -0
- data/.gitignore +10 -0
- data/.rspec +3 -0
- data/.rubocop.yml +14 -0
- data/.travis.yml +28 -0
- data/Gemfile +2 -0
- data/README.md +78 -19
- data/Rakefile +20 -0
- data/examples/README.md +3 -0
- data/examples/basic/Gemfile +4 -0
- data/examples/basic/README.md +13 -0
- data/examples/basic/config.ru +3 -0
- data/examples/basic/example_app.rb +7 -0
- data/examples/basic/public/button.html +13 -0
- data/examples/basic/public/index.html +22 -0
- data/examples/basic/public/panel.html +13 -0
- data/examples/basic/public/stylesheets/button.css +15 -0
- data/examples/basic/public/stylesheets/main.css +3 -0
- data/examples/basic/public/stylesheets/normalize.css +425 -0
- data/examples/basic/script/start +4 -0
- data/examples/basic/spec/simulacrum_helper.rb +9 -0
- data/examples/basic/spec/ui/button_spec.rb +10 -0
- data/exe/simulacrum +5 -0
- data/features/command_line/help.feature +8 -0
- data/features/exit_codes/failing.feature +24 -0
- data/features/exit_codes/passing.feature +24 -0
- data/features/exit_codes/pending.feature +22 -0
- data/features/output/candidate.feature +32 -0
- data/features/output/diff.feature +5 -0
- data/features/step_definitions/dummy_steps.rb +15 -0
- data/features/step_definitions/file_steps.rb +19 -0
- data/features/support/env.rb +15 -0
- data/fixtures/a1.png +0 -0
- data/fixtures/app/fixture_app.rb +12 -0
- data/fixtures/app/public/images/a1.png +0 -0
- data/fixtures/app/public/ui_component.html +10 -0
- data/fixtures/app/spec/component_spec.rb +9 -0
- data/fixtures/app/spec/simulacrum_helper.rb +37 -0
- data/fixtures/app/spec/ui/references/ui_component/test_driver/candidate.png +0 -0
- data/fixtures/diff.png +0 -0
- data/lib/simulacrum.rb +74 -15
- data/lib/simulacrum/cli.rb +38 -0
- data/lib/simulacrum/cli/parser.rb +152 -0
- data/lib/simulacrum/comparator.rb +15 -15
- data/lib/simulacrum/component.rb +22 -11
- data/lib/simulacrum/configuration.rb +20 -13
- data/lib/simulacrum/diff.rb +2 -0
- data/lib/simulacrum/diff/rmagick.rb +8 -6
- data/lib/simulacrum/driver.rb +45 -0
- data/lib/simulacrum/matchers.rb +6 -16
- data/lib/simulacrum/methods.rb +1 -0
- data/lib/simulacrum/renderer.rb +23 -8
- data/lib/simulacrum/runner.rb +44 -0
- data/lib/simulacrum/version.rb +2 -1
- data/rubocop-todo.yml +29 -0
- data/script/bootstrap +3 -0
- data/script/quality +7 -0
- data/script/spec +10 -0
- data/simulacrum.gemspec +52 -0
- data/spec/lib/simulacrum/cli/parser_spec.rb +113 -0
- data/spec/lib/simulacrum/cli_spec.rb +18 -0
- data/spec/lib/simulacrum/comparator_spec.rb +75 -0
- data/spec/lib/simulacrum/component_spec.rb +208 -0
- data/spec/lib/simulacrum/driver/local_spec.rb +11 -0
- data/spec/lib/simulacrum/version_spec.rb +12 -0
- data/spec/lib/simulacrum_spec.rb +53 -0
- data/spec/spec_helper.rb +13 -8
- data/spec/use_codeclimate.rb +3 -0
- data/spec/use_simplecov.rb +5 -12
- metadata +217 -32
- data/lib/simulacrum/diff/pdiff.rb +0 -47
- data/spec/fixtures/a.png +0 -0
- data/spec/fixtures/a2.png +0 -0
- data/spec/use_coveralls.rb +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b5b48daea9a3ccb62a51dbfaa8ead40fa214479
|
4
|
+
data.tar.gz: 52f41223d9880503bf2e783d602d41c30c5bed49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
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
data/README.md
CHANGED
@@ -1,45 +1,104 @@
|
|
1
1
|
## Simulacrum
|
2
2
|
|
3
|
-
|
3
|
+
[][travis]
|
4
|
+
[][codeclimate]
|
5
|
+
[][codeclimate]
|
6
|
+
[][gemnasium]
|
7
|
+
[][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
|
-
###
|
8
|
-
`gem 'simulacrum'`
|
30
|
+
### UI Regression Testing
|
9
31
|
|
10
|
-
|
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
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
58
|
+
Then you can configure Simulacrum within Rspec:
|
19
59
|
|
20
60
|
```ruby
|
21
61
|
RSpec.configure do |config|
|
22
|
-
|
62
|
+
include Simulacrum
|
23
63
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
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
|
-
|
71
|
+
## Usage
|
33
72
|
|
34
|
-
|
73
|
+
```shell
|
74
|
+
simulacrum --help
|
75
|
+
```
|
35
76
|
|
36
|
-
|
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
|
-
|
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
|
data/examples/README.md
ADDED
@@ -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,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
|
+
}
|