PHPGallery/css/main.scss
Fluffy-Bean d2858ce907 Adding autofix badges
Profile picture shows up in Nav
Moved backgrounds to new folder
2022-11-02 11:30:34 +00:00

376 lines
No EOL
7.1 KiB
SCSS

/*
|-------------------------------------------------------------
| Sass stylesheet
|-------------------------------------------------------------
| This is all written by me! Fluffy! This is intended to be
| compiled before use, I want to make this autocompile for
| ease of use, but you may suffer along with me for now :3
|-------------------------------------------------------------
*/
@import "scss/mixin";
@import "scss/variables";
@import "scss/navigation";
@import "scss/body";
@import "scss/footer";
/*
|-------------------------------------------------------------
| BODY COMPONENTS
|-------------------------------------------------------------
*/
html {
margin: 0;
padding: 0;
min-height: 100vh;
max-width: 100vw;
position: relative;
background-color: $bg;
background-image: url("../assets/backgrounds/bg.svg");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
scroll-behavior: smooth;
overflow: auto;
}
body {
margin: 0 auto;
padding: 1rem;
max-width: 1100px;
min-height: calc(100vh - 2rem);
@include flexDown(space-between);
position: relative;
* {
color: $fg;
}
}
/*
|-------------------------------------------------------------
| BUTTONS
|-------------------------------------------------------------
*/
.btn {
padding: 0.5rem;
width: 100%;
display: block;
box-sizing: border-box;
font-size: 16px;
font-weight: 500;
font-family: $font-body;
text-decoration: none;
border: none;
@if calc($rad - 0.5rem) > 0 {
border-radius: calc($rad - 0.5rem);
} @else {
border-radius: 3px;
}
transition: outline 0.1s cubic-bezier(.19, 1, .22, 1);
&:hover {
outline: $white 0.2rem solid;
color: $fg;
cursor: pointer;
}
&:where(input[type="file"])::file-selector-button {
margin: -0.25rem 0.5rem -0.25rem -0.25rem;
padding: 0.5rem;
display: inline-block;
font-size: 16px;
font-family: $font-body;
text-decoration: none;
background-color: $white;
border: none;
@if calc($rad - 0.5rem) > 0 {
border-radius: calc($rad - 0.5rem);
} @else {
border-radius: 3px;
}
}
&:disabled {
cursor: not-allowed;
outline: none;
z-index: 1;
filter: brightness(0.5) grayscale(0.3);
img {
display: none;
}
}
}
a.btn {
text-align: center;
}
.btn-bad {
background-color: $warning;
background-image: linear-gradient(to top, darken($warning, 5%), $warning);
}
.btn-warning {
background-color: $alert;
background-image: linear-gradient(to top, darken($alert, 5%), $alert);
}
.btn-good {
background-color: $page-accent;
background-image: linear-gradient(to top, darken($page-accent, 5%), $page-accent);
}
.btn-neutral {
background-color: $neutral;
background-image: linear-gradient(to top, darken($neutral, 0.5%), $neutral);
}
/*
|-------------------------------------------------------------
| ALERTS
|-------------------------------------------------------------
*/
.alert {
padding: 0.75rem;
width: 100%;
display: block;
box-sizing: border-box;
font-size: 16px;
font-weight: 500;
font-family: $font-body;
text-decoration: none;
border-left: $border-thickness solid $fg;
background-color: $bg;
background-repeat: no-repeat;
@if calc($rad - 0.5rem) > 0 {
border-radius: calc($rad - 0.3rem);
} @else {
border-radius: 3px;
}
}
.alert-bad {
border-color: $warning;
background-image: linear-gradient(to right, rgba($warning, 0.3), rgba($bg, 0));
}
.alert-warning {
border-color: $alert;
background-image: linear-gradient(to right, rgba($alert, 0.3), rgba($bg, 0));
}
.alert-good {
border-color: $page-accent;
background-image: linear-gradient(to right, rgba($page-accent, 0.3), rgba($bg, 0));
}
/*
|-------------------------------------------------------------
| BADGES
|-------------------------------------------------------------
*/
@mixin badge($color, $fg: $color) {
background: rgba($color, 0.3);
border: $color $border-thickness solid;
}
.badge {
display: inline-block;
box-sizing: border-box;
margin: 0 0.25rem;
padding: 0.2em 0.4em;
border: $black $border-thickness solid;
@if $rad <= 0 {
border-radius: 3px;
} @else {
border-radius: $rad;
}
color: $fg;
font-size: 0.8em;
font-weight: bold;
line-height: 1;
vertical-align: baseline;
white-space: nowrap;
text-align: center;
&.badge-primary {
@include badge($page-accent);
}
&.badge-critical {
@include badge($red);
}
&.badge-warning {
@include badge($orange);
}
}
/*
|-------------------------------------------------------------
| FORM SIZING
|-------------------------------------------------------------
*/
form {
width: 100%;
box-sizing: content-box;
& > * {
margin-bottom: 0.5rem;
}
}
textarea {
resize: none;
}
/*
|-------------------------------------------------------------
| SVG
|-------------------------------------------------------------
*/
.svg {
margin: 0 0.2rem 0.1rem 0;
width: 1.15rem;
height: 1.1rem;
vertical-align: middle;
display: inline;
@if calc($rad - 0.5rem) > 0 {
border-radius: calc($rad - 0.5rem);
} @else {
border-radius: 3px;
}
}
/*
|-------------------------------------------------------------
| BR / BREAK
|-------------------------------------------------------------
*/
br {
margin: 0;
line-height: 0.25rem;
}
/*
|-------------------------------------------------------------
| Link text
|-------------------------------------------------------------
*/
a.link {
display: inline;
text-decoration: underline;
&:hover {
color: $page-accent;
}
}
/*
|-------------------------------------------------------------
| BACK TO TOP
|-------------------------------------------------------------
*/
#back-to-top {
margin: 0;
padding: 0.5rem;
position: fixed;
z-index: 99;
right: -2.5rem;
bottom: 1rem;
object-position: center;
background-color: $bg-alt;
backdrop-filter: blur(8px);
@if calc($rad - 0.5rem) > 0 {
border-radius: calc($rad - 0.5rem);
} @else {
border-radius: 3px;
}
box-shadow: $shadow;
transition: right 0.15s cubic-bezier(.19, 1, .22, 1);
&:hover {
outline: 0.2rem solid $green;
}
* {
margin: 0;
padding: 0;
width: 1.5rem;
height: 1.5rem;
display: block;
object-position: center;
}
}
@media(prefers-reduced-motion){
* {
transition: none !important;
}
}
.hr {
margin: 0.5rem 0;
border: none;
border-top: $border-thickness solid $fg;
}
.hr-full {
margin-left: -0.5rem;
margin-right: -0.5rem;
}
.hr-bad {
border-color: $warning;
}
.hr-warning {
border-color: $alert;
}
.hr-good {
border-color: $page-accent;
}