SiteWebAstrolabe/src/scss/components/_posts-list.scss
2021-11-17 01:03:27 +01:00

181 lines
2.9 KiB
SCSS

.news-list {
margin-bottom: 8rem;
.wrapper {
position: relative;
}
&__inner {
display: flex;
flex-direction: column;
}
&__heading {
margin-bottom: 3rem;
color: var(--color-white);
font-weight: 100;
}
&__items {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: 1fr;
grid-column-gap: 1.5rem;
grid-row-gap: 2rem;
}
&__item {
background-color: var(--color-primary);
color: var(--color-dark);
border-radius: 1rem;
&.event,
&.event &-type {
background-color: var(--color-light-blue);
}
&-type {
margin-bottom: auto;
align-self: flex-start;
border-radius: 1rem 0;
padding: .125rem 1rem;
font-size: .875rem;
font-weight: 600;
background-color: var(--color-primary);
}
&-heading {
font-size: 1.125rem;
font-weight: 400;
padding: 1rem 1.5rem;
background-color: rgba(0, 0, 0, .65);
color: #fff;
}
&-date {
font-size: 1rem;
font-weight: 600;
background-color: var(--color-light-gray);
border-radius: 0 0 1rem 1rem;
padding: 1rem 1.5rem;
display: flex;
time + time {
margin-left: auto;
}
}
}
&__link {
border-radius: 1rem;
display: flex;
flex-direction: column;
justify-content: flex-end;
height: 16rem;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
&,
&:visited {
color: var(--color-dark);
text-decoration: none;
}
&:hover {
h3 {
text-decoration: underline;
}
}
}
}
main.home .news-list {
margin-top: 8rem;
margin-bottom: 24rem;
position: relative;
&__inner {
position: absolute;
top: -9rem;
}
}
@media (min-width: 768px) and (max-width: 1199.98px) {
.news-list {
&__items {
grid-template-columns: repeat(3, 1fr);
}
}
}
@media (min-width: 576px) and (max-width: 767.98px) {
.news-list {
&__items {
grid-template-columns: repeat(2, 1fr);
}
}
}
@media (max-width: 575.98px) {
main.posts .news-list {
&__items {
display: block;
}
li + li {
margin-top: 1.5rem;
}
}
}
@media (max-width: 1199.98px) {
main.home .news-list {
margin: 6rem 0;
> svg {
width: 70rem;
overflow: hidden;
}
.wrapper {
max-width: 100%;
margin: 0;
padding: 0;
display: block;
}
&__inner {
position: static;
margin-top: -9rem;
}
&__heading {
margin-left: 1.25rem;
}
&__items {
display: flex;
grid-column-gap: 0;
grid-row-gap: 0;
overflow-x: auto;
padding-bottom: 1rem;
padding-left: 1.25rem;
}
&__item {
flex-shrink: 0;
flex-basis: 16rem;
&:not(:first-child) {
margin-left: 1.5rem;
}
}
.return-link {
margin-right: 1.25rem;
}
}
}