<div class='container'>
<h1>
Buttons
</h1>
<p>
Random selection of button styles. May change over time as I get alot of stupid ideas. Feel free to follow me on
</p>
<div class="button-container" role="group" aria-label="Action Buttons">
<button class="button -regular" aria-label="Start the process">Let's start</button>
<button class="button -dark" aria-label="Touch me">Touch me</button>
<button class="button -green" aria-label="Proceed with that">Just like that</button>
<button class="button -blue" aria-label="And that, oh, yeah">And that, oh, yeah</button>
<button class="button -salmon" aria-label="This one I like">Now that I like</button>
<button class="button -sun" aria-label="That's so nice">God, that's so nice</button>
<button class="button -alge" aria-label="Lower down">Now lower down</button>
<button class="button -flower" aria-label="Where the figs lie">Where the figs lie</button>
</div>
</div>
// colors
:root {
--color-dark: #161616;
--color-ocean: #416dea;
--color-grass: #3dd28d;
--color-snow: #FFFFFF;
--color-salmon: #F32C52;
--color-sun: #feee7d;
--color-alge: #7999a9;
--color-flower: #353866;
--color-smoke: #e4e4e4;
--borderRadius: 36px;
--font-face: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
// reset
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
// body styles
body {
display: flex;
box-sizing: border-box;
min-height: 100vh;
background: whitesmoke;
font-family: var(--font-face);
font-size: 16px;
font-weight: 700;
line-height: 1;
justify-content: center;
align-items: center;
@media (min-width: 992px) {
border-width: 30px;
}
}
body.linked {
.button, h1 {
opacity: .3;
transition: opacity 300ms linear;
}
p {
color: var(--color-smoke);
transition: color 300ms linear;
}
}
// text styles
h1 {
text-align: center;
transition: opacity 300ms linear;
color: var(--color-dark);
font-family: var(--font-face);
font-size: 32px;
font-weight: 700;
span {
font-weight: 400;
}
}
p {
max-width: 460px;
margin: 0 auto;
transition: color 300ms linear;
text-align: center;
color: var(--color-dark);
font-weight: 400;
line-height: 1.5;
}
a, a:visited {
text-decoration: none;
color: var(--color-ocean);
font-weight: 500;
&:hover {
text-decoration: underline;
color:var(--color-ocean);
}
}
// container styles
.container {
display: flex;
flex-direction: column;
width: 100%;
padding: 20px;
}
.button-container {
display: flex;
margin: 60px auto;
flex-wrap: wrap;
justify-content: center;
}
// button styles
.button {
display: flex;
overflow: hidden;
margin: 10px;
padding: 12px 12px;
cursor: pointer;
user-select: none;
transition: all 150ms linear;
text-align: center;
white-space: nowrap;
text-decoration: none !important;
text-transform: none;
text-transform: capitalize;
color: #fff;
border: 0 none;
border-radius: var(--borderRadius);
font-size: 13px;
font-weight: 500;
line-height: 1.3;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
justify-content: center;
align-items: center;
flex: 0 0 160px;
box-shadow: 2px 5px 10px var(--color-smoke);
&:hover {
transition: all 150ms linear;
opacity: .85;
}
&:active {
transition: all 150ms linear;
opacity: .75;
}
&:focus {
outline: 1px dotted #959595;
outline-offset: -4px;
}
}
.button.-regular {
color: #202129;
background-color: #f2f2f2;
&:hover {
color: #202129;
background-color: #e1e2e2;
opacity: 1;
}
&:active {
background-color: #d5d6d6;
opacity: 1;
}
}
.button.-dark {
color: var(--color-snow);
background: var(--color-dark);
&:focus {
outline: 1px dotted white;
outline-offset: -4px;
}
}
.button.-green {
color: var(--color-snow);
background: var(--color-grass);
}
.button.-blue {
color: var(--color-snow);
background: var(--color-ocean);
}
.button.-salmon {
color: var(--color-snow);
background: var(--color-salmon);
}
.button.-sun {
color: #f15c5c;
background: var(--color-sun);
}
.button.-alge {
color: #e7ff20;
background: var(--color-alge);
}
.button.-flower {
color: #FE8CDF;
background: var(--color-flower);
}
View Compiled
This Pen doesn't use any external CSS resources.