335 lines
7.7 KiB
SCSS
335 lines
7.7 KiB
SCSS
@import '../config/import';
|
|
|
|
:root {
|
|
--layout-sidebar-left-display: block;
|
|
--layout-sidebar-right-display: block;
|
|
--layout-sidebar-left-width: 100%;
|
|
--layout-sidebar-right-width: 100%;
|
|
--layout-sidebar-left-row-end: initial;
|
|
--layout-content-width: 100%;
|
|
--layout-drawer-width: 300px;
|
|
--layout-gap: var(--su-2);
|
|
--layout-padding: 0;
|
|
--layout: 100%;
|
|
|
|
@media (min-width: $breakpoint-m) {
|
|
--layout-sidebar-left-width: 2fr;
|
|
--layout-padding: var(--su-2);
|
|
--layout: var(--layout-content-width);
|
|
}
|
|
|
|
@media (min-width: $breakpoint-l) {
|
|
--layout-sidebar-left-width: 240px;
|
|
--layout-content-width: 1fr;
|
|
--layout-gap: var(--su-4);
|
|
--layout-padding: var(--su-4);
|
|
}
|
|
}
|
|
|
|
.crayons-layout {
|
|
font-size: var(--fs-base); // todo: drop it when ready
|
|
width: 100%;
|
|
max-width: var(--site-width);
|
|
margin: 0 auto;
|
|
display: grid;
|
|
gap: var(--layout-gap);
|
|
grid-template-columns: var(--layout);
|
|
padding: var(--layout-padding);
|
|
|
|
&__sidebar-left {
|
|
display: var(--layout-sidebar-left-display);
|
|
grid-row-end: var(--layout-sidebar-left-row-end);
|
|
width: var(--layout-sidebar-left-width);
|
|
}
|
|
|
|
&__sidebar-right {
|
|
display: var(--layout-sidebar-right-display);
|
|
width: var(--layout-sidebar-right-width);
|
|
}
|
|
|
|
&__content {
|
|
// Hack preventing content exceeding its container - it works for scenarios where we have
|
|
// `pre` tag having wide (overflowing) text. And the container itself is part of a layout
|
|
// built using CSS `grid`. Without this, the grid layout wouldn't stick to its defined
|
|
// widths...
|
|
min-width: 0;
|
|
}
|
|
|
|
&__content__inner {
|
|
margin: 0 auto;
|
|
width: 100%;
|
|
}
|
|
|
|
&--limited-l {
|
|
--site-width: #{$breakpoint-l};
|
|
}
|
|
|
|
&--limited-m {
|
|
--site-width: #{$breakpoint-m};
|
|
}
|
|
|
|
&--limited-s {
|
|
--site-width: #{$breakpoint-s};
|
|
}
|
|
|
|
&--limited-xs {
|
|
--site-width: #{$breakpoint-xs};
|
|
}
|
|
|
|
&--limited-inner-l {
|
|
.crayons-layout__content__inner {
|
|
max-width: $breakpoint-l;
|
|
}
|
|
}
|
|
|
|
&--limited-inner-m {
|
|
.crayons-layout__content__inner {
|
|
max-width: $breakpoint-m;
|
|
}
|
|
}
|
|
|
|
&--limited-inner-s {
|
|
.crayons-layout__content__inner {
|
|
max-width: $breakpoint-s;
|
|
}
|
|
}
|
|
}
|
|
|
|
.crayons-layout--2-cols {
|
|
@media (min-width: $breakpoint-m) {
|
|
--layout: var(--layout-sidebar-left-width) var(--layout-content-width);
|
|
--layout-content-width: 5fr;
|
|
}
|
|
|
|
@media (min-width: $breakpoint-l) {
|
|
--layout-sidebar-left-width: 240px;
|
|
--layout-content-width: 1fr;
|
|
--layout-gap: var(--su-4);
|
|
}
|
|
|
|
&.crayons-layout--limited-inner {
|
|
.crayons-layout__content__inner {
|
|
max-width: $breakpoint-m;
|
|
margin: 0 auto;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
&--inverted {
|
|
.crayons-layout__sidebar-right {
|
|
order: -1;
|
|
}
|
|
@media (min-width: $breakpoint-m) {
|
|
--layout: var(--layout-content-width) var(--layout-sidebar-left-width);
|
|
.crayons-layout__sidebar-right {
|
|
order: 1;
|
|
}
|
|
}
|
|
}
|
|
|
|
&--1-2 {
|
|
@media (min-width: $breakpoint-l) {
|
|
--layout-sidebar-left-width: 1fr;
|
|
--layout-content-width: 2fr;
|
|
}
|
|
}
|
|
}
|
|
|
|
.crayons-layout--3-cols {
|
|
@media (min-width: $breakpoint-m) {
|
|
--layout: var(--layout-sidebar-left-width) var(--layout-content-width);
|
|
--layout-sidebar-left-row-end: span 2;
|
|
--layout-sidebar-left-width: 2fr;
|
|
--layout-sidebar-right-width: 5fr;
|
|
--layout-content-width: 5fr;
|
|
}
|
|
|
|
@media (min-width: $breakpoint-l) {
|
|
--layout-sidebar-left-width: 240px;
|
|
--layout-sidebar-right-width: 1fr;
|
|
--layout-sidebar-left-row-end: initial;
|
|
--layout-content-width: 2fr;
|
|
--layout: var(--layout-sidebar-left-width) var(--layout-content-width)
|
|
var(--layout-sidebar-right-width);
|
|
}
|
|
|
|
&--drop-right-left {
|
|
--layout-sidebar-left-display: none;
|
|
--layout-sidebar-right-display: none;
|
|
--layout-sidebar-left-width: var(--layout-drawer-width);
|
|
--layout-sidebar-right-width: var(--layout-drawer-width);
|
|
|
|
@media (min-width: $breakpoint-m) {
|
|
--layout-sidebar-left-width: 2fr;
|
|
--layout-sidebar-left-row-end: initial;
|
|
--layout-sidebar-left-display: block;
|
|
}
|
|
|
|
@media (min-width: $breakpoint-l) {
|
|
--layout-sidebar-right-display: block;
|
|
--layout-sidebar-right-width: 1fr;
|
|
--layout-sidebar-left-width: 240px;
|
|
}
|
|
}
|
|
}
|
|
|
|
.crayons-layout--article {
|
|
--layout-gap: 0;
|
|
@media (min-width: $breakpoint-m) {
|
|
--layout-gap: var(--su-2);
|
|
--layout-sidebar-left-width: var(--su-9);
|
|
--layout: var(--layout-sidebar-left-width) 1fr;
|
|
--layout-sidebar-left-row-end: span 2;
|
|
}
|
|
|
|
@media (min-width: $breakpoint-l) {
|
|
--layout-gap: var(--su-4);
|
|
--layout-sidebar-right-width: 3fr;
|
|
--layout-sidebar-left-row-end: initial;
|
|
--layout-content-width: 7fr;
|
|
--layout: var(--layout-sidebar-left-width) var(--layout-content-width)
|
|
var(--layout-sidebar-right-width);
|
|
}
|
|
}
|
|
|
|
// Unlike the main app, in the admin area we only break into 2 side-by-side columns at large breakpoint,
|
|
// to allow more real estate for data tables
|
|
.crayons-layout--admin-2-cols {
|
|
@media (min-width: $breakpoint-l) {
|
|
--layout: var(--layout-sidebar-left-width) var(--layout-content-width);
|
|
--layout-sidebar-left-width: 240px;
|
|
--layout-content-width: 1fr;
|
|
--layout-gap: var(--su-4);
|
|
}
|
|
}
|
|
|
|
// Temporary solution for sidebar on mobile
|
|
.crayons-layout__sidebar-left,
|
|
.crayons-layout__sidebar-right {
|
|
.sidebar-bg {
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
overflow: hidden;
|
|
position: fixed;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
animation: fade-in var(--transition-props);
|
|
display: none;
|
|
}
|
|
|
|
&.swiped-in {
|
|
z-index: var(--z-drawer);
|
|
display: block;
|
|
position: fixed;
|
|
top: 0;
|
|
bottom: 0;
|
|
-webkit-overflow-scrolling: touch;
|
|
|
|
.sidebar-bg {
|
|
display: block;
|
|
}
|
|
|
|
.side-bar {
|
|
position: relative;
|
|
background: var(--body-bg);
|
|
padding: 16px;
|
|
align-content: start;
|
|
height: 100%;
|
|
overflow-y: auto;
|
|
}
|
|
}
|
|
}
|
|
|
|
.crayons-layout__sidebar-left {
|
|
&.swiped-in {
|
|
left: 0;
|
|
}
|
|
}
|
|
.crayons-layout__sidebar-right {
|
|
&.swiped-in {
|
|
right: 0;
|
|
}
|
|
}
|
|
|
|
// Zen Mode
|
|
// It's here because it affects the layout.
|
|
.zen-mode {
|
|
--site-width: 1024px;
|
|
--header-height: 0;
|
|
.crayons-layout--3-cols {
|
|
--layout: var(--layout-sidebar-left-width) 1fr;
|
|
@media (min-width: $breakpoint-m) {
|
|
--layout: var(--layout-sidebar-left-width) 1fr;
|
|
}
|
|
}
|
|
.crayons-header,
|
|
.crayons-footer,
|
|
.crayons-article-sticky,
|
|
.crayons-layout__sidebar-right {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
// Used for bigger sections paddings (posts for example)
|
|
// It's here because it affects the layout.
|
|
:root {
|
|
--content-padding-x: var(--su-3);
|
|
--content-padding-y: var(--su-3);
|
|
|
|
@media (min-width: $breakpoint-s) {
|
|
--content-padding-x: var(--su-5);
|
|
--content-padding-y: var(--su-5);
|
|
}
|
|
|
|
@media (min-width: $breakpoint-m) {
|
|
--content-padding-x: var(--su-8);
|
|
--content-padding-y: var(--su-7);
|
|
}
|
|
|
|
@media (min-width: $breakpoint-l) {
|
|
--content-padding-x: var(--su-9);
|
|
}
|
|
}
|
|
|
|
.text-padding {
|
|
padding: var(--content-padding-y) var(--content-padding-x);
|
|
}
|
|
|
|
.crayons-page-header {
|
|
--layout-padding: var(--su-3);
|
|
|
|
@media (min-width: $breakpoint-l) {
|
|
--layout-padding: var(--su-4);
|
|
}
|
|
|
|
padding: var(--layout-padding);
|
|
max-width: var(--site-width);
|
|
width: 100%;
|
|
margin: 0 auto;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
|
|
@media (min-width: $breakpoint-m) {
|
|
min-height: unset;
|
|
}
|
|
}
|
|
|
|
.crayons-layout--header-inside {
|
|
--header-span: 1 / span 1;
|
|
&.crayons-layout--2-cols {
|
|
--header-span: 1 / span 2;
|
|
}
|
|
grid-template-rows: min-content 1fr;
|
|
row-gap: 0;
|
|
|
|
@media (min-width: $breakpoint-m) {
|
|
row-gap: var(--layout-gap);
|
|
|
|
.crayons-page-header {
|
|
--layout-padding: 0;
|
|
grid-column: var(--header-span);
|
|
}
|
|
}
|
|
}
|