9
9
@use ' ./focus-ring-shared-theme' ;
10
10
11
11
$_custom-property-prefix : ' focus-ring-inward' ;
12
+ $_ring-extra-offset-bottom-key : ' extra-offset-bottom' ;
13
+
14
+ $default-inward-theme : map .merge (
15
+ focus-ring-shared-theme .$default-shared-theme ,
16
+ (
17
+ // Extra offset to bottom of focus ring in addition to default ring offset
18
+ $_ring-extra-offset-bottom-key : 0px
19
+ )
20
+ );
12
21
13
22
/// Generates CSS custom properties that are consumed by the focus ring styles.
14
23
/// Intended to be used directly by Material Design customers, as the only
15
24
/// formally supported means of customizing the focus ring.
16
25
///
17
- /// @param {Map} $theme - A map with one or more of the keys of $default-theme.
26
+ /// @param {Map} $theme - A map with one or more of the keys of $default-inward- theme.
18
27
@mixin theme ($theme ) {
19
- $theme : validate .theme (focus-ring-shared-theme . $default-theme , $theme );
28
+ $theme : validate .theme ($default-inward -theme , $theme );
20
29
@include keys .declare-custom-properties ($theme , $_custom-property-prefix );
21
30
}
22
31
23
- @mixin theme-styles ($theme : focus-ring-shared-theme . $default-theme ) {
24
- $theme : validate .theme-styles (focus-ring-shared-theme . $default-theme , $theme );
32
+ @mixin theme-styles ($theme : $default-inward -theme ) {
33
+ $theme : validate .theme-styles ($default-inward -theme , $theme );
25
34
$theme : keys .create-theme-vars ($theme , $_custom-property-prefix );
26
35
27
36
$ring-color : map .get ($theme , focus-ring-shared-theme .$ring-color-key );
28
37
$ring-offset : map .get ($theme , focus-ring-shared-theme .$ring-offset-key );
38
+ $ring-extra-offset-bottom : map .get ($theme , $_ring-extra-offset-bottom-key );
29
39
$track-width : map .get ($theme , focus-ring-shared-theme .$track-width-key );
30
40
$target-shape : map .get ($theme , focus-ring-shared-theme .$target-shape-key );
31
41
@@ -34,7 +44,8 @@ $_custom-property-prefix: 'focus-ring-inward';
34
44
/// https://screenshot.googleplex.com/3cYw8Pi8WQNa3h8.png
35
45
border : $track-width solid $ring-color ;
36
46
border-radius : calc ($target-shape + $track-width + $ring-offset );
37
- inset-block : calc (-1 * ($ring-offset + $track-width ));
47
+ inset-block : calc (-1 * ($ring-offset + $track-width ))
48
+ calc (-1 * ($ring-offset + $track-width + $ring-extra-offset-bottom ));
38
49
inset-inline : calc (-1 * ($ring-offset + $track-width ));
39
50
40
51
@include _focus-ring-animation-keyframes ();
0 commit comments