maily 0.5.0 → 0.6.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/.travis.yml +6 -9
- data/Appraisals +4 -8
- data/README.md +26 -11
- data/app/assets/javascripts/maily/application.js +0 -2
- data/app/assets/stylesheets/maily/application.scss +13 -7
- data/app/assets/stylesheets/maily/icons.css +5 -5
- data/app/assets/stylesheets/maily/normalize.css +251 -210
- data/app/controllers/maily/application_controller.rb +2 -2
- data/app/controllers/maily/emails_controller.rb +9 -5
- data/app/helpers/maily/emails_helper.rb +4 -0
- data/app/views/layouts/maily/application.html.erb +5 -4
- data/app/views/maily/emails/index.html.erb +2 -1
- data/app/views/maily/emails/show.html.erb +8 -2
- data/app/views/maily/shared/_footer.html.erb +1 -1
- data/app/views/maily/shared/_sidebar.html.erb +1 -1
- data/gemfiles/{rails_3.2.gemfile → rails_5.1.gemfile} +1 -1
- data/lib/generators/templates/initializer.rb +6 -0
- data/lib/maily.rb +8 -5
- data/lib/maily/email.rb +16 -4
- data/lib/maily/version.rb +1 -1
- data/maily.gemspec +1 -1
- data/spec/controllers_spec.rb +2 -1
- data/spec/dummy/lib/maily_hooks.rb +5 -3
- data/spec/email_spec.rb +12 -1
- metadata +6 -9
- data/app/assets/images/maily/.gitkeep +0 -0
- data/app/assets/javascripts/maily/html5shiv.js +0 -8
- data/gemfiles/rails_4.1.gemfile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b143eb37ea922863a831b9cd11c6dea69114477
|
4
|
+
data.tar.gz: 9ad22c49d8c49ce3d064c5f29e01f56fa3aa4f7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
9
|
-
- 2.3.
|
10
|
-
- 2.2.
|
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.
|
24
|
-
gemfile: gemfiles/
|
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
|
[](http://badge.fury.io/rb/maily) [](https://travis-ci.org/markets/maily)
|
4
4
|
|
5
|
-
|
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
|
18
|
-
* Easy way (
|
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
|

|
@@ -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
|
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,
|
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,
|
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
|
-
|
148
|
+
current_user.admin? || raise("You don't have access to this section!")
|
134
149
|
end
|
135
150
|
end
|
136
151
|
```
|
@@ -1,14 +1,11 @@
|
|
1
|
-
|
2
|
-
|
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
|
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
|
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
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
-
*
|
22
|
+
* Remove the margin in all browsers (opinionated).
|
28
23
|
*/
|
29
24
|
|
30
|
-
|
31
|
-
|
32
|
-
video {
|
33
|
-
display: inline-block;
|
25
|
+
body {
|
26
|
+
margin: 0;
|
34
27
|
}
|
35
28
|
|
36
29
|
/**
|
37
|
-
*
|
38
|
-
* Remove excess height in iOS 5 devices.
|
30
|
+
* Add the correct display in IE 9-.
|
39
31
|
*/
|
40
32
|
|
41
|
-
|
42
|
-
|
43
|
-
|
33
|
+
article,
|
34
|
+
aside,
|
35
|
+
footer,
|
36
|
+
header,
|
37
|
+
nav,
|
38
|
+
section {
|
39
|
+
display: block;
|
44
40
|
}
|
45
41
|
|
46
42
|
/**
|
47
|
-
*
|
48
|
-
*
|
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
|
-
|
52
|
-
|
53
|
-
|
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
|
-
*
|
62
|
-
*
|
63
|
-
* user zoom.
|
56
|
+
* Add the correct display in IE 9-.
|
57
|
+
* 1. Add the correct display in IE.
|
64
58
|
*/
|
65
59
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
60
|
+
figcaption,
|
61
|
+
figure,
|
62
|
+
main { /* 1 */
|
63
|
+
display: block;
|
70
64
|
}
|
71
65
|
|
72
66
|
/**
|
73
|
-
*
|
67
|
+
* Add the correct margin in IE 8.
|
74
68
|
*/
|
75
69
|
|
76
|
-
|
77
|
-
|
70
|
+
figure {
|
71
|
+
margin: 1em 40px;
|
78
72
|
}
|
79
73
|
|
80
|
-
/* ==========================================================================
|
81
|
-
Links
|
82
|
-
========================================================================== */
|
83
|
-
|
84
74
|
/**
|
85
|
-
*
|
75
|
+
* 1. Add the correct box sizing in Firefox.
|
76
|
+
* 2. Show the overflow in Edge and IE.
|
86
77
|
*/
|
87
78
|
|
88
|
-
|
89
|
-
|
79
|
+
hr {
|
80
|
+
box-sizing: content-box; /* 1 */
|
81
|
+
height: 0; /* 1 */
|
82
|
+
overflow: visible; /* 2 */
|
90
83
|
}
|
91
84
|
|
92
85
|
/**
|
93
|
-
*
|
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
|
-
|
97
|
-
|
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
|
-
*
|
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
|
105
|
-
|
106
|
-
|
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
|
-
*
|
115
|
-
*
|
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
|
-
|
119
|
-
|
120
|
-
|
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
|
-
*
|
120
|
+
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
|
125
121
|
*/
|
126
122
|
|
127
|
-
|
128
|
-
|
123
|
+
b,
|
124
|
+
strong {
|
125
|
+
font-weight: inherit;
|
129
126
|
}
|
130
127
|
|
131
128
|
/**
|
132
|
-
*
|
129
|
+
* Add the correct font weight in Chrome, Edge, and Safari.
|
133
130
|
*/
|
134
131
|
|
135
132
|
b,
|
136
133
|
strong {
|
137
|
-
|
134
|
+
font-weight: bolder;
|
138
135
|
}
|
139
136
|
|
140
137
|
/**
|
141
|
-
*
|
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
|
-
|
145
|
-
|
142
|
+
code,
|
143
|
+
kbd,
|
144
|
+
samp {
|
145
|
+
font-family: monospace, monospace; /* 1 */
|
146
|
+
font-size: 1em; /* 2 */
|
146
147
|
}
|
147
148
|
|
148
149
|
/**
|
149
|
-
*
|
150
|
+
* Add the correct font style in Android 4.3-.
|
150
151
|
*/
|
151
152
|
|
152
|
-
|
153
|
-
|
154
|
-
box-sizing: content-box;
|
155
|
-
height: 0;
|
153
|
+
dfn {
|
154
|
+
font-style: italic;
|
156
155
|
}
|
157
156
|
|
158
157
|
/**
|
159
|
-
*
|
158
|
+
* Add the correct background and color in IE 9-.
|
160
159
|
*/
|
161
160
|
|
162
161
|
mark {
|
163
|
-
|
164
|
-
|
162
|
+
background-color: #ff0;
|
163
|
+
color: #000;
|
165
164
|
}
|
166
165
|
|
167
166
|
/**
|
168
|
-
*
|
167
|
+
* Add the correct font size in all browsers.
|
169
168
|
*/
|
170
169
|
|
171
|
-
|
172
|
-
|
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
|
-
*
|
175
|
+
* Prevent `sub` and `sup` elements from affecting the line height in
|
176
|
+
* all browsers.
|
181
177
|
*/
|
182
178
|
|
183
|
-
|
184
|
-
|
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
|
-
*
|
199
|
+
* Add the correct display in IE 9-.
|
189
200
|
*/
|
190
201
|
|
191
|
-
|
192
|
-
|
202
|
+
audio,
|
203
|
+
video {
|
204
|
+
display: inline-block;
|
193
205
|
}
|
194
206
|
|
195
207
|
/**
|
196
|
-
*
|
208
|
+
* Add the correct display in iOS 4-7.
|
197
209
|
*/
|
198
210
|
|
199
|
-
|
200
|
-
|
211
|
+
audio:not([controls]) {
|
212
|
+
display: none;
|
213
|
+
height: 0;
|
201
214
|
}
|
202
215
|
|
203
216
|
/**
|
204
|
-
*
|
217
|
+
* Remove the border on images inside links in IE 10-.
|
205
218
|
*/
|
206
219
|
|
207
|
-
|
208
|
-
|
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
|
-
|
216
|
-
|
217
|
-
|
224
|
+
/**
|
225
|
+
* Hide the overflow in IE.
|
226
|
+
*/
|
218
227
|
|
219
|
-
|
220
|
-
|
228
|
+
svg:not(:root) {
|
229
|
+
overflow: hidden;
|
221
230
|
}
|
222
231
|
|
223
|
-
/*
|
224
|
-
Embedded content
|
232
|
+
/* Forms
|
225
233
|
========================================================================== */
|
226
234
|
|
227
235
|
/**
|
228
|
-
*
|
236
|
+
* 1. Change the font styles in all browsers (opinionated).
|
237
|
+
* 2. Remove the margin in Firefox and Safari.
|
229
238
|
*/
|
230
239
|
|
231
|
-
|
232
|
-
|
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
|
-
*
|
252
|
+
* Show the overflow in IE.
|
253
|
+
* 1. Show the overflow in Edge.
|
237
254
|
*/
|
238
255
|
|
239
|
-
|
240
|
-
|
256
|
+
button,
|
257
|
+
input { /* 1 */
|
258
|
+
overflow: visible;
|
241
259
|
}
|
242
260
|
|
243
|
-
|
244
|
-
|
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
|
-
*
|
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
|
-
|
252
|
-
|
277
|
+
button,
|
278
|
+
html [type="button"], /* 1 */
|
279
|
+
[type="reset"],
|
280
|
+
[type="submit"] {
|
281
|
+
-webkit-appearance: button; /* 2 */
|
253
282
|
}
|
254
283
|
|
255
|
-
|
256
|
-
|
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
|
-
*
|
308
|
+
* Correct the padding in Firefox.
|
261
309
|
*/
|
262
310
|
|
263
311
|
fieldset {
|
264
|
-
|
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
|
271
|
-
* 2.
|
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
|
-
|
276
|
-
|
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.
|
281
|
-
* 2.
|
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
|
-
|
286
|
-
|
287
|
-
|
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
|
-
*
|
296
|
-
* the UA stylesheet.
|
342
|
+
* Remove the default vertical scrollbar in IE.
|
297
343
|
*/
|
298
344
|
|
299
|
-
|
300
|
-
|
301
|
-
line-height: normal;
|
345
|
+
textarea {
|
346
|
+
overflow: auto;
|
302
347
|
}
|
303
348
|
|
304
349
|
/**
|
305
|
-
*
|
306
|
-
*
|
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
|
-
|
312
|
-
|
313
|
-
|
354
|
+
[type="checkbox"],
|
355
|
+
[type="radio"] {
|
356
|
+
box-sizing: border-box; /* 1 */
|
357
|
+
padding: 0; /* 2 */
|
314
358
|
}
|
315
359
|
|
316
360
|
/**
|
317
|
-
*
|
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
|
-
|
326
|
-
|
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
|
-
*
|
370
|
+
* 1. Correct the odd appearance in Chrome and Safari.
|
371
|
+
* 2. Correct the outline style in Safari.
|
334
372
|
*/
|
335
373
|
|
336
|
-
|
337
|
-
|
338
|
-
|
374
|
+
[type="search"] {
|
375
|
+
-webkit-appearance: textfield; /* 1 */
|
376
|
+
outline-offset: -2px; /* 2 */
|
339
377
|
}
|
340
378
|
|
341
379
|
/**
|
342
|
-
*
|
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
|
-
|
347
|
-
|
348
|
-
|
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.
|
354
|
-
* 2.
|
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
|
-
|
359
|
-
|
360
|
-
|
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
|
-
|
367
|
-
|
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
|
-
|
371
|
-
|
372
|
-
|
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
|
-
*
|
423
|
+
* Add the correct display in IE 9-.
|
377
424
|
*/
|
378
425
|
|
379
|
-
|
380
|
-
|
381
|
-
border: 0;
|
382
|
-
padding: 0;
|
426
|
+
canvas {
|
427
|
+
display: inline-block;
|
383
428
|
}
|
384
429
|
|
385
430
|
/**
|
386
|
-
*
|
387
|
-
* 2. Improve readability and alignment in all browsers.
|
431
|
+
* Add the correct display in IE.
|
388
432
|
*/
|
389
433
|
|
390
|
-
|
391
|
-
|
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
|
-
*
|
442
|
+
* Add the correct display in IE 10-.
|
401
443
|
*/
|
402
444
|
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
}
|
445
|
+
[hidden] {
|
446
|
+
display: none;
|
447
|
+
}
|