From 121a8ee172fc4c6dc422f3f96355381dbbf0b697 Mon Sep 17 00:00:00 2001 From: Material Web Team Date: Thu, 30 Mar 2023 16:41:53 -0700 Subject: [PATCH] chore: Add HCM border mixin to deprecated MDC chips. PiperOrigin-RevId: 520775721 --- packages/mdc-chips/deprecated/_mixins.scss | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/mdc-chips/deprecated/_mixins.scss b/packages/mdc-chips/deprecated/_mixins.scss index a10225424b0..bc676edce47 100644 --- a/packages/mdc-chips/deprecated/_mixins.scss +++ b/packages/mdc-chips/deprecated/_mixins.scss @@ -30,6 +30,7 @@ @use '@material/checkbox/variables' as checkbox-variables; @use '@material/elevation/mixins' as elevation-mixins; @use '@material/density/functions' as density-functions; +@use '@material/dom'; @use '@material/feature-targeting/feature-targeting'; @use '@material/focus-ring/focus-ring'; @use '@material/ripple/ripple'; @@ -728,6 +729,20 @@ $ripple-target: '.mdc-chip__ripple'; } } +@mixin high-contrast-border($width: 1px, $query: feature-targeting.all()) { + $feat-structure: feature-targeting.create-target($query, structure); + + @include dom.forced-colors-mode { + #{$ripple-target} { + @include feature-targeting.targets($feat-structure) { + top: -$width; + left: -$width; + border: $width solid transparent; + } + } + } +} + @mixin high-contrast-focus { // High contrast mode focus for chips. .mdc-chip__focus-ring {