diff --git a/src/stylesheets/helpers/_helpers-utils.scss b/src/stylesheets/helpers/_helpers-utils.scss index cbb32f8a3..18be8e33d 100644 --- a/src/stylesheets/helpers/_helpers-utils.scss +++ b/src/stylesheets/helpers/_helpers-utils.scss @@ -59,3 +59,15 @@ @return $rem-vals; } } + +/// Since the current way to qualify a class from within its ruleset is quite +/// ugly, here is a mixin providing a friendly API to do so. +/// @see https://css-tricks.com/snippets/sass/mixin-to-qualify-a-selector/ +/// @author Hugo Giraudel +/// @param {String} $element-selector - Element selector +/// @since 0.5.0; +@mixin when-is($element-selector) { + @at-root #{$element-selector + &} { + @content; + } +}