From 86ddd7398c6fe0f43c7d2f4a1daa408bb83a8b98 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 14 Aug 2019 12:30:26 +0200 Subject: [PATCH] visually-hidden devient un mixin --- changelog.md | 1 + sass/abstracts/_mixins.scss | 12 ++++++++++++ sass/base/_utilities.scss | 23 +++++++++-------------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/changelog.md b/changelog.md index f508ee8..ef3583a 100644 --- a/changelog.md +++ b/changelog.md @@ -11,6 +11,7 @@ - modification de l'ordre d'import des fichiers : les utilitaires sont importées à la fin à présent - ajout d'une variable pour supporter ou non IE11 : `$ie: true !default;`. - ajout d'une variable pour supporter ou non WordPress : `$wordpress: false !default;`. +- `visually-hidden` devient un mixin - corrections typo ## Changelog v7.1.2 (30 janvier 2019) diff --git a/sass/abstracts/_mixins.scss b/sass/abstracts/_mixins.scss index d6574f0..eb77fd1 100644 --- a/sass/abstracts/_mixins.scss +++ b/sass/abstracts/_mixins.scss @@ -1,3 +1,15 @@ +// Visually-hidden mixin +@mixin visually-hidden { + position: absolute !important; + border: 0 !important; + height: 1px !important; + width: 1px !important; + padding: 0 !important; + overflow: hidden !important; + clip: rect(0, 0, 0, 0) !important; +} + + // font-size Mixin // compiles to font-size mobile + font-size desktop on small-plus devices // ex. h2 { @include font-size(h2);} diff --git a/sass/base/_utilities.scss b/sass/base/_utilities.scss index 715716e..145b9ce 100644 --- a/sass/base/_utilities.scss +++ b/sass/base/_utilities.scss @@ -95,7 +95,7 @@ /* simple blocks alignment */ -.left +.left, .u-left { margin-right: auto; } @@ -114,10 +114,8 @@ /* Global Micro Layout */ /* ------------------- */ -/* module, gains superpower "BFC" Block Formating Context */ +/* "BFC" Block Formating Context */ -.mod, -.u-mod, .bfc, .u-bfc { overflow: hidden; @@ -171,14 +169,14 @@ img.u-fr { } /* hidden but not for an assistive technology like a screen reader, Yahoo! method */ +// mixin in `abstracts/_mixins.scss` .visually-hidden { - position: absolute !important; - border: 0 !important; - height: 1px !important; - width: 1px !important; - padding: 0 !important; - overflow: hidden !important; - clip: rect(0, 0, 0, 0) !important; + @include visually-hidden; +} +@include respond-to("small") { + .small-visually-hidden { + @include visually-hidden; + } } .is-disabled, @@ -199,9 +197,6 @@ ul { } } -.color--inverse { - color: $white; -} /* Width Helpers */ /* ------------- */