diff --git a/.changeset/popular-hounds-sin.md b/.changeset/popular-hounds-sin.md new file mode 100644 index 0000000000..56e3614d67 --- /dev/null +++ b/.changeset/popular-hounds-sin.md @@ -0,0 +1,5 @@ +--- +'@primer/css': patch +--- + +Fix styles for ::backdrop diff --git a/src/support/mixins/color-modes.scss b/src/support/mixins/color-modes.scss index 0ca2b89a31..ea1bf4e451 100644 --- a/src/support/mixins/color-modes.scss +++ b/src/support/mixins/color-modes.scss @@ -31,7 +31,7 @@ } ::backdrop, - [data-color-mode="light"][data-light-theme="#{$theme-name}"], + [data-color-mode="light"][data-light-theme="#{$theme-name}"]::backdrop, [data-color-mode="dark"][data-dark-theme="#{$theme-name}"]::backdrop { @content; @@ -47,6 +47,14 @@ @content; } } + + ::backdrop, + [data-color-mode="light"][data-light-theme="#{$theme-name}"]::backdrop, + [data-color-mode="dark"][data-dark-theme="#{$theme-name}"]::backdrop { + @content; + + /*! */ // Must remain separate from the above selector to not break browsers which don't support ::backdrop, e.g. Safari 14. + } } @media (prefers-color-scheme: light) { @@ -56,6 +64,12 @@ @content; } } + + [data-color-mode="auto"][data-light-theme="#{$theme-name}"]::backdrop { + @content; + + /*! */ // Must remain separate from the above selector to not break browsers which don't support ::backdrop, e.g. Safari 14. + } } @media (prefers-color-scheme: dark) { @@ -65,6 +79,12 @@ @content; } } + + [data-color-mode="auto"][data-light-theme="#{$theme-name}"]::backdrop { + @content; + + /*! */ // Must remain separate from the above selector to not break browsers which don't support ::backdrop, e.g. Safari 14. + } } }