maily 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4eec9f6ff7965b84fade274481f733f6f943e24c
4
- data.tar.gz: f94b2820645289fb453cdd84924bff70a1db1eed
3
+ metadata.gz: 9b143eb37ea922863a831b9cd11c6dea69114477
4
+ data.tar.gz: 9ad22c49d8c49ce3d064c5f29e01f56fa3aa4f7d
5
5
  SHA512:
6
- metadata.gz: 4271c5cd492c9c6c030f89a0014d3e4257b5d4b5821098863a34e0cb38f619aff346a55831c9e8eb73fb6e2970b9fe889d517fed0d2128324450a035e3824606
7
- data.tar.gz: 25625b8e6558ae187158fe431572aad65b6ac11b5fcafc237f95280770a19bbd321ed3029e1f72f6ca36852932af36cb4504995c2965645824561d44128f39d3
6
+ metadata.gz: 940fbdebbb81ebba521d6a6cfbd09a1dc40970711447f94f50245dabcb0e1bfe9fdca319b0ad304bfe17d6d820695847da4d52b71813f0081b02d1b463bfb6bc
7
+ data.tar.gz: 9d0307a2ef4e1c8728927b755837701fb02d657220fbbe702e9ca83e7d2ebd4438d200b85800228ef95106b65e5ff15a0914723b04b1c3ee6454d1641c37fc99
data/.travis.yml CHANGED
@@ -5,22 +5,19 @@ cache: bundler
5
5
  sudo: false
6
6
 
7
7
  rvm:
8
- - 2.4.0
9
- - 2.3.3
10
- - 2.2.6
8
+ - 2.4.1
9
+ - 2.3.4
10
+ - 2.2.7
11
11
  - 2.1
12
12
 
13
13
  gemfile:
14
+ - gemfiles/rails_5.1.gemfile
14
15
  - gemfiles/rails_5.0.gemfile
15
16
  - gemfiles/rails_4.2.gemfile
16
- - gemfiles/rails_4.1.gemfile
17
- - gemfiles/rails_3.2.gemfile
18
17
 
19
18
  matrix:
20
19
  exclude:
21
20
  - rvm: 2.1
22
21
  gemfile: gemfiles/rails_5.0.gemfile
23
- - rvm: 2.4.0
24
- gemfile: gemfiles/rails_4.1.gemfile
25
- - rvm: 2.4.0
26
- gemfile: gemfiles/rails_3.2.gemfile
22
+ - rvm: 2.1
23
+ gemfile: gemfiles/rails_5.1.gemfile
data/Appraisals CHANGED
@@ -1,15 +1,11 @@
1
+ appraise "rails-5.1" do
2
+ gem "rails", "~> 5.1.0"
3
+ end
4
+
1
5
  appraise "rails-5.0" do
2
6
  gem "rails", "~> 5.0.0"
3
7
  end
4
8
 
5
9
  appraise "rails-4.2" do
6
10
  gem "rails", github: 'rails/rails', branch: '4-2-stable'
7
- end
8
-
9
- appraise "rails-4.1" do
10
- gem "rails", "~> 4.1.0"
11
- end
12
-
13
- appraise "rails-3.2" do
14
- gem "rails", "~> 3.2.0"
15
11
  end
data/README.md CHANGED
@@ -2,20 +2,18 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/maily.svg)](http://badge.fury.io/rb/maily) [![Build Status](https://travis-ci.org/markets/maily.svg?branch=master)](https://travis-ci.org/markets/maily)
4
4
 
5
- Stop to delivery emails every time you change it!
6
-
7
- Maily is a Rails Engine to preview, follow up, test and edit the emails of your applications in the browser.
5
+ Maily is a Rails Engine to manage, test and navigate through all your email templates of your app, being able to preview them directly in your browser.
8
6
 
9
7
  ## Features:
10
8
 
11
9
  * Mountable engine
12
10
  * Visual preview in the browser (attachments as well)
13
- * Template edition
11
+ * Template edition (only in development)
14
12
  * Email delivery
15
13
  * Features configurables per environment
16
14
  * Flexible authorization
17
- * Minimalistic interface (thanks to [@gnatok](https://github.com/gnatok))
18
- * Easy way (named hooks) to define data for emails
15
+ * Minimalistic and clean interface
16
+ * Easy way (aka `hooks`) to define data for emails
19
17
  * Generator to handle a comfortable installation
20
18
 
21
19
  ![](screenshot.png)
@@ -70,30 +68,37 @@ Maily.setup do |config|
70
68
  # Run maily under different controller ('ActionController::Base' by default)
71
69
  # config.base_controller = '::AdminController'
72
70
 
71
+ # Configure hooks path
72
+ # config.hooks_path = 'lib/maily_hooks.rb'
73
+
73
74
  # Http basic authentication (nil by default)
74
75
  # config.http_authorization = { username: 'admin', password: 'secret' }
76
+
77
+ # Customize welcome message
78
+ # config.welcome_message = "Welcome to our email testing platform. If you have any problem, please contact support team at support@example.com."
75
79
  end
76
80
  ```
77
81
 
78
82
  ### Templates edition (`allow_edition` option)
79
83
 
80
- This feature was designed for `development` environment. Since it's just a file edition and running `production` mode, code is not reloaded between requests, Rails doesn't take in account this change (without restarting the server). Also, allow arbitrary ruby code evaluation is potentially dangerous, that's not a good idea for `production`.
84
+ This feature was designed for `development` environment. Since it's just a file edition and running in `production`, code is not reloaded between requests, Rails doesn't take in account this change (without restarting the server). Also, allow arbitrary ruby code evaluation is potentially dangerous, that's not a good idea for `production`.
81
85
 
82
- So, templates edition is not allowed running `production` mode.
86
+ So, template edition is not allowed outside of `development` environment.
83
87
 
84
88
  ## Hooks
85
89
 
86
- Most of emails need to populate data to consume it and do interesting things. Hooks are used to define this data with a little DSL. Example:
90
+ Most of emails need to populate some data to consume it and do interesting things. Hooks are used to define this data with a little DSL. Hooks accept "callable" objects to lazy load (most expensive) data. Example:
87
91
 
88
92
  ```ruby
89
93
  # lib/maily_hooks.rb
90
94
  user = User.new(email: 'user@example.com')
95
+ lazy_user = -> { User.with_comments.first } # callable object, lazy evaluation
91
96
  comment = Struct.new(:body).new('Lorem ipsum') # stub way
92
97
  service = FactoryGirl.create(:service) # using fixtures with FactoryGirl
93
98
 
94
99
  Maily.hooks_for('Notifier') do |mailer|
95
100
  mailer.register_hook(:welcome, user, template_path: 'users')
96
- mailer.register_hook(:new_comment, user, comment)
101
+ mailer.register_hook(:new_comment, lazy_user, comment)
97
102
  end
98
103
 
99
104
  Maily.hooks_for('PaymentNotifier') do |mailer|
@@ -109,6 +114,16 @@ Maily.hooks_for('YourMailerClass') do |mailer|
109
114
  end
110
115
  ```
111
116
 
117
+ ### Email description
118
+
119
+ You can add a description to any email and it will be displayed along with its preview. This is useful in some cases like: someone from another team, for example, a marketing specialist, visiting Maily to review some texts and images; they can easily understand when this email is sent by the system.
120
+
121
+ ```ruby
122
+ Maily.hooks_for('BookingNotifier') do |mailer|
123
+ mailer.register_hook(:accepted, description: "This email is sent when a reservation has been accepted by the system." )
124
+ end
125
+ ```
126
+
112
127
  ## Authorization
113
128
 
114
129
  Basically, you have 2 ways to restrict the access to `Maily`.
@@ -130,7 +145,7 @@ class AdminController < ActionController::Base
130
145
  private
131
146
 
132
147
  def maily_authorized?
133
- (current_user && current_user.admin?) || raise("You don't have access to this section!")
148
+ current_user.admin? || raise("You don't have access to this section!")
134
149
  end
135
150
  end
136
151
  ```
@@ -1,5 +1,3 @@
1
- //= require_tree .
2
-
3
1
  function resizeIframe(obj) {
4
2
  obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
5
3
  }
@@ -1,14 +1,11 @@
1
- /*
2
- *= require maily/normalize
3
- *= require maily/icons
4
- */
1
+ @import "maily/normalize";
2
+ @import "maily/icons";
5
3
 
6
- /* Default */
7
4
  @font-face {
8
5
  font-weight: light;
9
6
  font-style: normal;
10
7
  font-family: 'Josefin Sans';
11
- src: url('fonts/JosefinSans-Light.ttf') format('truetype');
8
+ src: asset-url('maily/fonts/JosefinSans-Light.ttf') format('truetype');
12
9
  }
13
10
 
14
11
  ::-webkit-input-placeholder {
@@ -78,11 +75,11 @@ footer.footer {
78
75
  bottom: 0;
79
76
  box-shadow: 0 -.0625em .3125em rgba(0,0,0, .15);
80
77
  font-family: "Helvetica Neue", Helvetica, sans-serif;
78
+ font-size: .9em;
81
79
 
82
80
  a {
83
81
  color: $linkColor;
84
82
  text-decoration: none;
85
- font-size: .9em;
86
83
  }
87
84
  }
88
85
 
@@ -309,3 +306,12 @@ aside.sidebar {
309
306
  }
310
307
  }
311
308
  }
309
+
310
+ /* ALERT */
311
+ .alert {
312
+ color: #a94442;
313
+ background-color: #f2dede;
314
+ padding: 15px;
315
+ margin-bottom: 20px;
316
+ display: flex;
317
+ }
@@ -1,10 +1,10 @@
1
1
  @font-face {
2
2
  font-family: 'maily';
3
- src:url('icons/maily.eot');
4
- src:url('icons/maily.eot?#iefix') format('embedded-opentype'),
5
- url('icons/maily.woff') format('woff'),
6
- url('icons/maily.ttf') format('truetype'),
7
- url('icons/maily.svg#maily') format('svg');
3
+ src:asset-url('maily/icons/maily.eot');
4
+ src:asset-url('maily/icons/maily.eot?#iefix') format('embedded-opentype'),
5
+ asset-url('maily/icons/maily.woff') format('woff'),
6
+ asset-url('maily/icons/maily.ttf') format('truetype'),
7
+ asset-url('maily/icons/maily.svg#maily') format('svg');
8
8
  font-weight: normal;
9
9
  font-style: normal;
10
10
  }
@@ -1,406 +1,447 @@
1
- /*! normalize.css v2.1.3 | MIT License | git.io/normalize */
1
+ /*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
2
2
 
3
- /* ==========================================================================
4
- HTML5 display definitions
3
+ /* Document
5
4
  ========================================================================== */
6
5
 
7
6
  /**
8
- * Correct `block` display not defined in IE 8/9.
7
+ * 1. Correct the line height in all browsers.
8
+ * 2. Prevent adjustments of font size after orientation changes in
9
+ * IE on Windows Phone and in iOS.
9
10
  */
10
11
 
11
- article,
12
- aside,
13
- details,
14
- figcaption,
15
- figure,
16
- footer,
17
- header,
18
- hgroup,
19
- main,
20
- nav,
21
- section,
22
- summary {
23
- display: block;
12
+ html {
13
+ line-height: 1.15; /* 1 */
14
+ -ms-text-size-adjust: 100%; /* 2 */
15
+ -webkit-text-size-adjust: 100%; /* 2 */
24
16
  }
25
17
 
18
+ /* Sections
19
+ ========================================================================== */
20
+
26
21
  /**
27
- * Correct `inline-block` display not defined in IE 8/9.
22
+ * Remove the margin in all browsers (opinionated).
28
23
  */
29
24
 
30
- audio,
31
- canvas,
32
- video {
33
- display: inline-block;
25
+ body {
26
+ margin: 0;
34
27
  }
35
28
 
36
29
  /**
37
- * Prevent modern browsers from displaying `audio` without controls.
38
- * Remove excess height in iOS 5 devices.
30
+ * Add the correct display in IE 9-.
39
31
  */
40
32
 
41
- audio:not([controls]) {
42
- display: none;
43
- height: 0;
33
+ article,
34
+ aside,
35
+ footer,
36
+ header,
37
+ nav,
38
+ section {
39
+ display: block;
44
40
  }
45
41
 
46
42
  /**
47
- * Address `[hidden]` styling not present in IE 8/9.
48
- * Hide the `template` element in IE, Safari, and Firefox < 22.
43
+ * Correct the font size and margin on `h1` elements within `section` and
44
+ * `article` contexts in Chrome, Firefox, and Safari.
49
45
  */
50
46
 
51
- [hidden],
52
- template {
53
- display: none;
47
+ h1 {
48
+ font-size: 2em;
49
+ margin: 0.67em 0;
54
50
  }
55
51
 
56
- /* ==========================================================================
57
- Base
52
+ /* Grouping content
58
53
  ========================================================================== */
59
54
 
60
55
  /**
61
- * 1. Set default font family to sans-serif.
62
- * 2. Prevent iOS text size adjust after orientation change, without disabling
63
- * user zoom.
56
+ * Add the correct display in IE 9-.
57
+ * 1. Add the correct display in IE.
64
58
  */
65
59
 
66
- html {
67
- font-family: sans-serif; /* 1 */
68
- -ms-text-size-adjust: 100%; /* 2 */
69
- -webkit-text-size-adjust: 100%; /* 2 */
60
+ figcaption,
61
+ figure,
62
+ main { /* 1 */
63
+ display: block;
70
64
  }
71
65
 
72
66
  /**
73
- * Remove default margin.
67
+ * Add the correct margin in IE 8.
74
68
  */
75
69
 
76
- body {
77
- margin: 0;
70
+ figure {
71
+ margin: 1em 40px;
78
72
  }
79
73
 
80
- /* ==========================================================================
81
- Links
82
- ========================================================================== */
83
-
84
74
  /**
85
- * Remove the gray background color from active links in IE 10.
75
+ * 1. Add the correct box sizing in Firefox.
76
+ * 2. Show the overflow in Edge and IE.
86
77
  */
87
78
 
88
- a {
89
- background: transparent;
79
+ hr {
80
+ box-sizing: content-box; /* 1 */
81
+ height: 0; /* 1 */
82
+ overflow: visible; /* 2 */
90
83
  }
91
84
 
92
85
  /**
93
- * Address `outline` inconsistency between Chrome and other browsers.
86
+ * 1. Correct the inheritance and scaling of font size in all browsers.
87
+ * 2. Correct the odd `em` font sizing in all browsers.
94
88
  */
95
89
 
96
- a:focus {
97
- outline: thin dotted;
90
+ pre {
91
+ font-family: monospace, monospace; /* 1 */
92
+ font-size: 1em; /* 2 */
98
93
  }
99
94
 
95
+ /* Text-level semantics
96
+ ========================================================================== */
97
+
100
98
  /**
101
- * Improve readability when focused and also mouse hovered in all browsers.
99
+ * 1. Remove the gray background on active links in IE 10.
100
+ * 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
102
101
  */
103
102
 
104
- a:active,
105
- a:hover {
106
- outline: 0;
103
+ a {
104
+ background-color: transparent; /* 1 */
105
+ -webkit-text-decoration-skip: objects; /* 2 */
107
106
  }
108
107
 
109
- /* ==========================================================================
110
- Typography
111
- ========================================================================== */
112
-
113
108
  /**
114
- * Address variable `h1` font-size and margin within `section` and `article`
115
- * contexts in Firefox 4+, Safari 5, and Chrome.
109
+ * 1. Remove the bottom border in Chrome 57- and Firefox 39-.
110
+ * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
116
111
  */
117
112
 
118
- h1 {
119
- font-size: 2em;
120
- margin: 0.67em 0;
113
+ abbr[title] {
114
+ border-bottom: none; /* 1 */
115
+ text-decoration: underline; /* 2 */
116
+ text-decoration: underline dotted; /* 2 */
121
117
  }
122
118
 
123
119
  /**
124
- * Address styling not present in IE 8/9, Safari 5, and Chrome.
120
+ * Prevent the duplicate application of `bolder` by the next rule in Safari 6.
125
121
  */
126
122
 
127
- abbr[title] {
128
- border-bottom: 1px dotted;
123
+ b,
124
+ strong {
125
+ font-weight: inherit;
129
126
  }
130
127
 
131
128
  /**
132
- * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
129
+ * Add the correct font weight in Chrome, Edge, and Safari.
133
130
  */
134
131
 
135
132
  b,
136
133
  strong {
137
- font-weight: bold;
134
+ font-weight: bolder;
138
135
  }
139
136
 
140
137
  /**
141
- * Address styling not present in Safari 5 and Chrome.
138
+ * 1. Correct the inheritance and scaling of font size in all browsers.
139
+ * 2. Correct the odd `em` font sizing in all browsers.
142
140
  */
143
141
 
144
- dfn {
145
- font-style: italic;
142
+ code,
143
+ kbd,
144
+ samp {
145
+ font-family: monospace, monospace; /* 1 */
146
+ font-size: 1em; /* 2 */
146
147
  }
147
148
 
148
149
  /**
149
- * Address differences between Firefox and other browsers.
150
+ * Add the correct font style in Android 4.3-.
150
151
  */
151
152
 
152
- hr {
153
- -moz-box-sizing: content-box;
154
- box-sizing: content-box;
155
- height: 0;
153
+ dfn {
154
+ font-style: italic;
156
155
  }
157
156
 
158
157
  /**
159
- * Address styling not present in IE 8/9.
158
+ * Add the correct background and color in IE 9-.
160
159
  */
161
160
 
162
161
  mark {
163
- background: #ff0;
164
- color: #000;
162
+ background-color: #ff0;
163
+ color: #000;
165
164
  }
166
165
 
167
166
  /**
168
- * Correct font family set oddly in Safari 5 and Chrome.
167
+ * Add the correct font size in all browsers.
169
168
  */
170
169
 
171
- code,
172
- kbd,
173
- pre,
174
- samp {
175
- font-family: monospace, serif;
176
- font-size: 1em;
170
+ small {
171
+ font-size: 80%;
177
172
  }
178
173
 
179
174
  /**
180
- * Improve readability of pre-formatted text in all browsers.
175
+ * Prevent `sub` and `sup` elements from affecting the line height in
176
+ * all browsers.
181
177
  */
182
178
 
183
- pre {
184
- white-space: pre-wrap;
179
+ sub,
180
+ sup {
181
+ font-size: 75%;
182
+ line-height: 0;
183
+ position: relative;
184
+ vertical-align: baseline;
185
185
  }
186
186
 
187
+ sub {
188
+ bottom: -0.25em;
189
+ }
190
+
191
+ sup {
192
+ top: -0.5em;
193
+ }
194
+
195
+ /* Embedded content
196
+ ========================================================================== */
197
+
187
198
  /**
188
- * Set consistent quote types.
199
+ * Add the correct display in IE 9-.
189
200
  */
190
201
 
191
- q {
192
- quotes: "\201C" "\201D" "\2018" "\2019";
202
+ audio,
203
+ video {
204
+ display: inline-block;
193
205
  }
194
206
 
195
207
  /**
196
- * Address inconsistent and variable font size in all browsers.
208
+ * Add the correct display in iOS 4-7.
197
209
  */
198
210
 
199
- small {
200
- font-size: 80%;
211
+ audio:not([controls]) {
212
+ display: none;
213
+ height: 0;
201
214
  }
202
215
 
203
216
  /**
204
- * Prevent `sub` and `sup` affecting `line-height` in all browsers.
217
+ * Remove the border on images inside links in IE 10-.
205
218
  */
206
219
 
207
- sub,
208
- sup {
209
- font-size: 75%;
210
- line-height: 0;
211
- position: relative;
212
- vertical-align: baseline;
220
+ img {
221
+ border-style: none;
213
222
  }
214
223
 
215
- sup {
216
- top: -0.5em;
217
- }
224
+ /**
225
+ * Hide the overflow in IE.
226
+ */
218
227
 
219
- sub {
220
- bottom: -0.25em;
228
+ svg:not(:root) {
229
+ overflow: hidden;
221
230
  }
222
231
 
223
- /* ==========================================================================
224
- Embedded content
232
+ /* Forms
225
233
  ========================================================================== */
226
234
 
227
235
  /**
228
- * Remove border when inside `a` element in IE 8/9.
236
+ * 1. Change the font styles in all browsers (opinionated).
237
+ * 2. Remove the margin in Firefox and Safari.
229
238
  */
230
239
 
231
- img {
232
- border: 0;
240
+ button,
241
+ input,
242
+ optgroup,
243
+ select,
244
+ textarea {
245
+ font-family: sans-serif; /* 1 */
246
+ font-size: 100%; /* 1 */
247
+ line-height: 1.15; /* 1 */
248
+ margin: 0; /* 2 */
233
249
  }
234
250
 
235
251
  /**
236
- * Correct overflow displayed oddly in IE 9.
252
+ * Show the overflow in IE.
253
+ * 1. Show the overflow in Edge.
237
254
  */
238
255
 
239
- svg:not(:root) {
240
- overflow: hidden;
256
+ button,
257
+ input { /* 1 */
258
+ overflow: visible;
241
259
  }
242
260
 
243
- /* ==========================================================================
244
- Figures
245
- ========================================================================== */
261
+ /**
262
+ * Remove the inheritance of text transform in Edge, Firefox, and IE.
263
+ * 1. Remove the inheritance of text transform in Firefox.
264
+ */
265
+
266
+ button,
267
+ select { /* 1 */
268
+ text-transform: none;
269
+ }
246
270
 
247
271
  /**
248
- * Address margin not present in IE 8/9 and Safari 5.
272
+ * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
273
+ * controls in Android 4.
274
+ * 2. Correct the inability to style clickable types in iOS and Safari.
249
275
  */
250
276
 
251
- figure {
252
- margin: 0;
277
+ button,
278
+ html [type="button"], /* 1 */
279
+ [type="reset"],
280
+ [type="submit"] {
281
+ -webkit-appearance: button; /* 2 */
253
282
  }
254
283
 
255
- /* ==========================================================================
256
- Forms
257
- ========================================================================== */
284
+ /**
285
+ * Remove the inner border and padding in Firefox.
286
+ */
287
+
288
+ button::-moz-focus-inner,
289
+ [type="button"]::-moz-focus-inner,
290
+ [type="reset"]::-moz-focus-inner,
291
+ [type="submit"]::-moz-focus-inner {
292
+ border-style: none;
293
+ padding: 0;
294
+ }
295
+
296
+ /**
297
+ * Restore the focus styles unset by the previous rule.
298
+ */
299
+
300
+ button:-moz-focusring,
301
+ [type="button"]:-moz-focusring,
302
+ [type="reset"]:-moz-focusring,
303
+ [type="submit"]:-moz-focusring {
304
+ outline: 1px dotted ButtonText;
305
+ }
258
306
 
259
307
  /**
260
- * Define consistent border, margin, and padding.
308
+ * Correct the padding in Firefox.
261
309
  */
262
310
 
263
311
  fieldset {
264
- border: 1px solid #c0c0c0;
265
- margin: 0 2px;
266
- padding: 0.35em 0.625em 0.75em;
312
+ padding: 0.35em 0.75em 0.625em;
267
313
  }
268
314
 
269
315
  /**
270
- * 1. Correct `color` not being inherited in IE 8/9.
271
- * 2. Remove padding so people aren't caught out if they zero out fieldsets.
316
+ * 1. Correct the text wrapping in Edge and IE.
317
+ * 2. Correct the color inheritance from `fieldset` elements in IE.
318
+ * 3. Remove the padding so developers are not caught out when they zero out
319
+ * `fieldset` elements in all browsers.
272
320
  */
273
321
 
274
322
  legend {
275
- border: 0; /* 1 */
276
- padding: 0; /* 2 */
323
+ box-sizing: border-box; /* 1 */
324
+ color: inherit; /* 2 */
325
+ display: table; /* 1 */
326
+ max-width: 100%; /* 1 */
327
+ padding: 0; /* 3 */
328
+ white-space: normal; /* 1 */
277
329
  }
278
330
 
279
331
  /**
280
- * 1. Correct font family not being inherited in all browsers.
281
- * 2. Correct font size not being inherited in all browsers.
282
- * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
332
+ * 1. Add the correct display in IE 9-.
333
+ * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
283
334
  */
284
335
 
285
- button,
286
- input,
287
- select,
288
- textarea {
289
- font-family: inherit; /* 1 */
290
- font-size: 100%; /* 2 */
291
- margin: 0; /* 3 */
336
+ progress {
337
+ display: inline-block; /* 1 */
338
+ vertical-align: baseline; /* 2 */
292
339
  }
293
340
 
294
341
  /**
295
- * Address Firefox 4+ setting `line-height` on `input` using `!important` in
296
- * the UA stylesheet.
342
+ * Remove the default vertical scrollbar in IE.
297
343
  */
298
344
 
299
- button,
300
- input {
301
- line-height: normal;
345
+ textarea {
346
+ overflow: auto;
302
347
  }
303
348
 
304
349
  /**
305
- * Address inconsistent `text-transform` inheritance for `button` and `select`.
306
- * All other form control elements do not inherit `text-transform` values.
307
- * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
308
- * Correct `select` style inheritance in Firefox 4+ and Opera.
350
+ * 1. Add the correct box sizing in IE 10-.
351
+ * 2. Remove the padding in IE 10-.
309
352
  */
310
353
 
311
- button,
312
- select {
313
- text-transform: none;
354
+ [type="checkbox"],
355
+ [type="radio"] {
356
+ box-sizing: border-box; /* 1 */
357
+ padding: 0; /* 2 */
314
358
  }
315
359
 
316
360
  /**
317
- * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
318
- * and `video` controls.
319
- * 2. Correct inability to style clickable `input` types in iOS.
320
- * 3. Improve usability and consistency of cursor style between image-type
321
- * `input` and others.
361
+ * Correct the cursor style of increment and decrement buttons in Chrome.
322
362
  */
323
363
 
324
- button,
325
- html input[type="button"], /* 1 */
326
- input[type="reset"],
327
- input[type="submit"] {
328
- -webkit-appearance: button; /* 2 */
329
- cursor: pointer; /* 3 */
364
+ [type="number"]::-webkit-inner-spin-button,
365
+ [type="number"]::-webkit-outer-spin-button {
366
+ height: auto;
330
367
  }
331
368
 
332
369
  /**
333
- * Re-set default cursor for disabled elements.
370
+ * 1. Correct the odd appearance in Chrome and Safari.
371
+ * 2. Correct the outline style in Safari.
334
372
  */
335
373
 
336
- button[disabled],
337
- html input[disabled] {
338
- cursor: default;
374
+ [type="search"] {
375
+ -webkit-appearance: textfield; /* 1 */
376
+ outline-offset: -2px; /* 2 */
339
377
  }
340
378
 
341
379
  /**
342
- * 1. Address box sizing set to `content-box` in IE 8/9/10.
343
- * 2. Remove excess padding in IE 8/9/10.
380
+ * Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
344
381
  */
345
382
 
346
- input[type="checkbox"],
347
- input[type="radio"] {
348
- box-sizing: border-box; /* 1 */
349
- padding: 0; /* 2 */
383
+ [type="search"]::-webkit-search-cancel-button,
384
+ [type="search"]::-webkit-search-decoration {
385
+ -webkit-appearance: none;
350
386
  }
351
387
 
352
388
  /**
353
- * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
354
- * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
355
- * (include `-moz` to future-proof).
389
+ * 1. Correct the inability to style clickable types in iOS and Safari.
390
+ * 2. Change font properties to `inherit` in Safari.
356
391
  */
357
392
 
358
- input[type="search"] {
359
- -webkit-appearance: textfield; /* 1 */
360
- -moz-box-sizing: content-box;
361
- -webkit-box-sizing: content-box; /* 2 */
362
- box-sizing: content-box;
393
+ ::-webkit-file-upload-button {
394
+ -webkit-appearance: button; /* 1 */
395
+ font: inherit; /* 2 */
363
396
  }
364
397
 
365
- /**
366
- * Remove inner padding and search cancel button in Safari 5 and Chrome
367
- * on OS X.
398
+ /* Interactive
399
+ ========================================================================== */
400
+
401
+ /*
402
+ * Add the correct display in IE 9-.
403
+ * 1. Add the correct display in Edge, IE, and Firefox.
368
404
  */
369
405
 
370
- input[type="search"]::-webkit-search-cancel-button,
371
- input[type="search"]::-webkit-search-decoration {
372
- -webkit-appearance: none;
406
+ details, /* 1 */
407
+ menu {
408
+ display: block;
373
409
  }
374
410
 
411
+ /*
412
+ * Add the correct display in all browsers.
413
+ */
414
+
415
+ summary {
416
+ display: list-item;
417
+ }
418
+
419
+ /* Scripting
420
+ ========================================================================== */
421
+
375
422
  /**
376
- * Remove inner padding and border in Firefox 4+.
423
+ * Add the correct display in IE 9-.
377
424
  */
378
425
 
379
- button::-moz-focus-inner,
380
- input::-moz-focus-inner {
381
- border: 0;
382
- padding: 0;
426
+ canvas {
427
+ display: inline-block;
383
428
  }
384
429
 
385
430
  /**
386
- * 1. Remove default vertical scrollbar in IE 8/9.
387
- * 2. Improve readability and alignment in all browsers.
431
+ * Add the correct display in IE.
388
432
  */
389
433
 
390
- textarea {
391
- overflow: auto; /* 1 */
392
- vertical-align: top; /* 2 */
434
+ template {
435
+ display: none;
393
436
  }
394
437
 
395
- /* ==========================================================================
396
- Tables
438
+ /* Hidden
397
439
  ========================================================================== */
398
440
 
399
441
  /**
400
- * Remove most spacing between table cells.
442
+ * Add the correct display in IE 10-.
401
443
  */
402
444
 
403
- table {
404
- border-collapse: collapse;
405
- border-spacing: 0;
406
- }
445
+ [hidden] {
446
+ display: none;
447
+ }