Skip to content

Instantly share code, notes, and snippets.

@mklickman
Created November 9, 2017 17:22
Show Gist options
  • Save mklickman/87832217273ae060a9cd3b10eb705239 to your computer and use it in GitHub Desktop.
Save mklickman/87832217273ae060a9cd3b10eb705239 to your computer and use it in GitHub Desktop.
.button {
box-sizing: border-box;
display: inline-block;
border: 1px solid transparent;
border-radius: 8px;
font-family: 'karla';
font-size: 1.375rem;
line-height: 1;
text-align: center;
padding: 1.25rem 1.75rem;
position: relative;
user-select: none;
white-space: nowrap;
transition: all 0.2s;
text-decoration: none;
&:after {
box-shadow: 0 5px 20px 2px rgba(54, 62, 72, 0.1);
border-radius: 8px;
content: "";
display: block;
opacity: 0;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
transition: opacity 0.2s ease-in-out;
z-index: -1;
}
&.--primary {
background-color: $brand-sky-blue;
border: 1px solid $brand-sky-blue;
color: white;
&:after {
box-shadow: 0 5px 20px 2px rgba(54, 62, 72, 0.2);
}
}
&.--secondary {
background-color: white;
border: 1px solid $brand-sky-blue;
font-family: 'karla';
color: $brand-sky-blue;
}
&.--alternate {
background-color: $brand-blue;
border: 1px solid $brand-blue;
color: white;
&:after {
box-shadow: 0 5px 20px 2px rgba(54, 62, 72, 0.25);
}
}
&.--danger {
background-color: $errors;
border: 1px solid $errors;
color: white;
&:after {
box-shadow: 0 5px 20px 2px rgba(54, 62, 72, 0.25);
}
}
&.--disabled,
&[disabled] {
background-color: white;
border: 1px solid $disabled;
color: $disabled;
cursor: default;
font-family: 'karla';
}
&.--block {
display: block;
width: 100%;
& + .button.--block {
margin-top: 0.3125rem;
}
}
&.--callout {
background-color: white;
background-image: url('/images/chevron-right-sky-blue.svg');
background-repeat: no-repeat;
background-position: 2.75rem center;
border: 1px solid $borders;
box-sizing: border-box;
color: $paragraph-text;
display: block;
padding: 3rem 25%;
}
&.--small {
font-size: 1.1875rem;
padding: 1rem 1.25rem;
}
&.--icon {
padding: 0.75rem 1rem;
}
&:hover:after {
opacity: 1;
}
&.--disabled:hover:after {
opacity: 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment