1 of 99

Design Systems 2.0

Creating Consistent User Experiences

Micah Godbolt - @micahgodbolt

2 of 99

Micah Godbolt

Twitter: @micahgodbolt

Book: fea.pub

Slides: bit.ly/designsys2

3 of 99

Where We Left Off

4 of 99

5 of 99

What is a Design System?

6 of 99

7 of 99

8 of 99

This Worked �In Isolation

bit.ly/designsys2

9 of 99

This Worked �In Isolation

  • One Site
  • One Theme
  • One Way Communication

bit.ly/designsys2

10 of 99

And Then I Joined Microsoft

11 of 99

12 of 99

Many Sites

bit.ly/designsys2

13 of 99

Many Themes

bit.ly/designsys2

14 of 99

Many Ways of Communication

bit.ly/designsys2

15 of 99

Making Design Systems Scale

A Story in Two Slides

16 of 99

CSS is easy!

17 of 99

CSS is HARD!!!

18 of 99

bit.ly/designsys2

19 of 99

All Situations

bit.ly/designsys2

20 of 99

One System Multiple Platforms

21 of 99

Values in CSS

.my-button {

background: #0078d7;

color: #fff;

font-size: 16px;

}

.my-button:hover {

background: #004578;

}

22 of 99

Values in Tokens

// Tokens.json

{

"BUTTON_BG_COLOR": "#0078D7",

"BUTTON_TEXT_COLOR": "#FFFFFF",

"BUTTON_FONT_SIZE": "16",

"BUTTON_HOVER_BG_COLOR": "#004578"

}

23 of 99

Values in Tokens

.my-button {

background: $BUTTON_BG_COLOR;

color: $BUTTON_TEXT_COLOR;

font-size: $BUTTON_FONT_SIZE;

}

.my-button:hover {

background: $BUTTON_HOVER_BG_COLOR;

}

24 of 99

One Platform Multiple Systems

Version 5 Component

Version 6 Component

25 of 99

Scoped Styles in Parent Class

26 of 99

Scopes Styles in Parent Class

// v5/my-styles.scss

.cat:after { content: "🐶" }

// v6/my-styles.scss

.cat:after { content: "😻" }

27 of 99

Scoped Styles in Parent Class

// main.scss

.v6 { @import 'v6/my-styles'}

.v5 { @import 'v5/my-styles'}

28 of 99

Scoped Styles in Parent Class

// main.css

.v6 .cat:after { content: "😻" }

.v5 .cat:after { content: "🐶" }

29 of 99

Scoped Styles in Parent Class

<!-- html -->

<div class="v5">

<div class="cat">🐶</div>

</div>

<div class="v6">

<div class="cat">😻</div>

</div>

30 of 99

Scoped Styles in Parent Class

<!-- html -->

<div class="v5">

<div class="cat">🐶</div>

</div>

<div class="v6">

<div class="cat">😻</div>

</div>

31 of 99

Scoped Styles in Parent Class

<!-- html -->

<div class="v5">

<div class="cat">🐶</div>

<div class="v6">

<div class="cat">🐶</div>

<div>

<div>

32 of 99

Class Suffix

33 of 99

Class Suffixes

// v6/my-styles.scss

.cat_v6:after { content: "😻" }

// v5/my-styles.scss

.cat_v5:after { content: "🐶" }

34 of 99

Class Suffixes

<!-- html -->

<div class="v5-component">

<div class="cat_v5">🐶</div>

</div>

<div class="v6-component">

<div class="cat_v6">😻</div>

</div>

35 of 99

Class Suffixes

<!-- html -->

<div class="v5-component">

<div class="cat_v5">🐶</div>

<div class="v6-component">

<div class="cat_v6">😻</div>

</div>

</div>

36 of 99

CSS Modules

bit.ly/designsys2

37 of 99

CSS Modules

// v6/my-styles.scss

.cat:after { content: "😻" }

// v5/my-styles.scss

.cat:after { content: "🐶" }

38 of 99

CSS Modules

// main.js

import v6styles from "./v6/my-styles.scss";

import v5styles from "./v5/my-styles.scss";

39 of 99

CSS Modules

v6Styles = {

'cat': 'cat_9xjso1h'

}

40 of 99

CSS Modules

v6Styles = {

'cat': 'cat_9xjso1h'

}

41 of 99

CSS Modules

document.body.innerHTML = `

<div class=${v6styles.cat}></div>

<div class=${v5styles.cat}></div>

`;

42 of 99

CSS Modules

<!-- html -->

<style>

.cat_9xjso1h:after { content: "😻" }

</style>

<div class="cat_9xjso1h">😻</div>

43 of 99

CSS Modules

<!-- html -->

<style>

.cat_9xjso1h:after { content: "😻" }

.cat_l2n5lh2:after { content: "🐶" }

</style>

<div class="cat_9xjso1h">😻</div>

<div class="cat_l2n5lh2">🐶</div>

44 of 99

All People

bit.ly/designsys2

45 of 99

One Platform Many Themes

46 of 99

CSS Variables

bit.ly/designsys2

47 of 99

CSS Variables

// my-styles.css

:root { --cat: "😻"; }

48 of 99

CSS Variables

// my-styles.css

:root { --cat: "😻"; }

.cat:after { content: var(--cat) }

49 of 99

CSS Variables

document.documentElement.style.setProperty(

'--cat', '"🐶"'

);

50 of 99

CSS Variables

<div class="cat">🐶</div>

51 of 99

CSS Variables

// my-styles.css

.cat:after {

content: "[token:cat, default: 😻]"

}

52 of 99

One Page Many Themes

53 of 99

CSS in JS

bit.ly/designsys2

54 of 99

bit.ly/designsys2

Incoming Pseudo Code!

55 of 99

CSS in JS

let styles= {

background: 'blue',

color: 'white'

}

const Button = <button css={{styles}}>

56 of 99

CSS in JS

<Button>

Click Me

</Button>

57 of 99

CSS in JS

.sjo2hs9 {

background: blue;

color: white;

}

58 of 99

CSS in JS

<button class="sjo2hs9">

Click Me

</button>

59 of 99

CSS in JS

const Button = <button css={{styles, custom}}>

60 of 99

CSS in JS

<Button

custom={background: green}

>

Click Me

</Button>

61 of 99

CSS in JS

.u3lj1uy {

background: green;

color: white;

}

62 of 99

CSS in JS

<button class="sjo2hs9">

Click Me

</button>

<button class="u3lj1uy">

Click Me

</button>

63 of 99

All Sites

bit.ly/designsys2

64 of 99

Some Sites

Like To Talk

bit.ly/designsys2

65 of 99

Some Sites

Like To Talk With You

bit.ly/designsys2

66 of 99

Making Design Systems Conversational

bit.ly/designsys2

67 of 99

Buttons !== Links

bit.ly/designsys2

68 of 99

Links Take You To Other Pages

69 of 99

Buttons Perform Actions On The Page

70 of 99

Buttons Perform Actions On The Page

71 of 99

Buttons Perform Actions On The Page

72 of 99

Buttons Perform Actions On The Page

// Pseudo Code

73 of 99

Buttons Perform Actions On The Page

onSelect:

add(name)

onDeselect:

remove(name)

74 of 99

Buttons Perform Actions On The Page

items = [

email,

notebooks,

themeing

]

75 of 99

Buttons Perform Actions On The Page

onClick:

download(items)

76 of 99

Buttons Perform Actions On The Page

let items=[];

<Button onClick=download(items)>

<ListItem

onSelect = add(item)

onDeselect = remove(item)

>

77 of 99

Interfaces need to be designed

bit.ly/designsys2

78 of 99

My History with Interfaces

79 of 99

My History with Interfaces

ListItem

title

date

quantity

shared

onSelect

onDeselect

80 of 99

My History with Interfaces

Hey Backend Team

Here’s the stuff for the List Item: Title, Date, quantity, shared, onSelect, onDeselect.

I’m on vacation next week. Have fun!

81 of 99

My History with Interfaces

ListItem Docs

title is a string and required

date is a date and required

quantity is a number and not required

shared is either true or false

onSelect is a function that takes…

onDeselect is a function that takes…

82 of 99

My History with Interfaces

ListItem.json (partial list)

props: {

title: { type: string, required: true },

quantity: { type: number, required: false },

shared: { type: boolean, required: false }

}

83 of 99

My History with Interfaces

// TypeScript

interface Item = {

title: string;

quantity?: number;

shared?: boolean;

}

84 of 99

My History with Interfaces

// TypeScript

interface Item = {

title: string;

quantity?: number;

shared?: boolean;

onSelect?: (item: Item, items: Item[]) => void;

}

85 of 99

My History with Interfaces

86 of 99

My History with Interfaces

87 of 99

The Future of Design Systems

bit.ly/designsys2

88 of 99

Is JavaScript

bit.ly/designsys2

89 of 99

Does this mean I need to become a JavaScript Ninja/Rockstar/Unicorn/Pirate/Circus Performer?

bit.ly/designsys2

90 of 99

UI Frameworks

  1. Vue
  2. React
  3. Preact
  4. Web Components (Polymer)

91 of 99

Interface Design

  1. JSON Schema
  2. React Prop Types
  3. TypeScript

92 of 99

CSS in JS - Runtime CSS

  1. Glamor
  2. Glamorous
  3. Aphrodite
  4. Styled Components

93 of 99

JavaScript isn’t replacing �HTML and CSS

94 of 99

JavaScript isn’t replacing �HTML and CSS

It’s making the HTML and CSS in our Design Systems �more powerful

95 of 99

We don’t have to quit doing what we love to learn JavaScript

96 of 99

We don’t have to quit doing what we love to learn JavaScript

We need to the find ways that JavaScript can power the things we love

97 of 99

We don’t need more JavaScript Devs

98 of 99

We don’t need more JavaScript Devs

We need more JavaScript empowered

Front-end Devs

99 of 99

Thankyou!

bit.ly/designsys2