Utility-first style functions for rapidly building custom design systems.
-The system lets you quickly build custom UI components leveraging the design tokens defined in your theme. +The style system lets you quickly build custom UI components leveraging the design tokens defined in your theme. ## Demo {{"demo": "pages/system/basics/Demo.js", "bg": true, "defaultCodeOpen": true}} -## Why +## Why use the style system -There are several reasons why you may need the system offered by Material-UI. Here are few of them: +There are several reasons why you may want to use the style system. Here are few: -### 1. Building consistent UIs is hard +### 1. Simplfy building consistent UIs -This is especially true when there is more than one person building the application. There has to be some synchronization as to what the design tokens are and how they are used, what parts of the theme structure should be used with what CSS properties, etc. +Building consistent UIs is hard. This is especially true when more than one person is building the application, as there has to be some coordination amongst members of the team regardingchoice of design tokens and how they are used, what parts of the theme structure should be used with what CSS properties, and so on. -### 2. Switching context +### 2. Reduce context switching -Often we find ourselves jumping from the JS to CSS, or from a component definition to an instance in order to understand where and how some styles are defined. This is particularly true as the complexity (LOCs/# of elements) of the component we are working on increases. We could save a lot of time by removing this constraint. +We often find ourselves jumping from JS to CSS, or from a component definition to an instance in order to understand where and how some styles are defined. This is particularly true as the complexity (LOCs/# of elements) of the component we are working on increases. We could save a lot of time by removing this overhead. -```diff -import * as React from 'react'; --import styled from 'styled-components'; -+import Box from '@material-ui/core/Box'; - --const Card = styled('div)({ -- width: '200px', -- height: '200px', -- boxShadow: theme => theme.shadows[3], --}); -- --const Header = styled('h4')({ -- color: 'grey', --}); -- --const Content = styled('p')({ -- fontSize: '14px;, -- marginTop: '10px', --}); - -export default function Demo() { -- return (