22
33<!-- *
44# Document freshness: For more information, see go/fresh-source.
5- freshness: { owner: 'lizmitchell' reviewed: '2023-05-08 ' }
5+ freshness: { owner: 'lizmitchell' reviewed: '2023-05-23 ' }
66tag: 'docType:reference'
77*-->
88
@@ -28,6 +28,8 @@ to determine when they are visible.
2828Focus rings display on keyboard navigation. They may be attached to a control in
2929one of three ways.
3030
31+ ![ An element with a focus ring.] ( images/focus/usage.gif " A focus ring. ")
32+
31331 . Attached to the parent element
3234
3335 ``` html
@@ -79,15 +81,36 @@ one of three ways.
7981
8082> Note: focus rings must be placed within a `position: relative` container.
8183
84+ ### Inward
85+
86+ Focus rings can be changed to animate inwards by adding an `inward` attribute.
87+ This is useful for components like list items.
88+
89+ 
90+
91+ ```html
92+ <style >
93+ .container {
94+ position : relative ;
95+ --md-focus-ring-shape : 8px ;
96+ }
97+ </style >
98+ <button class =" container" >
99+ <md-focus-ring inward ></md-focus-ring >
100+ </button >
101+ ```
102+
82103### Animation
83104
84105The focus ring animation may be customized or disabled using CSS custom
85106properties.
86107
108+ ![ An element with a focus ring that does not animate.] ( images/focus/usage-animation.gif " A focus ring with disabled animations. ")
109+
87110``` html
88111<style >
89112 :root {
90- --md-focus-ring-duration : 0 ; /* disabled animation */
113+ --md-focus-ring-duration : 0 s ; /* disabled animation */
91114 }
92115 </style >
93116```
@@ -107,7 +130,6 @@ terms of color and shape.
107130Token | Default value
108131------------------------ | --------------------------
109132` --md-focus-ring-color ` | ` --md-sys-color-secondary `
110- ` --md-focus-ring-offset ` | ` 2px `
111133` --md-focus-ring-shape ` | ` 9999px `
112134` --md-focus-ring-width ` | ` 3px `
113135
@@ -116,13 +138,14 @@ Token | Default value
116138
117139### Example
118140
119- ![ Image of a focus ring with a different theme applied] ( images/focus/theming.png " Focus ring theming example. ")
141+ ![ Image of a focus ring with a different theme applied] ( images/focus/theming.gif " Focus ring theming example. ")
120142
121143``` html
122144<style >
123145:root {
124146 --md-focus-ring-shape : 0px ;
125147 --md-focus-ring-width : 2px ;
148+ --md-focus-ring-active-width : 4px ;
126149 --md-sys-color-secondary : #4A6363 ;
127150}
128151 </style >
0 commit comments