Create button components

This commit is contained in:
2021-09-01 17:27:49 +01:00
parent 21fe3f660a
commit 5022393bf6
3 changed files with 178 additions and 0 deletions

110
src/css/Button.css Normal file
View File

@@ -0,0 +1,110 @@
.button {
text-decoration: none;
background-color: var(--primary-color);
color: var(--text-color);
padding: 10px 16px;
border-radius: 30px;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
transition: 0.2s;
width: max-content;
}
nav .button {
margin: 4px;
}
main .button {
margin-top: 8px;
margin-bottom: 8px;
}
.button > span {
display: flex;
}
.button > span.button-children {
margin-bottom: -2px;
}
.button--icon-and-text > span.button-children {
margin-left: 5px;
}
.button:hover {
background-color: var(--primary-color-tinted);
}
.button.button--round {
padding: 8px;
}
.page-header .button.button--round {
padding: 10px;
}
.button.button--disabled {
cursor: default;
background-color: var(--primary-color-dark);
color: var(--text-color-tinted);
}
.button--loading > span {
opacity: 0;
}
.button--loading > img {
height: 24px;
margin: auto;
position: absolute;
}
.button.button--no-background {
background: none;
padding: 10px;
}
.button-container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-end;
}
.button-container > .button {
margin-left: 4px;
margin-right: 4px;
}
.button-container > .button:first-child {
margin-left: 0;
}
.button-container > .button:last-child {
margin-right: 0;
}
.buttons--mobile {
display: none;
}
@media screen and (max-width: 660px) {
.button.button--hide-text-mobile {
background: none;
padding: 10px;
}
.button.button--hide-text-mobile .button-children {
display: none;
}
}
@media screen and (max-width: 520px) {
.buttons--mobile {
display: flex;
}
.buttons--desktop {
display: none;
}
}