Skip to content

Commit da57f73

Browse files
committed
Remove tag loops in reset.scss since comma does not increase selector specificity
1 parent b384f33 commit da57f73

File tree

1 file changed

+29
-37
lines changed

1 file changed

+29
-37
lines changed

scss/reset.scss

+29-37
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
@layer reset {
2-
$tags: 'a', 'abbr', 'address', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'blockquote', 'body', 'canvas', 'caption', 'cite', 'code', 'data', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'html', 'i', 'iframe', 'img', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'mark', 'menu', 'nav', 'object', 'ol', 'output', 'p', 'picture', 'pre', 'q', 'ruby', 's', 'samp', 'search', 'section', 'small', 'span', 'strong', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'u', 'ul', 'var', 'video';
3-
4-
@each $tag in $tags {
5-
#{$tag} {
6-
margin: 0;
7-
padding: 0;
8-
border: 0;
9-
font: inherit;
10-
vertical-align: baseline;
11-
}
2+
a, abbr, address, article, aside, audio, b, bdi, bdo, blockquote, body, canvas, caption, cite, code, data, dd, del, details, dfn, dialog, div, dl, dt, em, embed, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, html, i, iframe, img, ins, kbd, label, legend, li, main, mark, menu, nav, object, ol, output, p, picture, pre, q, ruby, s, samp, search, section, small, span, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, time, tr, track, u, ul, var, video {
3+
margin: 0;
4+
padding: 0;
5+
border: 0;
6+
font: inherit;
7+
vertical-align: baseline;
128
}
139

1410
// Set line height as 1 to avoid layout nonsense.
@@ -48,41 +44,37 @@
4844
border-color: #808080;
4945
}
5046

51-
$tags: 'button', 'input', 'select', 'textarea';
52-
53-
@each $tag in $tags {
54-
#{$tag} {
55-
margin: 0;
56-
padding: 0;
57-
color: inherit;
58-
font: inherit;
59-
line-height: inherit; // Seems to have no effect on <select> (and no effect on <input type="button"> in Chrome)
60-
vertical-align: baseline;
61-
}
47+
button, input, select, textarea {
48+
margin: 0;
49+
padding: 0;
50+
color: inherit;
51+
font: inherit;
52+
// line-height seems to have no effect on <select>
53+
// and no effect on <input type="button"> in Chrome.
54+
line-height: inherit;
55+
vertical-align: baseline;
6256
}
6357

6458
// Remove search cancel button in Safari and Chrome.
65-
66-
$tags: 'input[type="search"]::-webkit-search-cancel-button', 'input[type="search"]::-webkit-search-decoration', 'input[type="search"]::-webkit-search-results-button', 'input[type="search"]::-webkit-search-results-decoration';
67-
68-
@each $tag in $tags {
69-
#{$tag} {
70-
appearance: none;
71-
}
59+
input[type="search"]::-webkit-search-cancel-button,
60+
input[type="search"]::-webkit-search-decoration,
61+
input[type="search"]::-webkit-search-results-button,
62+
input[type="search"]::-webkit-search-results-decoration {
63+
appearance: none;
7264
}
7365

74-
$tags: 'button', 'input[type="button"]', 'input[type="reset"]', 'input[type="submit"]';
75-
76-
@each $tag in $tags {
77-
#{$tag} {
78-
cursor: pointer; // Consistency of cursor style between <input type="image"> and others.
79-
-webkit-appearance: button; // Correct the inability to style clickable types in iOS and Safari.
80-
}
66+
button, input[type="button"], input[type="reset"], input[type="submit"] {
67+
// Consistency of cursor style between <input type="image"> and others.
68+
cursor: pointer;
69+
// Correct the inability to style clickable types in iOS and Safari.
70+
-webkit-appearance: button;
8171
}
8272

8373
::-webkit-file-upload-button {
84-
-webkit-appearance: button; // Correct the inability to style clickable types in iOS and Safari.
85-
font: inherit; // Change font properties to `inherit` in Safari.
74+
// Correct the inability to style clickable types in iOS and Safari.
75+
-webkit-appearance: button;
76+
// Change font properties to `inherit` in Safari.
77+
font: inherit;
8678
}
8779

8880
::selection {

0 commit comments

Comments
 (0)