Skip to content

Instantly share code, notes, and snippets.

@jacobtoye
Created October 11, 2017 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobtoye/7c9bcfb8354f48797b0ff5378f4cb275 to your computer and use it in GitHub Desktop.
Save jacobtoye/7c9bcfb8354f48797b0ff5378f4cb275 to your computer and use it in GitHub Desktop.
import * as React from 'react';
import './styles.css';
export interface ButtonProps {
text: string;
disabled?: boolean;
onClick?: (event: any) => void;
}
export const Button: React.SFC<ButtonProps> = ({ text, disabled = false, onClick }) => {
return (
<button className="button" onClick={onClick} disabled={disabled}>
{text}
</button>
);
};
@import "../variables.css";
.button {
background-color: var(--accentColor);
border: 0;
border-radius: 6px;
color: var(--lightTextColor);
cursor: pointer;
font: var(--baseFont);
font-size: var(--subTitleTextSize);
font-weight: var(--subTitleFontWeight);
line-height: calc(var(--rowHeight) * 2);
margin: var(--rowHeight) var(--columnWidth);
min-width: calc(var(--columnWidth) * 3);
padding: 0 var(--rowHeight);
transition: all 0.4s ease 0s;
&:focus {
outline: none;
}
&:active {
background-color: color(var(--accentColor) tint(30%));
}
&:disabled {
background-color: var(--disabledColor);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment