Skip to content

Instantly share code, notes, and snippets.

@alexvcasillas
Last active April 28, 2017 11:36
Show Gist options
  • Save alexvcasillas/da4ed46c3438fffceda344e26c1d3798 to your computer and use it in GitHub Desktop.
Save alexvcasillas/da4ed46c3438fffceda344e26c1d3798 to your computer and use it in GitHub Desktop.
Little question about Styled-Components integration with MobX
import { inject, observer } from 'mobx-react';
import styled from 'styled-components';
const Button = styled.button`
background: linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%);
border-radius: ${props => props.ui.borderRadius}px;
border: 0;
outline: none;
color: ${props => props.ui.textColor};
text-transform: uppercase;
padding: 10px 15px;
box-shadow: 0 3px 5px 2px rgba(255, 105, 135, .30);
transition: all 1s ease-in-out;
margin-bottom: 5px;
&:hover{
background: linear-gradient(45deg, #ed6482 30%, #e98049 90%);
}
&:active{
background: linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%);
}
`;
export default inject('ui')(observer(Button));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment