Course lesson

Use Sass Mixins to Style Inputs with Accessible Contrast and Keyboard Access

We'll begin to apply our theme styles for our text inputs by creating the .form-field component. We'll make use of the Sass feature of "mixins" to create :focus and :disabled styles that can be reused. While creating the :focus and :disabled states we'll...

Duration
7 min
Access
Pro
Transcript
Available

We'll begin to apply our theme styles for our text inputs by creating the .form-field component. We'll make use of the Sass feature of "mixins" to create :focus and :disabled styles that can be reused. While creating the :focus and :disabled states we'll discuss the importance of contrast and keyboard access for accessibility.

An important take-away is that you need at least a 3:1 contrast ratio between your border and background AS WELL AS a 3:1 contrast ratio between your border and focus state.