diff options
| -rw-r--r-- | actualités.css | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/actualités.css b/actualités.css index d9f1fe0..9df8593 100644 --- a/actualités.css +++ b/actualités.css @@ -18,6 +18,27 @@ background: darkblue; } +.events { + display: grid; + grid-auto-rows: var(--cell-height); + grid-template-columns: repeat(auto-fit, minmax(var(--cell-width), 1fr)); + grid-gap: 0.8em; +} + +.event a { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; + text-decoration: none; +} + +.event .summary { + font-weight: bold; + color: white; +} + @media (min-width: 40em) { main { display: grid; @@ -29,20 +50,12 @@ } .events { - display: grid; - grid-auto-rows: 12em; - grid-template-columns: repeat(auto-fit, minmax(14em, 1fr)); - grid-gap: 0.8em; + --cell-width: 14em; + --cell-height: 12em; } .event a { position: relative; - display: flex; - align-items: center; - justify-content: center; - height: 100%; - width: 100%; - text-decoration: none; } .event img { @@ -61,8 +74,6 @@ .event .summary { opacity: 0; z-index: 1; - font-weight: bold; - color: white; transition: 0.5s; } @@ -82,23 +93,14 @@ } .events { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(10em, 1fr)); - grid-gap: 0.8em; - grid-auto-rows: 8em; + --cell-width: 10em; + --cell-height: 8em; } .event { position: relative; } - .event a { - display: block; - width: 100%; - height: 100%; - text-decoration: none; - } - .event img { object-position: center; object-fit: cover; @@ -108,11 +110,10 @@ .event .summary { position: absolute; + text-align: center; bottom: 0; margin: 0; width: 100%; - text-align: center; - color: white; background: #0008; } } |
