codepens/grid-collage-layout/dist/style.css

66 lines
1.2 KiB
CSS
Raw Permalink Normal View History

2023-10-06 23:12:53 +02:00
@import "https://unpkg.com/open-props/open-props.min.css";
@import "https://unpkg.com/open-props/normalize.min.css";
*,
*:after,
*:before {
box-sizing: border-box;
}
body {
display: grid;
place-items: center;
min-height: 100vh;
font-family: 'Google Sans', sans-serif, system-ui;
width: 100vw;
overflow-x: hidden;
background: var(--surface-2);
}
ul {
--big-tile-size: 50vmin;
--scale: 0.4;
--rotation: 270deg;
--tile-size: calc(var(--big-tile-size) / 3);
list-style-type: none;
padding: 0;
margin: 0;
display: grid;
gap: 1vmin;
grid-template: repeat(9, var(--tile-size)) / repeat(9, var(--tile-size));
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(var(--scale));
}
img {
--rotation: -270deg;
--scale: 1;
height: 200%;
min-width: 200%;
aspect-ratio: 1;
-o-object-fit: cover;
object-fit: cover;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
li {
padding: 0;
position: relative;
background: hsl(0 0% 75% / 0.2);
max-inline-size: 100%;
}
li {
grid-column: var(--x1, auto) / var(--x2, auto);
grid-row: var(--y1, auto) / var(--y2, auto);
}
li {
border-radius: var(--radius-3);
overflow: hidden;
}