SlideShare a Scribd company logo
BUILDING A THEMING
SYSTEM WITH REACT
MATTEO RONCHI
@CEF62 GITHUB/CEF62
SENIOR SOFTWARE ENGINEER AT WORKWAVE
FEVR COMMUNITY LEADER
TODAY'S WEB IS ALL ABOUT
COMPONENT-BASED
ARCHITECTURES
WHY COMPONENTS?
> Modular
> Scalable
> Extensible
> Reusable
> Encapsulated
COMPONENTIZATION ENABLES
HIGHER ORDER COMPONENTS
HOCS ALLOW ABSTRACTION OF
REUSABLE AUGMENTATIONS
MANY WAYS TO
STYLE COMPONENTS
PLAIN CSS
Web pages load Cascading Style Sheets
to learn how to render HTML elements
.red-button {
color: red;
}
<button class="red-button">Red</button>
CSS-Modules
Allow per-component css rules
greatly improving components portability
.redButton { color: red; }
import css from './styles.css'
const comp = () => <button className={css.redButton}>Red</button>
<!-- HTML output -->
<button class="red_button_7655465hgfhyoda4567">Red</button>
Inline Styles
Component styling without using CSS
Making it really easy to dynamically change the visual
output based on a component's state
const redButton { color: 'red' }
const comp = () => <button style={redButton}>Red</button>
Runtime Generated CSS
In recent years CSS-in-JS continued to grow and evolve.
The current state of the art is expressed by libraries as
> Styled Components
> Aphrodite
> Styletron
> Glamour
Those libraries dynamically define CSS rules
using Javascript, JSON or CSS syntaxes.
Generated CSS classes are injected
at runtime into the web page.
COMPONENTS THEMING
In UI development theming is the definition
of reusable sets of visual styles,
aiming to create consistency across views
UI Theming can be done in
so many different ways
mostly depending
on per-project requirements
COLOR PALETTESTHE SIMPLEST WAY TO KEEP CONSISTENCY ACROSS VIEWS AND COMPONENTS
@nice-blue: #5B83AD;
@light-blue: #98C7F9;
@small: 0.6rem;
@big: 1.3rem;
#header {
color: @light-blue;
font-size: @big;
}
#footer {
color: @nice-blue;
font-size: @small;
}
PROPS DRIVEN STYLESGREATER CUSTOMIZATION AND EASE TO CREATE DYNAMIC STYLES DEFINITION
const theme = {
niceBlue: '#5B83AD', lightBlue: '#98C7F9',
small: '0.6rem', normal: '1rem',
}
const bgStyle = (props) => props.isFooter ? props.theme.lightBlue : props.theme.niceBlue
const fontStyle = (props) => props.isFooter ? props.theme.small : props.theme.normal
// styled-components
const Button = styled.div`
backgroundColor: ${bgStyle};
border: 2px solid ${fontStyle};
`
Color Palettes and Props Driven Styles are great
but we - at WorkWave -
looked for something different
> change the whole theme at runtime
> support WYSIWYG
> decouple component UI definition from UI styling
> easy implementable theme variations
> support theme variations per-component branches
> be agnostic on how to create the final output
> support component-based and atomic-css approaches
WORKWAVE THEME-MANAGER
The Theme-Manager is responsible for sharing themes
It's possible to subscribe to be notified of theme changes,
enabling a set of components
to update consistently in a easy and transparent way
A THEME DEFINES TWO MAIN FIELDS:
styles a map of categories. Each category is a map
of css classes in Javascript notation
presets a map of presets, each preset is used to
programmatically override the main theme definition
const source = {
// Main theme
styles: {
Button: {
button: {
backgroundColor: 'lightpink',
color: 'blue',
padding: '0.6em',
fontWeight: 800,
},
},
},
presets: {
// dark style variation
dark: {
Button: {
button: {
backgroundColor: 'violet',
color: 'white',
},
},
},
},
}
const appTheme = theme(source)
const source = {
// Main theme
styles: {
colors: {
normal: { color: 'blue' },
confirm: { color: 'red' },
},
backgrounds: {
normal: { backgroundColor: 'lightpink' },
confirm: { backgroundColor: 'lightgreen' },
},
},
presets: {
// dark style variation
dark: {
colors: {
normal: { color: 'white' },
confirm: { color: 'yellow' },
},
backgrounds: {
normal: { backgroundColor: 'violet' },
confirm: { backgroundColor: 'darkgreen' },
},
}.
},
}
const appTheme = theme(source)
A Themed Component expects to receive
a map of css classes as a prop
Knowing how to apply those css classes
to its internal implementation.
REACT BINDINGS
<ThemeProvider />
Makes available a theme-Manager instance
to every descendant
A theme-Manager instance can also be passed
as a prop to every themed component
connectTheme()
A HoC connecting a React component to
a themeManager instance
connectTheme(config, mapThemeToProps, options)(DecoratedComponent)
A themed component declares which
theme categories it's interested in,
and a map-Theme-To-Props function
const config = { types: ['Header'] }
const mapThemeToProps = ({ Header: { wrapper, label } }) => ({ wrapper, label })
const themedHeader = connectTheme(config, mapThemeToProps)(Header)
The decorated component will receive
a css prop containing all generated css classes
const Header = ({ css, title }) =>
<div className={css.wrapper}>
<div className={css.label}>{title}</div>
</div>
mapThemeToProps is where you are in control
mapThemeToProps(theme, props) -> composed styles
const mapThemeToProps = (theme) => {
const { colors, backgrounds } = theme
return {
wrapper: { ...backgrounds.normal },
normalBtn: { ...colors.normal, ...backgrounds.normal },
confirmBtn: { ...colors.confirm, ...backgrounds.confirm },
}
}
const DecoratedComponent = ({ css }) =>
<div className={css.wrapper}>
<button className={css.normalBtn}>Do Something</button>
<button className={css.confirmBtn}>Are You Sure?</button>
</div>
const mapThemeToProps = (theme, props) => {
const { colors, backgrounds, disabled } = theme
const { canConfirm } = props
const normalDisabled = canConfirm ? disabled.normal : {}
const confirmDisabled = canConfirm ? disabled.normal : {}
return {
wrapper: { ...backgrounds.normal },
normalBtn: { ...colors.normal, ...backgrounds.normal, ...normalDisabled },
confirmBtn: { ...colors.confirm, ...backgrounds.confirm, ...confirmDisabled },
}
}
const DecoratedComponent = ({ css }) =>
<div className={css.wrapper}>
<button className={css.normalBtn}>Do Something</button>
<button className={css.confirmBtn}>Are You Sure?</button>
</div>
The decorated component's interaction with the theme
is customizable using the theme-Params prop
preset: a theme preset to be applied to
the component branch.
theme-Name: changes the active theme
for the component branch.
overrides: a local overrides to the style object
passed to the map-Theme-To-Props.
const themeParams = {
preset: 'dark',
overrides: {
colors: {
normal: {
color: 'white',
fontWeight: 'bold',
},
},
backgrounds: {
normal: {
backgroundColor: 'black',
},
},
}
}
const Comp = () => <MyThemedComp themeParams={themeParams} />
PLUGIN BASED
OUTPUT ENGINE
The map of styles returned by
map-Theme-To-Props is passed through a compiler
We use aphrodite to generate CSS but the engine
is configurable on per-component basis
Performances Matters
Every themed component uses memoization
and strict equality checks to ensure
the compiler is invoked as little as possible
Room for improvements
The code boilerplate required to create reusable
variations of a themed component feels excessive
Declaration of expected
theme categories could be more flexible
mronchi at workwave dot com
THANKS!
@CEF62

More Related Content

Viewers also liked

Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...
Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...
Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...
Codemotion
 
Reactive MVP - Giorgio Natili - Codemotion Rome 2017
Reactive MVP - Giorgio Natili - Codemotion Rome 2017Reactive MVP - Giorgio Natili - Codemotion Rome 2017
Reactive MVP - Giorgio Natili - Codemotion Rome 2017
Codemotion
 
Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017
Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017
Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017
Codemotion
 
Does Your Web App Speak Schadenfreude? - Greg Rewis - Codemotion Rome 2017
Does Your Web App Speak Schadenfreude? - Greg Rewis - Codemotion Rome 2017Does Your Web App Speak Schadenfreude? - Greg Rewis - Codemotion Rome 2017
Does Your Web App Speak Schadenfreude? - Greg Rewis - Codemotion Rome 2017
Codemotion
 
Community in a nutshell for developers - Alessio Fattorini - Codemotion Rome ...
Community in a nutshell for developers - Alessio Fattorini - Codemotion Rome ...Community in a nutshell for developers - Alessio Fattorini - Codemotion Rome ...
Community in a nutshell for developers - Alessio Fattorini - Codemotion Rome ...
Codemotion
 
Webhooks do's and dont's: what we learned after integrating +100 APIs - Giuli...
Webhooks do's and dont's: what we learned after integrating +100 APIs - Giuli...Webhooks do's and dont's: what we learned after integrating +100 APIs - Giuli...
Webhooks do's and dont's: what we learned after integrating +100 APIs - Giuli...
Codemotion
 
Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017
Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017
Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017
Codemotion
 
Handle insane devices traffic using Google Cloud Platform - Andrea Ulisse - C...
Handle insane devices traffic using Google Cloud Platform - Andrea Ulisse - C...Handle insane devices traffic using Google Cloud Platform - Andrea Ulisse - C...
Handle insane devices traffic using Google Cloud Platform - Andrea Ulisse - C...
Codemotion
 
Galateo semi-serio dell'Open Source - Luigi Dell' Aquila - Codemotion Rome 2017
Galateo semi-serio dell'Open Source -  Luigi Dell' Aquila - Codemotion Rome 2017Galateo semi-serio dell'Open Source -  Luigi Dell' Aquila - Codemotion Rome 2017
Galateo semi-serio dell'Open Source - Luigi Dell' Aquila - Codemotion Rome 2017
Codemotion
 
Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...
Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...
Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...
Codemotion
 
Component-Based UI Architectures for the Web - Andrew Rota - Codemotion Rome...
Component-Based UI Architectures for the Web  - Andrew Rota - Codemotion Rome...Component-Based UI Architectures for the Web  - Andrew Rota - Codemotion Rome...
Component-Based UI Architectures for the Web - Andrew Rota - Codemotion Rome...
Codemotion
 
Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...
Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...
Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...
Codemotion
 
Pronti per la legge sulla data protection GDPR? No Panic! - Domenico Maracci,...
Pronti per la legge sulla data protection GDPR? No Panic! - Domenico Maracci,...Pronti per la legge sulla data protection GDPR? No Panic! - Domenico Maracci,...
Pronti per la legge sulla data protection GDPR? No Panic! - Domenico Maracci,...
Codemotion
 
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Be...
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark  - Demi Be...S3, Cassandra or Outer Space? Dumping Time Series Data using Spark  - Demi Be...
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Be...
Codemotion
 
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017
Codemotion
 
The busy developer guide to Docker - Maurice de Beijer - Codemotion Rome 2017
The busy developer guide to Docker - Maurice de Beijer - Codemotion Rome 2017The busy developer guide to Docker - Maurice de Beijer - Codemotion Rome 2017
The busy developer guide to Docker - Maurice de Beijer - Codemotion Rome 2017
Codemotion
 
Web Based Virtual Reality - Tanay Pant - Codemotion Rome 2017
Web Based Virtual Reality - Tanay Pant - Codemotion Rome 2017Web Based Virtual Reality - Tanay Pant - Codemotion Rome 2017
Web Based Virtual Reality - Tanay Pant - Codemotion Rome 2017
Codemotion
 
Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...
Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...
Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...
Codemotion
 
Docker Inside/Out: the ‘real’ real-world of stacking containers in production...
Docker Inside/Out: the ‘real’ real-world of stacking containers in production...Docker Inside/Out: the ‘real’ real-world of stacking containers in production...
Docker Inside/Out: the ‘real’ real-world of stacking containers in production...
Codemotion
 
Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017
Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017
Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017
Codemotion
 

Viewers also liked (20)

Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...
Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...
Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...
 
Reactive MVP - Giorgio Natili - Codemotion Rome 2017
Reactive MVP - Giorgio Natili - Codemotion Rome 2017Reactive MVP - Giorgio Natili - Codemotion Rome 2017
Reactive MVP - Giorgio Natili - Codemotion Rome 2017
 
Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017
Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017
Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017
 
Does Your Web App Speak Schadenfreude? - Greg Rewis - Codemotion Rome 2017
Does Your Web App Speak Schadenfreude? - Greg Rewis - Codemotion Rome 2017Does Your Web App Speak Schadenfreude? - Greg Rewis - Codemotion Rome 2017
Does Your Web App Speak Schadenfreude? - Greg Rewis - Codemotion Rome 2017
 
Community in a nutshell for developers - Alessio Fattorini - Codemotion Rome ...
Community in a nutshell for developers - Alessio Fattorini - Codemotion Rome ...Community in a nutshell for developers - Alessio Fattorini - Codemotion Rome ...
Community in a nutshell for developers - Alessio Fattorini - Codemotion Rome ...
 
Webhooks do's and dont's: what we learned after integrating +100 APIs - Giuli...
Webhooks do's and dont's: what we learned after integrating +100 APIs - Giuli...Webhooks do's and dont's: what we learned after integrating +100 APIs - Giuli...
Webhooks do's and dont's: what we learned after integrating +100 APIs - Giuli...
 
Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017
Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017
Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017
 
Handle insane devices traffic using Google Cloud Platform - Andrea Ulisse - C...
Handle insane devices traffic using Google Cloud Platform - Andrea Ulisse - C...Handle insane devices traffic using Google Cloud Platform - Andrea Ulisse - C...
Handle insane devices traffic using Google Cloud Platform - Andrea Ulisse - C...
 
Galateo semi-serio dell'Open Source - Luigi Dell' Aquila - Codemotion Rome 2017
Galateo semi-serio dell'Open Source -  Luigi Dell' Aquila - Codemotion Rome 2017Galateo semi-serio dell'Open Source -  Luigi Dell' Aquila - Codemotion Rome 2017
Galateo semi-serio dell'Open Source - Luigi Dell' Aquila - Codemotion Rome 2017
 
Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...
Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...
Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...
 
Component-Based UI Architectures for the Web - Andrew Rota - Codemotion Rome...
Component-Based UI Architectures for the Web  - Andrew Rota - Codemotion Rome...Component-Based UI Architectures for the Web  - Andrew Rota - Codemotion Rome...
Component-Based UI Architectures for the Web - Andrew Rota - Codemotion Rome...
 
Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...
Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...
Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...
 
Pronti per la legge sulla data protection GDPR? No Panic! - Domenico Maracci,...
Pronti per la legge sulla data protection GDPR? No Panic! - Domenico Maracci,...Pronti per la legge sulla data protection GDPR? No Panic! - Domenico Maracci,...
Pronti per la legge sulla data protection GDPR? No Panic! - Domenico Maracci,...
 
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Be...
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark  - Demi Be...S3, Cassandra or Outer Space? Dumping Time Series Data using Spark  - Demi Be...
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Be...
 
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017
 
The busy developer guide to Docker - Maurice de Beijer - Codemotion Rome 2017
The busy developer guide to Docker - Maurice de Beijer - Codemotion Rome 2017The busy developer guide to Docker - Maurice de Beijer - Codemotion Rome 2017
The busy developer guide to Docker - Maurice de Beijer - Codemotion Rome 2017
 
Web Based Virtual Reality - Tanay Pant - Codemotion Rome 2017
Web Based Virtual Reality - Tanay Pant - Codemotion Rome 2017Web Based Virtual Reality - Tanay Pant - Codemotion Rome 2017
Web Based Virtual Reality - Tanay Pant - Codemotion Rome 2017
 
Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...
Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...
Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...
 
Docker Inside/Out: the ‘real’ real-world of stacking containers in production...
Docker Inside/Out: the ‘real’ real-world of stacking containers in production...Docker Inside/Out: the ‘real’ real-world of stacking containers in production...
Docker Inside/Out: the ‘real’ real-world of stacking containers in production...
 
Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017
Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017
Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017
 

Similar to Building a theming system with React - Matteo Ronchi - Codemotion Rome 2017

Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Codemotion
 
Front-End Methodologies
Front-End MethodologiesFront-End Methodologies
Front-End Methodologies
Arash Manteghi
 
Start your app the better way with Styled System
Start your app the better way with Styled SystemStart your app the better way with Styled System
Start your app the better way with Styled System
Hsin-Hao Tang
 
CSS Frameworks
CSS FrameworksCSS Frameworks
CSS Frameworks
Mike Crabb
 
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
William Myers
 
Intermediate Web Design
Intermediate Web DesignIntermediate Web Design
Intermediate Web Design
mlincol2
 
Create a landing page
Create a landing pageCreate a landing page
Create a landing page
Fabien Vauchelles
 
TIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideTIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideRohan Chandane
 
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant   SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
Sencha
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
ghnash
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best Practices
Doris Chen
 
Building Potent WordPress Websites
Building Potent WordPress WebsitesBuilding Potent WordPress Websites
Building Potent WordPress Websites
Kyle Cearley
 
Node.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash CourseNode.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash Course
Aaron Silverman
 
OOCSS, SMACSS or BEM?
OOCSS, SMACSS or BEM?OOCSS, SMACSS or BEM?
OOCSS, SMACSS or BEM?
Michael Posso
 
OOCSS, SMACSS or BEM, what is the question...
OOCSS, SMACSS or BEM, what is the question...OOCSS, SMACSS or BEM, what is the question...
OOCSS, SMACSS or BEM, what is the question...
Michael Posso
 
CSS framework By Palash
CSS framework By PalashCSS framework By Palash
CSS framework By Palash
PalashBajpai
 
Building Performance - ein Frontend-Build-Prozess für Java mit Maven
Building Performance - ein Frontend-Build-Prozess für Java mit MavenBuilding Performance - ein Frontend-Build-Prozess für Java mit Maven
Building Performance - ein Frontend-Build-Prozess für Java mit Maven
Oliver Ochs
 
Learn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming ConventionLearn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming Convention
In a Rocket
 

Similar to Building a theming system with React - Matteo Ronchi - Codemotion Rome 2017 (20)

Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
 
Front-End Methodologies
Front-End MethodologiesFront-End Methodologies
Front-End Methodologies
 
Start your app the better way with Styled System
Start your app the better way with Styled SystemStart your app the better way with Styled System
Start your app the better way with Styled System
 
CSS Frameworks
CSS FrameworksCSS Frameworks
CSS Frameworks
 
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
 
Intermediate Web Design
Intermediate Web DesignIntermediate Web Design
Intermediate Web Design
 
Create a landing page
Create a landing pageCreate a landing page
Create a landing page
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
TIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideTIBCO General Interface - CSS Guide
TIBCO General Interface - CSS Guide
 
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant   SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best Practices
 
Building Potent WordPress Websites
Building Potent WordPress WebsitesBuilding Potent WordPress Websites
Building Potent WordPress Websites
 
Node.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash CourseNode.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash Course
 
OOCSS, SMACSS or BEM?
OOCSS, SMACSS or BEM?OOCSS, SMACSS or BEM?
OOCSS, SMACSS or BEM?
 
OOCSS, SMACSS or BEM, what is the question...
OOCSS, SMACSS or BEM, what is the question...OOCSS, SMACSS or BEM, what is the question...
OOCSS, SMACSS or BEM, what is the question...
 
CSS framework By Palash
CSS framework By PalashCSS framework By Palash
CSS framework By Palash
 
Building Performance - ein Frontend-Build-Prozess für Java mit Maven
Building Performance - ein Frontend-Build-Prozess für Java mit MavenBuilding Performance - ein Frontend-Build-Prozess für Java mit Maven
Building Performance - ein Frontend-Build-Prozess für Java mit Maven
 
Learn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming ConventionLearn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming Convention
 

More from Codemotion

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Codemotion
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
Codemotion
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
Codemotion
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
Codemotion
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Codemotion
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Codemotion
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Codemotion
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Codemotion
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Codemotion
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Codemotion
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Codemotion
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Codemotion
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Codemotion
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Codemotion
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Codemotion
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
Codemotion
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Codemotion
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Codemotion
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Codemotion
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Codemotion
 

More from Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

Recently uploaded

Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 

Recently uploaded (20)

Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 

Building a theming system with React - Matteo Ronchi - Codemotion Rome 2017

  • 2. MATTEO RONCHI @CEF62 GITHUB/CEF62 SENIOR SOFTWARE ENGINEER AT WORKWAVE FEVR COMMUNITY LEADER
  • 3. TODAY'S WEB IS ALL ABOUT COMPONENT-BASED ARCHITECTURES
  • 5. > Modular > Scalable > Extensible > Reusable > Encapsulated
  • 7. HOCS ALLOW ABSTRACTION OF REUSABLE AUGMENTATIONS
  • 8. MANY WAYS TO STYLE COMPONENTS
  • 10. Web pages load Cascading Style Sheets to learn how to render HTML elements .red-button { color: red; } <button class="red-button">Red</button>
  • 12. Allow per-component css rules greatly improving components portability .redButton { color: red; } import css from './styles.css' const comp = () => <button className={css.redButton}>Red</button> <!-- HTML output --> <button class="red_button_7655465hgfhyoda4567">Red</button>
  • 14. Component styling without using CSS Making it really easy to dynamically change the visual output based on a component's state const redButton { color: 'red' } const comp = () => <button style={redButton}>Red</button>
  • 16. In recent years CSS-in-JS continued to grow and evolve. The current state of the art is expressed by libraries as > Styled Components > Aphrodite > Styletron > Glamour
  • 17. Those libraries dynamically define CSS rules using Javascript, JSON or CSS syntaxes. Generated CSS classes are injected at runtime into the web page.
  • 19. In UI development theming is the definition of reusable sets of visual styles, aiming to create consistency across views
  • 20. UI Theming can be done in so many different ways mostly depending on per-project requirements
  • 21. COLOR PALETTESTHE SIMPLEST WAY TO KEEP CONSISTENCY ACROSS VIEWS AND COMPONENTS
  • 22. @nice-blue: #5B83AD; @light-blue: #98C7F9; @small: 0.6rem; @big: 1.3rem; #header { color: @light-blue; font-size: @big; } #footer { color: @nice-blue; font-size: @small; }
  • 23. PROPS DRIVEN STYLESGREATER CUSTOMIZATION AND EASE TO CREATE DYNAMIC STYLES DEFINITION
  • 24. const theme = { niceBlue: '#5B83AD', lightBlue: '#98C7F9', small: '0.6rem', normal: '1rem', } const bgStyle = (props) => props.isFooter ? props.theme.lightBlue : props.theme.niceBlue const fontStyle = (props) => props.isFooter ? props.theme.small : props.theme.normal // styled-components const Button = styled.div` backgroundColor: ${bgStyle}; border: 2px solid ${fontStyle}; `
  • 25. Color Palettes and Props Driven Styles are great but we - at WorkWave - looked for something different
  • 26. > change the whole theme at runtime > support WYSIWYG > decouple component UI definition from UI styling > easy implementable theme variations
  • 27. > support theme variations per-component branches > be agnostic on how to create the final output > support component-based and atomic-css approaches
  • 29. The Theme-Manager is responsible for sharing themes It's possible to subscribe to be notified of theme changes, enabling a set of components to update consistently in a easy and transparent way
  • 30. A THEME DEFINES TWO MAIN FIELDS: styles a map of categories. Each category is a map of css classes in Javascript notation presets a map of presets, each preset is used to programmatically override the main theme definition
  • 31. const source = { // Main theme styles: { Button: { button: { backgroundColor: 'lightpink', color: 'blue', padding: '0.6em', fontWeight: 800, }, }, }, presets: { // dark style variation dark: { Button: { button: { backgroundColor: 'violet', color: 'white', }, }, }, }, } const appTheme = theme(source)
  • 32. const source = { // Main theme styles: { colors: { normal: { color: 'blue' }, confirm: { color: 'red' }, }, backgrounds: { normal: { backgroundColor: 'lightpink' }, confirm: { backgroundColor: 'lightgreen' }, }, }, presets: { // dark style variation dark: { colors: { normal: { color: 'white' }, confirm: { color: 'yellow' }, }, backgrounds: { normal: { backgroundColor: 'violet' }, confirm: { backgroundColor: 'darkgreen' }, }, }. }, } const appTheme = theme(source)
  • 33. A Themed Component expects to receive a map of css classes as a prop Knowing how to apply those css classes to its internal implementation.
  • 36. Makes available a theme-Manager instance to every descendant A theme-Manager instance can also be passed as a prop to every themed component
  • 38. A HoC connecting a React component to a themeManager instance connectTheme(config, mapThemeToProps, options)(DecoratedComponent)
  • 39. A themed component declares which theme categories it's interested in, and a map-Theme-To-Props function const config = { types: ['Header'] } const mapThemeToProps = ({ Header: { wrapper, label } }) => ({ wrapper, label }) const themedHeader = connectTheme(config, mapThemeToProps)(Header)
  • 40. The decorated component will receive a css prop containing all generated css classes const Header = ({ css, title }) => <div className={css.wrapper}> <div className={css.label}>{title}</div> </div>
  • 41. mapThemeToProps is where you are in control mapThemeToProps(theme, props) -> composed styles
  • 42. const mapThemeToProps = (theme) => { const { colors, backgrounds } = theme return { wrapper: { ...backgrounds.normal }, normalBtn: { ...colors.normal, ...backgrounds.normal }, confirmBtn: { ...colors.confirm, ...backgrounds.confirm }, } } const DecoratedComponent = ({ css }) => <div className={css.wrapper}> <button className={css.normalBtn}>Do Something</button> <button className={css.confirmBtn}>Are You Sure?</button> </div>
  • 43. const mapThemeToProps = (theme, props) => { const { colors, backgrounds, disabled } = theme const { canConfirm } = props const normalDisabled = canConfirm ? disabled.normal : {} const confirmDisabled = canConfirm ? disabled.normal : {} return { wrapper: { ...backgrounds.normal }, normalBtn: { ...colors.normal, ...backgrounds.normal, ...normalDisabled }, confirmBtn: { ...colors.confirm, ...backgrounds.confirm, ...confirmDisabled }, } } const DecoratedComponent = ({ css }) => <div className={css.wrapper}> <button className={css.normalBtn}>Do Something</button> <button className={css.confirmBtn}>Are You Sure?</button> </div>
  • 44. The decorated component's interaction with the theme is customizable using the theme-Params prop
  • 45. preset: a theme preset to be applied to the component branch. theme-Name: changes the active theme for the component branch. overrides: a local overrides to the style object passed to the map-Theme-To-Props.
  • 46. const themeParams = { preset: 'dark', overrides: { colors: { normal: { color: 'white', fontWeight: 'bold', }, }, backgrounds: { normal: { backgroundColor: 'black', }, }, } } const Comp = () => <MyThemedComp themeParams={themeParams} />
  • 48. The map of styles returned by map-Theme-To-Props is passed through a compiler We use aphrodite to generate CSS but the engine is configurable on per-component basis
  • 49. Performances Matters Every themed component uses memoization and strict equality checks to ensure the compiler is invoked as little as possible
  • 50. Room for improvements The code boilerplate required to create reusable variations of a themed component feels excessive Declaration of expected theme categories could be more flexible