From 22cc3929ee5e1d96dd52bb2d2178dd9d9466a673 Mon Sep 17 00:00:00 2001 From: Yvonne Tang Date: Wed, 1 May 2019 15:41:35 -0700 Subject: [PATCH 1/4] Add .su-skiplinks__target class to skip link target which should use the @hide-visually mixin instead of @hide-text (causes overflow and takes up space) --- core/dist/css/decanter.css | 12 ++++++++++++ core/src/scss/components/skiplinks/_skiplinks.scss | 6 +++++- core/src/scss/core/helpers/_sr-only-text.scss | 4 +++- core/src/templates/components/skiplinks/target.twig | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/core/dist/css/decanter.css b/core/dist/css/decanter.css index fea699a4e..43a9ad2fa 100644 --- a/core/dist/css/decanter.css +++ b/core/dist/css/decanter.css @@ -8768,5 +8768,17 @@ a { width: auto; z-index: 11222; } +.su-skiplinks__target { + border: 0; + clip: rect(1px, 1px, 1px, 1px); + -webkit-clip-path: inset(100%); + clip-path: inset(100%); + height: 1px; + overflow: hidden; + padding: 0; + position: absolute; + white-space: nowrap; + width: 1px; } + /*# sourceMappingURL=decanter.css.map*/ \ No newline at end of file diff --git a/core/src/scss/components/skiplinks/_skiplinks.scss b/core/src/scss/components/skiplinks/_skiplinks.scss index 7da694350..e227b6af7 100644 --- a/core/src/scss/components/skiplinks/_skiplinks.scss +++ b/core/src/scss/components/skiplinks/_skiplinks.scss @@ -19,7 +19,7 @@ // Skip to main content // //
-//

Main Content

+//

Main Content

//
// // @@ -29,3 +29,7 @@ .su-skiplinks { @include skiplinks; } + +.su-skiplinks__target { + @include hide-visually; +} diff --git a/core/src/scss/core/helpers/_sr-only-text.scss b/core/src/scss/core/helpers/_sr-only-text.scss index 20bd239f9..623206f60 100644 --- a/core/src/scss/core/helpers/_sr-only-text.scss +++ b/core/src/scss/core/helpers/_sr-only-text.scss @@ -3,7 +3,9 @@ // // Screen Reader Only Text // -// Hides the text in an element, commonly used to show an image instead. +// Use this helper only for text that describes an image but should be hidden visually. For other use cases where +// text needs to be hidden visually (e.g., skip link targets), use the .su-sr-only-element helper class instead. +// // Some elements will need block-level styles applied. // // Style guide: Core.Helpers.sr-only diff --git a/core/src/templates/components/skiplinks/target.twig b/core/src/templates/components/skiplinks/target.twig index be3d89781..aec851a8d 100644 --- a/core/src/templates/components/skiplinks/target.twig +++ b/core/src/templates/components/skiplinks/target.twig @@ -13,4 +13,4 @@ * skiplink - defaults to 'Main Content' */ #} -

{{ target_text|default('Main Content') }}

+

{{ target_text|default('Main Content') }}

From 1d0cac1091657d659cda3d06ad1a84f491bd025e Mon Sep 17 00:00:00 2001 From: JB Christy Date: Wed, 22 May 2019 11:00:49 -0700 Subject: [PATCH 2/4] 5.1.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 24d42b6ba..825558b67 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "decanter", - "version": "5.0.1", + "version": "5.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 80353084c..774965892 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "decanter", "description": "Pattern Library and CSS Framework.", "author": "", - "version": "5.0.1", + "version": "5.1.0", "homepage": "https://github.com/SU-SWS/decanter", "license": "MIT", "srcDir": "core/src/", From 8536e1808e3444ac6da988d708a2128ea777d6b1 Mon Sep 17 00:00:00 2001 From: Yvonne Tang Date: Wed, 22 May 2019 11:17:14 -0700 Subject: [PATCH 3/4] remove su-skiplinks__target class and use su-sr-only-element; remove unhide behavior from su-sr-only-element helper --- core/dist/css/decanter.css | 21 ------------------- .../scss/components/skiplinks/_skiplinks.scss | 6 +----- .../scss/core/helpers/_sr-only-element.scss | 5 ----- .../components/skiplinks/target.twig | 2 +- 4 files changed, 2 insertions(+), 32 deletions(-) diff --git a/core/dist/css/decanter.css b/core/dist/css/decanter.css index 43a9ad2fa..c91ac8bb9 100644 --- a/core/dist/css/decanter.css +++ b/core/dist/css/decanter.css @@ -1729,15 +1729,6 @@ button, position: absolute; white-space: nowrap; width: 1px; } - .su-sr-only-element:active, .su-sr-only-element:focus { - clip: auto; - -webkit-clip-path: none; - clip-path: none; - height: auto; - overflow: visible; - position: static; - white-space: inherit; - width: auto; } .su-sr-only-text { overflow: hidden; @@ -8768,17 +8759,5 @@ a { width: auto; z-index: 11222; } -.su-skiplinks__target { - border: 0; - clip: rect(1px, 1px, 1px, 1px); - -webkit-clip-path: inset(100%); - clip-path: inset(100%); - height: 1px; - overflow: hidden; - padding: 0; - position: absolute; - white-space: nowrap; - width: 1px; } - /*# sourceMappingURL=decanter.css.map*/ \ No newline at end of file diff --git a/core/src/scss/components/skiplinks/_skiplinks.scss b/core/src/scss/components/skiplinks/_skiplinks.scss index e227b6af7..a03f4b509 100644 --- a/core/src/scss/components/skiplinks/_skiplinks.scss +++ b/core/src/scss/components/skiplinks/_skiplinks.scss @@ -19,7 +19,7 @@ // Skip to main content // //
-//

Main Content

+//

Main Content

//
// // @@ -29,7 +29,3 @@ .su-skiplinks { @include skiplinks; } - -.su-skiplinks__target { - @include hide-visually; -} diff --git a/core/src/scss/core/helpers/_sr-only-element.scss b/core/src/scss/core/helpers/_sr-only-element.scss index fa05c50bc..77b9964de 100644 --- a/core/src/scss/core/helpers/_sr-only-element.scss +++ b/core/src/scss/core/helpers/_sr-only-element.scss @@ -11,9 +11,4 @@ // .su-sr-only-element { @include hide-visually; - - &:active, - &:focus { - @include hide-visually("unhide"); - } } diff --git a/core/src/templates/components/skiplinks/target.twig b/core/src/templates/components/skiplinks/target.twig index aec851a8d..c5f4b636f 100644 --- a/core/src/templates/components/skiplinks/target.twig +++ b/core/src/templates/components/skiplinks/target.twig @@ -13,4 +13,4 @@ * skiplink - defaults to 'Main Content' */ #} -

{{ target_text|default('Main Content') }}

+

{{ target_text|default('Main Content') }}

From cb5a8922777792fc62f9e94412ff604cf069e88f Mon Sep 17 00:00:00 2001 From: JB Christy Date: Wed, 22 May 2019 11:51:23 -0700 Subject: [PATCH 4/4] revert inadvertent change in version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 774965892..80353084c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "decanter", "description": "Pattern Library and CSS Framework.", "author": "", - "version": "5.1.0", + "version": "5.0.1", "homepage": "https://github.com/SU-SWS/decanter", "license": "MIT", "srcDir": "core/src/",