homepage/styles/components/_page.scss
2021-09-18 12:03:57 +02:00

86 lines
1.8 KiB
SCSS

@use '../colors';
@use '../layout';
@use '../typography';
// This is the wrapper element around individual .page-content blocks. The home
// page contains a few of these sections, while normal pages only contain one.
// Spanning the entire width, sections may have different themes.
.page-section {
padding: layout.$large-gap;
&.inverse {
color: colors.$gray-50;
background-color: colors.$blue-800;
h2:after {
background-color: colors.$gray-50;
}
}
&.footer {
background-color: colors.$teal-500;
}
}
.page-content {
margin: 0 auto layout.$huge-gap auto;
max-width: 60rem;
}
// Banners can be put at the top of a page to draw attention. A banner has
// two children:
// - A .background element which contains an image to render behind the text
// - A .content which holds the actual text.
.page-banner {
display: flex;
flex-direction: column;
justify-content: space-around;
position: relative;
min-height: 60vh;
> .background {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
> .content {
display: flex;
flex-direction: column;
align-items: flex-start;
position: relative;
padding: layout.$normal-gap max(#{layout.$large-gap}, 15vw);
> div {
display: inline-block;
padding: layout.$small-gap layout.$normal-gap;
font-size: typography.$subheading-size;
background-color: colors.$yellow-600;
> p:first-child {
margin-top: 0;
}
> p:last-child {
margin-bottom: 0;
}
}
> .title {
padding: 0 layout.$normal-gap;
line-height: 5rem;
font-size: typography.$title-size;
font-weight: typography.$emphasized-weight;
background-color: colors.$teal-500;
}
}
}