with styled-system
@TaleyaMirza
@TaleyaMirza
* Most common design system challenges
* How styled-system helps to solve them
* The three tenets of styled-system
Sastaticket.pk acquired a software consultancy Recurship
A CMS configured at the website
Flight Booking App (in process)
Brand Identity
Ensure Consistent UIs
Theming Control
Reduce Development Efforts
Design
Build the base of design system
Text, Buttons, Badges, Inputs
Documentation and visual customization of components
Run a pilot test
along with our baby design system
Dialog boxes, Cards, Accordions, Tables
More props, more customizable components
Refactoring often occurs in processes... to build consistent UIs
We cannot handle more customization in a built one, because it can break other UIs
That's OK
Not a big deal.. it'll be smooth over time
We are trying our best!
There comes some pressure!
Fast, Fast .... Fast!
Almost over six months
Three types of cards (visually same)
Two Links, Two Buttons, Two Types of Image Components
Multiple layout usage
Theme was lost
Different spacings
Hard coded values
Different dev practices
Refactoring was taking more time than creating new ones
Thus, Developers losing interest in design systems
as delivering features has to be fast as possible
Put a break on product
Problems
Product team, designers and developers identified those and started plan for a v2
Problems
We have to fix our constraints and provide a minimal flexibility
Problems
Just theming doesn't work here
We explored
To build consistent UIs faster
BRENT JACKSON - @jxnblk
Style props that pick up values from a global theme
Apply styles responsively across breakpoints
To build consistent UIs faster
Style props that pick up values from a global theme
Apply styles responsively across breakpoints
BRENT JACKSON - @jxnblk
Theme object is centered around the idea of scales
// example fontSizes scale as an array
fontSizes: [12, 14, 16, 20, 24, 32]
// example colors object
colors: {
blue: '#07c',
green: '#0fa',
}
// aliases
fontSizes.body = fontSizes[2]
fontSizes.display = fontSizes[5]
To build consistent UIs faster
Style props that pick up values from a global theme
Apply styles responsively across breakpoints
BRENT JACKSON - @jxnblk
// theme.js
export default {
space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
}
//Box Component
import styled from 'styled-components'
import { space } from 'styled-system'
const Box = styled.div`
${space}
`
export default Box
//Usage and flexibility to add custom values
<Box m={2} p={13} >
Tomato
</Box>
Gives us a minimal flexibility too
To build consistent UIs faster
Style props that pick up values from a global theme
Apply styles responsively across breakpoints
BRENT JACKSON - @jxnblk
.Box-hash {
width: 100%;
}
@media screen and (min-width: 40em) {
.Box-hash {
width: 50%;
}
}
@media screen and (min-width: 52em) {
.Box-hash {
width: 25%;
}
}
<Box width={[1, 1 / 2, 1 / 4]} />
// theme.js
const breakpoints = ['40em', '52em', '64em', '80em']
// aliases
breakpoints.sm = breakpoints[0]
breakpoints.md = breakpoints[1]
breakpoints.lg = breakpoints[2]
breakpoints.xl = breakpoints[3]
export default {
breakpoints,
}
<Box width={{ _: 1, sm: 1, md: 1 / 2, lg: 1 / 4 }} />
To build consistent UIs faster
Style props that pick up values from a global theme
Apply styles responsively across breakpoints
BRENT JACKSON - @jxnblk
We got a really strong base
A design system’s value is realized when products ship features using parts from the system.
- Nathan Curtis
Libraries built with the foundation of styled-system
You can also use them as a base library, the best thing about styled-system is it's not framework specific
but it can definitely help us leveling up our design system
by providing a strong base for our design system
Here’s the simple truth: you can’t innovate on products without first innovating the way you build them.
- Alex Schleifer, Airbnb
We found styled-system amazing
You can also try it out.. !
@TaleyaMirza
#design-systems