Using Design Tokens to up your Accessibility Game

A presentation at a11yTO Meetup in November 2023 in Toronto, ON, Canada by Karen Hawkins

Slide 1

Slide 1

Using Design Tokens to up your Accessibility Game Karen Hawkins November 9, 2023

Slide 2

Slide 2

Meet Karen Hawkins Karen Hawkins, CPACC Connect with me Get today’s slides Principal of Accessible Design, Email Deck on notist Level Access LinkedIn https://noti.st/khawk27 2

Slide 3

Slide 3

Today’s Goals

  1. Learn what types of design token decisions affect the accessibility of UI (User Interface) elements.
  2. Learn how to use design tokens to improve the accessibility of UI elements.
  3. Understand the importance of using design tokens to ensure a consistent experience across a wide set of UI elements. 3

Slide 4

Slide 4

SECTION 1 Little Ditty about Design and Designs Systems 4

Slide 5

Slide 5

A design system is a complete set of standards intended to manage design at scale using reusable components and patterns. Nielsen Norman Group 5

Slide 6

Slide 6

A design system is a complete set of standards intended to manage design at scale using reusable components and patterns. Nielsen Norman Group 6

Slide 7

Slide 7

Consistency Efficiency Scale 7

Slide 8

Slide 8

Design System Composition A design system is comprised of reusable design elements, reusable coded elements, and their documentation.

  • Design
  • Code Documentation 8

Slide 9

Slide 9

Zeroheight Knapsack InVision DSM Supernova Popular Design System Programs 9

Slide 10

Slide 10

Design Systems are Ecosystems of Design and Development Artifacts Figma Assets Design System Program Storybook Assets 10

Slide 11

Slide 11

Style Guide Examples 11

Slide 12

Slide 12

Component Library Examples 12

Slide 13

Slide 13

Pattern Library Examples 13

Slide 14

Slide 14

Atomic Design Atomic design is a methodology for creating design systems. It is a framework to break interfaces down into fundamental reusable building blocks and build them back up in potentially infinite variations. Atoms Concept reference: Brad Frost Molecules Organisms Templates Pages 14

Slide 15

Slide 15

Atomic Design Example Atoms Molecules Organism 15

Slide 16

Slide 16

Atomic Breakdown of a Button Atoms Molecule 16

Slide 17

Slide 17

Atomic Breakdown of a Button: Further Analysis Atoms Properties Molecule Font Type Font Size Text Color Padding Border Color Border Size Border Corners Button Fill 17

Slide 18

Slide 18

Subatomic Design Design tokens are small, repeatable design decisions, that store a design system’s visual attributes. They ensure the same style values are used across design files and code. Subatomic Particles Atoms Molecules Organisms Templates Pages 18

Slide 19

Slide 19

Subatomic Breakdown of a Button Atoms Properties / Design Tokens Molecule Font Type: body-copy-semi-bold Font Size: body-copy-semi-bold Text Color: interactive Padding: spacing-10 Border Color: interactive Border Size: border-2 Border Corners: border-radius-2 Button Fill: color-background-light 19

Slide 20

Slide 20

Design Systems Tend to be Incomplete Molecular Variations and States Molecule 20

Slide 21

Slide 21

Design Tokens Fill Some of the Gap Design Tokens Molecular States Border Color: color-text-dark Molecule Border Size: border-1 Border Color: color-focus Border Size: border-3 Border Color: color-error Border Size: border-3 21

Slide 22

Slide 22

Remaining Gaps are Filled with Other Aspects of Design and Documentation Other Elements Molecular States Molecule Error message with icon 22

Slide 23

Slide 23

Style Guides Map to Atoms and Subatomic Particles Focus on design tokens 23

Slide 24

Slide 24

Components Map to Molecules Focus on foundational aspects: • States • Variations • Keyboard interactions • Screen reader experiences • Etc. 24

Slide 25

Slide 25

Patterns Map to Organisms Focus on higher order thinking: • Reading order • Landmarks • Skip links • Interdependencies between multiple components • Etc. 25

Slide 26

Slide 26

Questions? Comments? 26

Slide 27

Slide 27

SECTION 2 Design Tokens in Style Guides 27

Slide 28

Slide 28

Colours 28

Slide 29

Slide 29

Grid 29

Slide 30

Slide 30

Typography 30

Slide 31

Slide 31

Spacing 31

Slide 32

Slide 32

Border Thickness 32

Slide 33

Slide 33

Border Radius 33

Slide 34

Slide 34

Shadow 34

Slide 35

Slide 35

Grid Accessibility 1.4.10: Reflow • 400% zoom: 1280 / 4 = 320 • Mobile designs are on a 320px viewport for vertically scrolling content • Or 1024 / 4 = 256 for horizontally scrolling content • Benefits: • Ensures a design for 1 column of content • Enforces designing responsively / for mobile (1.3.4 Orientation) 35

Slide 36

Slide 36

Typography Accessibility Best Practices • Font type: Selected for perceived readability • Min font size: 12pt / 16px / 1 REM • Body copy font weight: Regular / 400 • Body copy line height: 1.5X font size • Heading font weight: Semi-bold / 600 1.4.4 Resize Text • 200% font size: 24pt / 32px / 2 REM • 200% line height: 3X font size 36

Slide 37

Slide 37

Spacing Accessibility 2.5.8 Target Size (Minimum) • Minimum target size for icons: 24px X 24px Best Practices • Aiming for 44px X 44px (2.5.5 Target Size) • Considerations for contextual spacing requirements for improved operability and readability 37

Slide 38

Slide 38

Colour Accessibility (1 / 2) Best Practices • Documented colour pairs that meet minimum standards with guidelines for usage • No placeholder text (1.4.3 Minimum Contrast, 3.3.2. Labels or Instructions) • No images of text (1.4.3 Minimum Contrast) 38

Slide 39

Slide 39

Colour Accessibility (2 / 2) 1.4.1 Use of Colour Contrast • • Not using colour alone to indicate meaning, information, etc. • Particular attention to state design and chart design • Inline links underlined by default • Using at least 1 dimension to convey meaning, with or without the addition of colour Aiming for greater than 7:1 contrast for text (1.4.6 Contrast Enhanced) • Aiming for greater than 4.5:1 contrast for graphical objects and user interface components (1.4.11 Non-Text Contrast) • Aiming for greater than 3:1 contrast for inactive elements (1.4.3 Minimum Contrast) 1.3.3 Sensory Characteristics • Not using colour alone to indicate meaning, information, etc. in instructions 39

Slide 40

Slide 40

Sidebar: Dual Modality Design Colour Position Read means stop. Top means stop. Yellow means slow down. Middle means slow down. Green means go. Bottom means go. 40

Slide 41

Slide 41

Focus Indicator Accessibility Best Practices • Focus indicator is always situated outside an element • Focus indicator is made of 3 rings which meets contrast requirements between the rings (white, medium pink, white) • Each ring is 2px thick (2.4.13 Focus Appearance) • Contrast is guaranteed with any adjacent colour in our design system 41

Slide 42

Slide 42

Questions? Comments? 42

Slide 43

Slide 43

SECTION 3 Design Tokens in Component Libraries 43

Slide 44

Slide 44

Components Map to Molecules Design tokens help with: • State design • Variation design 44

Slide 45

Slide 45

Primary Button Design Token Example Font Type: body-copy-semi-bold Font Size: body-copy-semi-bold Text Color: color-text-light Padding: spacing-10 Border Color: interactive Border Size: border-2 Border Corners: border-radius-2 Button Fill: color-background-interactive 45

Slide 46

Slide 46

Primary Button Design Token Example Font Type: body-copy-semi-bold Font Size: body-copy-semi-bold Text Color: color-text-light Padding: spacing-10 Border Color: interactive Border Size: border-2 Border Corners: border-radius-2 Button Fill: color-background-interactive 46

Slide 47

Slide 47

State Change Design Examples Hover • Background colour change (token) • Underlined Focus • Background colour change (token) • Underlined • Focus indicator Inactive • Background colour change (token) Default 47

Slide 48

Slide 48

Hover State Options: Colour-Only Default Options 48

Slide 49

Slide 49

Hover State Options: Underline, Bold Text, Larger Text, Smaller Text Default Options 49

Slide 50

Slide 50

Hover State Options: Button Size Default Options 50

Slide 51

Slide 51

Hover State Options: Invert Colours Default Options 51

Slide 52

Slide 52

Hover State Options: Thick Lines Default Options 52

Slide 53

Slide 53

Hover State Options: Border Thickness Default Options 53

Slide 54

Slide 54

Hover State Options: Border Radius Default Options 54

Slide 55

Slide 55

Hover State Options: Shadows Default Options 55

Slide 56

Slide 56

Hover State Options: Animation Default Options 56

Slide 57

Slide 57

Versions Consider the Variations Types Mobile 200% and Long Text 57

Slide 58

Slide 58

Default Hover Focus Apply Design Decisions to Links 58

Slide 59

Slide 59

Default Hover Focus Inactive Error Apply Design Decisions to Other Elements 59

Slide 60

Slide 60

Why is consistency so important? 60

Slide 61

Slide 61

Consistency is Key to Usability Usability Quality Attributes Consistency Experiences Are • Learnability • Easy to learn • Memorability • Easy to remember • Efficiency • Efficient • Error Tolerance • Error tolerant • Satisfaction • Pleasant to use Concept reference: Usability 101 - Introduction to Usability 61

Slide 62

Slide 62

Sidebar: Design Consistency Across Device Usage Pointer / Hover Keyboard / Focus 62

Slide 63

Slide 63

Design System Inheritance 63

Slide 64

Slide 64

Design System Layer Cake Inheritance Concept reference: The Design System Ecosystem 64

Slide 65

Slide 65

Inheritance Examples Parent Child 1 Child 2 Child 3 65

Slide 66

Slide 66

Patterns Map to Organisms Design tokens help with: • ? 66

Slide 67

Slide 67

Questions? Comments? 67

Slide 68

Slide 68

Slides, Contact Details, and a Guide Connect with me Get today’s slides Get agile design guide Email and LinkedIn Deck on notist Downloadable document Karen Hawkins, CPACC https://noti.st/khawk27 Accessibility in the design process 68

Slide 69

Slide 69

Thank you Karen Hawkins karen.hawkins@levelaccess.com levelaccess.com