Skip to content

Commit

Permalink
feat(ripple): add active() mixin for styling active styles.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 359173960
  • Loading branch information
EstebanG23 authored and copybara-github committed Feb 24, 2021
1 parent 9c85d50 commit 9f2e85f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/mdc-ripple/_ripple-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -394,15 +394,23 @@ $pressed-light-ink-opacity: 0.32 !default;
}
}

// Selector for focus state. Using ':not(.mdc-ripple-upgraded)' to control focus
// when JS-enabled with '.mdc-ripple-upgraded--background-focused'.
// Selector for focus state. Using ':not(.mdc-ripple-upgraded)' to continue
// applying focus styles on JS-disabled components, and control focus
// on JS-enabled components with '.mdc-ripple-upgraded--background-focused'.
@mixin focus() {
&.mdc-ripple-upgraded--background-focused,
&:not(.mdc-ripple-upgraded):focus {
@content;
}
}

// Selector for active state. Using `:active:active` to override focus styles.
@mixin active() {
&:active:active {
@content;
}
}

/// Keep the ripple (State overlay) behind the content.
@mixin behind-content(
$ripple-target,
Expand Down

0 comments on commit 9f2e85f

Please sign in to comment.