Designing with React arrow_forward
Staying Sane While Styling Components
Submitted by Saneef Ansari (@saneef) on Tuesday, 5 December 2017
When I’m wearing a front developer’s hat, I worry about three things:
- How do I code the visual design attributes, so that it will be consistent and re-usable across projects (if possible across teams)?
- How to code different layouts — both component and page level layouts — which can be replicated.
- How to code the different states and variants of a component? How to make article look different when the device is offline? How to make the a primary button different from secondary? Again, these different variants should be accessible through
propsof the component.
I’ll walk you through how we code design in React. These tips are agnostic to styling frameworks, inline styles, CSS-in-JS, or SCSS.
- Design Tokens
- Forget Grid frameworks
- Visible & Invisible Components
3.2 Micro Grids
3.3 Width Managers
- Focus on Stateless components
4.1 Re-usable by Code and Semantics
- Leverage “Storybook.js” for your mental health
Saneef is an information and product designer. He picked up the front development some where along his way. He leads design at Alaris Prime. Previously, he was a freelance designer in Bangalore who helped a number of local startups with their products and services.
Saneef is a graduate of the National Institute of Design (NID), Bangalore. He has previously worked with the renowned design agency iA Zurich.