This is a style guide that integrates Material UI and Styled Components to make resuable view components.
Material UI is a React Component library that implements Google's Material Design. It is the most popular component library with over 46k stars on Github.
Styled-Components is a library that is used to style React components. It is used to by creating React components without the need of making CSS class names.
import styled, { css } from 'styled-components'
import Button from '@material-ui/core/Button';
export default styled(Button)``;
import styled, { css } from 'styled-components'
import Button from '@material-ui/core/Button';
export default styled(Button)`
//ampersand character makes sure that styled-component styles override JSS styles
&& {
color: #FF000
box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.18), 0 4px 8px 0 rgba(0, 0, 0, 0.15);
}
`;
import React from 'react'
import styled, { css } from 'styled-components'
import Button from '@material-ui/core/Button';
export default styled(({ color, ...otherProps }) => <Button {...otherProps} />)`
color: ${props => props.color};
`;
import React from 'react'
import styled, { css } from 'styled-components'
import Button from '@material-ui/core/Button';
export default styled(({ color, ...otherProps }) => <Button {...otherProps} />)`
color: ${props => props.color};
& .label {
font-size: 14px;
}
`;
This is a body text. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.
Small text
Bold text
Highlighted text
Italicized text
Underlined text
Link defaultLink hoverLink activeLink visitedLink disabled