publik-base-theme/static/includes/_layout.scss

294 lines
6.1 KiB
SCSS

$width: 1280px !default;
$mobile-limit: 1024px !default;
$mobile-width: 720px !default;
$very-small-limit: 560px !default;
$columns-gutter: 20px !default;
$footer-background: #666666 !default;
$footer-full-width-background: true !default;
$footer-color: white !default;
$footer-link-color: $link-color !default;
$sidebar-width: 280px !default;
$sidebar-max-width: $sidebar-width !default;
$sidebar-min-width: 0 !default;
$sidebar-position: left !default;
$sidebar-columns-gutter: $columns-gutter !default;
$edge-gutter: legacy !default;
$edge-gutter-mobile: $edge-gutter !default;
// custom media queries
// @media ($max-mobile-viewport) {}
// @media ($min-desktop-viewport) {}
$max-mobile-viewport: "max-width: #{$mobile-limit}";
$min-desktop-viewport: "min-width: #{min-desktop-viewport($mobile-limit)}";
// set default box model to border-box
* {
box-sizing: border-box;
&::before, &::after {
box-sizing: inherit;
}
}
html, body {
margin: 0;
min-height: 100vh;
}
div#page {
display: flex;
min-height: 100vh;
flex-direction: column;
}
div#page div#main-content-wrapper,
div#page main {
flex: 1 0 auto;
}
.page-width,
.header-width,
.nav-width,
.footer-width {
clear: both;
max-width: $width;
margin: 0 auto;
}
@if ($mobile-width) {
.page-width,
.footer-width {
@media ($max-mobile-viewport) {
max-width: $mobile-width;
}
}
}
div#header {
position: relative;
& h1 {
margin: 0;
}
}
div#main-content-wrapper {
position: relative;
z-index: 100;
@media screen and ($max-mobile-viewport) {
position: static;
z-index: 0;
}
}
div#main-content {
margin: 0;
min-height: 300px;
}
.column {
float: left;
width: 50%;
}
#columns-wrapper {
flex-grow: 1;
max-width: 100%;
}
.central-content {
display: flex;
#sidebar {
flex: 0 0 $sidebar-width;
max-width: $sidebar-max-width;
@if $sidebar-min-width != 0 {
min-width: $sidebar-min-width;
}
@if $sidebar-position == right {
order: 1;
}
@if $sidebar-position == left {
margin-left: 0;
margin-right: $sidebar-columns-gutter;
} @else {
margin-left: $sidebar-columns-gutter;
margin-right: 0px;
}
}
}
@media screen and ($max-mobile-viewport) {
#columns-wrapper {
max-width: 100%;
}
.column {
float: none;
width: auto;
}
.central-content {
flex-direction: column;
#sidebar {
margin: 0;
flex: 0 0 auto;
max-width: 100%;
// don't apply min-width on mobile
@if $sidebar-min-width != 0 {
min-width: 0;
}
div.cell {
margin-left: 0;
margin-right: 0;
}
}
}
}
#footer-wrapper {
clear: both;
margin-top: 1.5em;
color: $footer-color;
a {
color: $footer-link-color;
}
}
@if $footer-full-width-background {
#footer-wrapper {
padding-top: 0.7em;
padding-bottom: 1.5em;
background-color: $footer-background;
}
} @else {
#footer {
padding-top: 0.7em;
padding-bottom: 1.5em;
background-color: $footer-background;
}
}
// edge-gutter
@if $edge-gutter == legacy {
div#header {
width: 100%;
padding: 0 0.7em;
}
div#page div#main-content-wrapper,
div#page main {
width: 100%;
}
@if not $footer-full-width-background {
#footer {
padding-left: 0.7em;
padding-right: 0.7em;
}
}
@media ($max-mobile-viewport) {
.central-content #sidebar {
margin: 0 0.7em;
}
#columns-wrapper {
padding: 0 0.7em;
}
}
} @else {
.page-width,
.header-width,
.nav-width,
.footer-width {
--edge-gutter: #{$edge-gutter};
--edge-gutter-mobile: #{$edge-gutter-mobile};
box-sizing: content-box;
padding-left: var(--edge-gutter);
padding-right: var(--edge-gutter);
@media ($max-mobile-viewport) {
--edge-gutter: var(--edge-gutter-mobile);
}
}
@if ($mobile-width) {
.header-width,
.nav-width {
@media ($max-mobile-viewport) {
--edge-gutter-mobile: 0;
}
}
}
}
@media screen and ($max-mobile-viewport) {
.pk-desktop-only, .desktop-only {
display: none !important;
}
}
@media screen and ($min-desktop-viewport) {
.pk-mobile-only, .mobile-only {
display: none !important;
}
}
@media not print {
.pk-print-only {
display: none !important;
}
}
@media print {
.pk-no-print {
display: none !important;
}
}
body.pk-mini-page {
@if variable-exists(primary-color) {
--primary-color: #{$primary-color};
} @else {
--primary-color: #ccc;
}
margin: 0;
padding: 0;
background: #F2F2F2;
color: black;
font-family: sans-serif;
padding: 1em;
main {
background: white;
max-width: 30em;
margin: 4em auto;
padding: 0em;
text-align: center;
border-bottom: 5px solid var(--primary-color);
}
.pk-mini-page--content {
padding: 1em
}
.loader {
margin: 2em auto;
width: 40px;
height: 30px;
aspect-ratio: 1;
--c: linear-gradient(var(--primary-color) 0 0);
--r1: radial-gradient(farthest-side at bottom, var(--primary-color) 93%, var(--primary-color));
--r2: radial-gradient(farthest-side at top , var(--primary-color) 93%, var(--primary-color));
background: var(--c), var(--r1), var(--r2), var(--c), var(--r1), var(--r2), var(--c), var(--r1), var(--r2);
background-repeat: no-repeat;
animation: l2 1s infinite alternate;
}
@keyframes l2 {
0%,25% {
background-size: 8px 0, 8px 4px, 8px 4px, 8px 0, 8px 4px, 8px 4px, 8px 0, 8px 4px, 8px 4px;
background-position: 0 50%, 0 calc(50% - 2px), 0 calc(50% + 2px), 50% 50%, 50% calc(50% - 2px), 50% calc(50% + 2px), 100% 50%, 100% calc(50% - 2px), 100% calc(50% + 2px);
}
50% {
background-size: 8px 100%, 8px 4px, 8px 4px, 8px 0, 8px 4px, 8px 4px, 8px 0, 8px 4px, 8px 4px;
background-position: 0 50%, 0 calc(0% - 2px), 0 calc(100% + 2px), 50% 50%, 50% calc(50% - 2px), 50% calc(50% + 2px), 100% 50%, 100% calc(50% - 2px), 100% calc(50% + 2px);
}
75% {
background-size: 8px 100%, 8px 4px, 8px 4px, 8px 100%, 8px 4px, 8px 4px, 8px 0, 8px 4px, 8px 4px;
background-position: 0 50%, 0 calc(0% - 2px), 0 calc(100% + 2px), 50% 50%, 50% calc(0% - 2px), 50% calc(100% + 2px), 100% 50%, 100% calc(50% - 2px), 100% calc(50% + 2px);
}
95%,100% {
background-size: 8px 100%, 8px 4px, 8px 4px, 8px 100%, 8px 4px, 8px 4px, 8px 100%, 8px 4px, 8px 4px;
background-position: 0 50%, 0 calc(0% - 2px), 0 calc(100% + 2px), 50% 50%, 50% calc(0% - 2px), 50% calc(100% + 2px), 100% 50%, 100% calc(0% - 2px), 100% calc(100% + 2px);
}
}
}