3
0
mirror of https://git.coop/cotech/website.git synced 2025-12-21 17:47:32 +00:00
Files
cotech-website/assets/css/app.css
Chris Lowis 0858c664c9 Use <dialog> to show co-op info when JS available
This commit progressively enhances the co-op grid to show the contents
of the `/co-op/<id>` page in a HTML `<dialog>` element. This improves
the existing experience by retaining the scroll position and returning
the user to the correct page when the dialog is closed.

In case JS isn't available, and for SEO purposes we link to the co-op
pages as previously (but with the disadvantage that the "close" button
always returns to the homepage irrespective of where the co-op grid is
used).
2025-12-17 12:50:13 +00:00

509 lines
8.6 KiB
CSS

@font-face {
font-family: 'open_sansregular';
src: url("/assets/fonts/OpenSans-Regular-webfont.ttf");
}
@font-face {
font-family: 'open_sansbold';
src: url("/assets/fonts/OpenSans-Bold-webfont.ttf");
}
@font-face {
font-family: 'source_serif_regular';
src: url("/assets/fonts/SourceSerif4-Regular.ttf");
}
@font-face {
font-family: 'source_serif_bold';
src: url("/assets/fonts/SourceSerif4-Bold.ttf");
}
:root {
--measure: 70ch;
--space-unit: 1em;
--space-xxs: calc(0.25 * var(--space-unit));
--space-xs: calc(0.5 * var(--space-unit));
--space-sm: calc(0.75 * var(--space-unit));
--space-md: calc(1.25 * var(--space-unit));
--space-lg: calc(2 * var(--space-unit));
--space-xl: calc(3.25 * var(--space-unit));
--space-xxl: calc(5.25 * var(--space-unit));
--cotech-white: white;
--cotech-black: #000000;
--cotech-light-grey: #646464;
--cotech-dark-grey: #222222;
--cotech-blue: #2DA9D7;
}
* {
max-inline-size: var(--measure);
}
html,
body,
div,
header,
nav,
main,
footer,
section {
max-inline-size: none;
}
p, li, a {
font-family: "open_sansregular", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
color: var(--cotech-white);
font-weight: 300;
line-height: 1.4;
}
h1, h2, h3, h4, h5, h6 {
font-family: "source_serif_regular", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif;
color: var(--cotech-white);
line-height: 1.1;
font-weight: 400;
}
h1, h2 {
border-left: 4px solid var(--cotech-blue);
padding-left: var(--space-xs);
}
h3.title {
font-family: "open_sansregular", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
color: var(--cotech-white);
font-weight: 700;
}
@media (min-width: 48em) {
h1 {
font-size: calc(2.625rem + ((1vw - 0.48rem) * 2.8646));
min-height: 0vw;
}
h2 {
font-size: calc(2rem + ((1vw - 0.48rem) * 1.7361));
min-height: 0vw;
}
h3 {
font-size: calc(1.625rem + ((1vw - 0.48rem) * 1.2153));
line-height: calc(1.2 + ((1vw - 0.48) * -0.1389));
min-height: 0vw;
}
h3.title {
font-size: calc(1.25rem + ((1vw - 0.48rem) * 0.3472));
min-height: 0vw;
}
p.large {
font-size: calc(1.375rem + ((1vw - 0.48rem) * 0.6944));
min-height: 0vw;
}
p.intro {
font-size: calc(1.125rem + ((1vw - 0.48rem) * 0.1736));
min-height: 0vw;
}
p, li, a {
font-size: calc(0.875rem + ((1vw - 0.48rem) * 0.1736));
min-height: 0vw;
}
}
@media (min-width: 120em) {
h1 {
font-size: 4.6875rem;
}
h2 {
font-size: 3.25rem;
}
h3 {
font-size: 2.5rem;
}
h3.title {
font-size: 1.5rem;
}
p.large {
font-size: 1.875rem;
}
p.intro {
font-size: 1.25rem;
}
p, li, a {
font-size: 1rem;
}
}
strong {
font-family: "open_sansbold", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
}
body {
background-color: var(--cotech-black);
}
img {
object-fit: contain;
}
img.greyscale {
filter: grayscale(100);
}
img.rounded {
border-radius: var(--space-sm);
}
img.cover {
object-fit: cover;
height: 100%;
width: 100%;
}
section, footer, header {
padding: var(--space-md);
max-inline-size: 1024px;
margin-left: auto;
margin-right: auto;
}
.w-full {
width: 100%;
}
.box {
background: linear-gradient(180deg, rgba(45, 169, 215, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%);
border: 1px solid var(--cotech-dark-grey);
border-radius: var(--space-sm);
padding: var(--space-md);
display: flex;
flex-direction: column;
justify-content: center;
}
@media screen and (width > 480px) {
.box {
padding: var(--space-lg);
}
}
.stack {
display: flex;
flex-direction: column;
justify-content: flex-start;
}
.stack > * {
margin-block: 0;
}
.stack > * + * {
margin-block-start: var(--space, 1.4rem);
}
.switcher {
display: flex;
flex-wrap: wrap;
gap: var(--space-sm);
}
.large-only {
display: none;
}
.w-two-thirds {
width: 66%;
}
@media screen and (width > 480px) {
.large-only {
display: inline;
}
}
.btn {
padding: var(--space-sm) var(--space-lg);
background: var(--cotech-white);
color: var(--cotech-black);
text-decoration: none;
font-family: "open_sansbold", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
border: 1px solid var(--cotech-white);
border-radius: var(--space-sm);
width: fit-content;
display: flex;
align-items: center;
gap: var(--space-sm);
}
.btn::after {
content: " →";
}
.btn:hover {
border: 1px solid var(--cotech-white);
background: var(--cotech-black);
color: var(--cotech-white);
}
.grid {
display: grid;
grid-gap: var(--space-md);
grid-template-columns: 1fr;
align-items: stretch;
}
.grid__link {
display: flex;
height: 100%;
}
.grid-dense {
grid-template-columns: 1fr 1fr;
}
.grid-uneven {
grid-gap: var(--space-lg);
}
@media (min-width: 420px) {
.grid {
grid-template-columns: 1fr 1fr;
}
.grid-three {
grid-template-columns: 1fr 1fr 1fr;
}
.grid-dense {
grid-template-columns: 1fr 1fr 1fr 1fr;
}
.grid-uneven {
grid-template-columns: 3fr 2fr;
}
}
.header {
display: flex;
padding: var(--space-lg) var(--space-md);
align-items: center;
justify-content: space-between;
}
.header a {
text-decoration: none;
text-transform: uppercase;
}
.header a:hover {
text-decoration: underline;
}
.header_logo-link {
display: flex;
align-items: center;
gap: var(--space-sm);
}
.header_menu-list {
font-family: 'open_sansbold';
list-style-type: none;
display: flex;
gap: var(--space-md);
font-size: 1rem;
letter-spacing: 0.05em;
}
.header_menu-list a {
font-family: 'open_sansbold';
}
.header_burger-btn {
display: none;
background: none;
border: none;
cursor: pointer;
padding: var(--space-xs);
color: var(--cotech-white);
}
.header_close-icon {
display: none;
}
@media screen and (width < 480px) {
.header {
position: relative;
}
.header_burger-btn {
display: flex;
gap: var(--space-xs);
border: 2px solid var(--cotech-white);
border-radius: var(--space-sm);
}
.header_menu-list {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: var(--cotech-black);
flex-direction: column;
justify-content: center;
align-items: center;
gap: var(--space-lg);
font-size: 1.5rem;
z-index: 1000;
transform: translateX(-100%);
}
.header_menu-list.active {
transform: translateX(0);
}
.header_burger-btn.active .header_burger-icon {
display: none;
}
.header_burger-btn.active .header_close-icon {
display: block;
}
.header_burger-btn {
position: relative;
z-index: 1001;
}
}
footer {
h3 {
border-left: none;
padding-left: 0;
}
}
@media screen and (width > 480px) {
footer {
.container {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.reverse {
flex-direction: row-reverse;
}
}
}
.padded {
padding: var(--space-sm);
}
.coop-info-box {
position: relative;
padding: 0;
margin: 0 auto;
overflow: hidden;
background: var(--cotech-white);
border-radius: var(--space-sm);
border: 2px solid var(--cotech-light-grey);
max-width: var(--measure);
}
.coop-info-box__close {
position: absolute;
top: 10px;
right: 10px;
width: 40px;
height: 40px;
border-radius: 50%;
background-color: var(--cotech-white);
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
}
.coop-info-box__close img {
transition: transform 0.3s ease;
}
.coop-info-box__close:hover img {
transform: rotate(90deg);
}
@media screen and (width > 480px) {
.coop-info-box__close {
top: 20px;
right: 20px;
width: 60px;
height: 60px;
}
}
.coop-info-box__close a {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.coop-info-box__content > * {
color: var(--cotech-black);
}
.coop-info-box__content {
padding: var(--space-lg);
}
.coop-info-box .btn {
filter: invert(100%);
}
.coop-info-box h2 {
border-left: none;
padding-left: 0;
}
.coop-info-box__logo {
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
background: var(--cotech-black);
}
#coop-dialog {
max-width: 800px;
max-height: 90vh;
margin-left: auto;
margin-right: auto;
border: none;
border-radius: var(--space-sm);
padding: 0;
background: rgba(0, 0, 0, 0.7);
}
#coop-dialog::backdrop {
background: rgba(0, 0, 0, 0.7);
}
.coop-dialog-container {
overflow-y: auto;
}