Skip to content

Commit 6eba5e3

Browse files
Bug fixes
- Fixes issues #64 #66 - Add pseudo-elements to universal selector in print media query (h5bp/html5-boilerplate#1585) - Remove gap below iframes (h5bp/html5-boilerplate#1613) - Add vertical centering for svg (h5bp/html5-boilerplate#1453) - simplify `:focus` selector
1 parent 3f961d8 commit 6eba5e3

12 files changed

+37
-47
lines changed

build/responsive.css

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Copyright (c), James South.
66
Licensed under the MIT License.
77
============================================================================== */
8-
/*! Responsive v4.0.2 | MIT License | responsivebp.com */
8+
/*! Responsive v4.0.3 | MIT License | responsivebp.com */
99
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
1010
html {
1111
font-family: sans-serif;
@@ -156,8 +156,8 @@ html {
156156
*, :before, :after {
157157
box-sizing: inherit; }
158158

159-
a:focus, area:focus, button:focus, input:focus, object:focus, select:focus, textarea:focus, [tabindex]:focus {
160-
outline-color: #4d90fe;
159+
:focus {
160+
outline: #4d90fe;
161161
outline-style: solid;
162162
outline-width: 1px;
163163
outline-offset: -1px; }
@@ -4537,8 +4537,10 @@ dt, dd {
45374537
margin-right: 10.375rem; } }
45384538
audio,
45394539
canvas,
4540+
iframe,
45404541
img,
4541-
video {
4542+
video,
4543+
svg {
45424544
vertical-align: middle; }
45434545

45444546
img {
@@ -5440,8 +5442,7 @@ button.modal-direction {
54405442

54415443
[aria-hidden="true"],
54425444
.hidden {
5443-
display: none !important;
5444-
visibility: hidden; }
5445+
display: none !important; }
54455446

54465447
.visuallyhidden {
54475448
border: 0;
@@ -5622,12 +5623,9 @@ button.modal-direction {
56225623
caption.visible-l {
56235624
display: table-caption !important; } }
56245625
@media print {
5625-
* {
5626+
*, :before, :after {
56265627
box-shadow: none !important;
5627-
text-shadow: none !important; }
5628-
5629-
html,
5630-
body {
5628+
text-shadow: none !important;
56315629
background: transparent !important;
56325630
color: #000 !important; }
56335631

build/responsive.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Licensed under the MIT License.
77
============================================================================== */
88

9-
/*! Responsive v4.0.2 | MIT License | responsivebp.com */
9+
/*! Responsive v4.0.3 | MIT License | responsivebp.com */
1010

1111
/*
1212
* Responsive Core
@@ -1954,7 +1954,7 @@
19541954
touch: true,
19551955
next: ">",
19561956
nextHint: "Next (" + (rtl ? "Left" : "Right") + " Arrow)",
1957-
prev: "<",
1957+
previous: "<",
19581958
previousHint: "Previous (" + (rtl ? "Right" : "Left") + " Arrow)",
19591959
closeHint: "Close (Esc)",
19601960
errorHint: "<p>An error has occured.</p>",
@@ -2015,9 +2015,11 @@
20152015
showEvent = $.Event(eshow),
20162016
shownEvent = $.Event(eshown),
20172017
complete = function () {
2018-
2018+
var $autofocus = $modal.find("[autofocus]");
20192019
$body.attr({ "tabindex": -1 });
2020-
$modal.data("currentModal", self.$element).attr({ "tabindex": 0 }).focus();
2020+
2021+
$modal.data("currentModal", self.$element).attr({ "tabindex": 0 });
2022+
$autofocus.length ? $autofocus.focus() : $modal.focus();
20212023

20222024
// Ensure that focus is maintained within the modal.
20232025
$(document).on(efocusin, function (event) {
@@ -2027,7 +2029,7 @@
20272029
$newTarget.length ? $newTarget.focus() : $modal.focus();
20282030

20292031
return false;
2030-
}
2032+
}
20312033
return true;
20322034
});
20332035

@@ -2252,7 +2254,7 @@
22522254
local = !notHash && !external,
22532255
$group = this.$group,
22542256
nextText = this.options.next + "<span class=\"visuallyhidden\">" + this.options.nextHint + "</span>",
2255-
prevText = this.options.prev + "<span class=\"visuallyhidden\">" + this.options.prevHint + "</span>",
2257+
prevText = this.options.previous + "<span class=\"visuallyhidden\">" + this.options.previousHint + "</span>",
22562258
iframeScroll = this.options.iframeScroll,
22572259
image = this.options.image || rimage.test(target),
22582260
iframe = this.options.iframe || notHash && external ? !image : false,

build/responsive.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/responsive.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/responsive.core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Licensed under the MIT License.
77
============================================================================== */
88

9-
/*! Responsive v4.0.2 | MIT License | responsivebp.com */
9+
/*! Responsive v4.0.3 | MIT License | responsivebp.com */
1010

1111
/*
1212
* Responsive Core

src/js/responsive.modal.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,11 @@
125125
showEvent = $.Event(eshow),
126126
shownEvent = $.Event(eshown),
127127
complete = function () {
128-
128+
var $autofocus = $modal.find("[autofocus]");
129129
$body.attr({ "tabindex": -1 });
130-
$modal.data("currentModal", self.$element).attr({ "tabindex": 0 }).focus();
130+
131+
$modal.data("currentModal", self.$element).attr({ "tabindex": 0 });
132+
$autofocus.length ? $autofocus.focus() : $modal.focus();
131133

132134
// Ensure that focus is maintained within the modal.
133135
$(document).on(efocusin, function (event) {
@@ -137,7 +139,7 @@
137139
$newTarget.length ? $newTarget.focus() : $modal.focus();
138140

139141
return false;
140-
}
142+
}
141143
return true;
142144
});
143145

src/sass/partials/_base.scss

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,15 @@ html {
1212
box-sizing: inherit;
1313
}
1414

15-
// Add a placeholder for focus events so we can manage
16-
// both global and button styles.
17-
%focus {
18-
outline-color: $selection-focus-color;
15+
// Set focus on elements that can recieve it.
16+
// http://www.w3.org/TR/html401/interact/forms.html#adef-tabindex
17+
:focus {
18+
outline: $selection-focus-color;
1919
outline-style: $selection-focus-style;
2020
outline-width: $selection-focus-width;
2121
outline-offset: $selection-focus-offset;
2222
}
2323

24-
// Set a focus on elements that can recieve it.
25-
// http://www.w3.org/TR/html401/interact/forms.html#adef-tabindex
26-
a, area, button, input, object, select, textarea, [tabindex] {
27-
&:focus {
28-
@extend %focus;
29-
}
30-
}
31-
3224
// Suppress the focus outline on links that cannot be accessed via keyboard.
3325
// This prevents an unwanted focus outline from appearing around elements that
3426
// might still respond to pointer events.

src/sass/partials/_copyright.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
Licensed under the MIT License.
77
============================================================================== */
88

9-
/*! Responsive v4.0.2 | MIT License | responsivebp.com */
9+
/*! Responsive v4.0.3 | MIT License | responsivebp.com */

src/sass/partials/_helpers-visibility.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
[aria-hidden="true"],
1717
.hidden {
1818
display: none !important;
19-
visibility: hidden;
2019
}
2120

2221
// Hide only visually, but have it available for screen readers: h5bp.com/v

src/sass/partials/_media.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
// their containers: h5bp.com/i/440
33
audio,
44
canvas,
5+
iframe,
56
img,
6-
video {
7+
video,
8+
svg {
79
vertical-align: middle;
810
}
911

@@ -74,7 +76,7 @@ a img {
7476
outline: none;
7577
padding: 0;
7678
position: absolute;
77-
top: 0;
79+
top: 0;
7880
width: 100%;
7981
}
8082

@@ -85,7 +87,7 @@ a img {
8587
// at 100%.
8688
bottom: -1000000%;
8789
left: -1000000%;
88-
margin: auto;
90+
margin: auto;
8991
position: absolute;
9092
right: -1000000%;
9193
top: -1000000%;

src/sass/partials/_print.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44
// Source: https://github.com/h5bp/html5-boilerplate/blob/master/css/main.css
55

66
@media print {
7-
* {
7+
*, :before, :after {
88
box-shadow: none !important;
99
text-shadow: none !important;
10-
}
11-
12-
html,
13-
body {
1410
background: transparent !important;
1511
color: #000 !important; // Black prints faster: h5bp.com/s
1612
}

src/sass/utilities/_variables.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ $h6-margin: 1.561rem !default;
2727
$selection-background: #b3d4fc !default;
2828

2929
// Focused objects
30-
$selection-focus: 1px solid #4d90fe!default;
3130
$selection-focus-color: #4d90fe!default;
3231
$selection-focus-style: solid!default;
3332
$selection-focus-width: 1px!default;

0 commit comments

Comments
 (0)