From d179f95408546adcdff5562b6f9e1ff75ac812f2 Mon Sep 17 00:00:00 2001 From: Patrick Yeo Date: Mon, 12 Aug 2024 14:13:52 -0700 Subject: [PATCH] LPD-33629 $modal-palette map should output pseudo classes for .close - Added pseudo class and element keywords to filter for in the mixin `clay-map-to-css` --- packages/clay-css/src/scss/mixins/_globals.scss | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/clay-css/src/scss/mixins/_globals.scss b/packages/clay-css/src/scss/mixins/_globals.scss index f4cd145072..17405ee5e3 100644 --- a/packages/clay-css/src/scss/mixins/_globals.scss +++ b/packages/clay-css/src/scss/mixins/_globals.scss @@ -373,8 +373,21 @@ @each $key, $value in $map { @if not clay-is-map-unset($value) { @if (type-of($value) == 'map') { + $pseudo-classes: 'active', 'disabled', 'first-child', 'focus', + 'hover', 'last-child', 'visited'; + + $pseudo-elements: 'after', 'before'; + $valid-prefixes: '#', '&', '.', '>', '@', '~', '+', '['; + @if (index($pseudo-classes, $key)) { + $key: str-insert($key, '&:', 1); + } + + @if (index($pseudo-elements, $key)) { + $key: str-insert($key, '&::', 1); + } + $selector: if( index($valid-prefixes, str-slice($key, 1, 1)), $key,