From 0d65ee4eaaa5b5dde4f4d0d44990da3c2d88c134 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sun, 17 Jan 2021 22:20:44 +0100 Subject: Improve news & program pages on mobile --- programmes.css | 119 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 76 insertions(+), 43 deletions(-) (limited to 'programmes.css') diff --git a/programmes.css b/programmes.css index 95907ac..4cb9cb9 100644 --- a/programmes.css +++ b/programmes.css @@ -1,15 +1,6 @@ -main { - display: grid; - grid-template-columns: 50% 50%; -} - -main > div { - padding: 1em; - overflow: auto; -} - #program-list { max-height: 60vh; + overflow: auto; scrollbar-width: thin; scrollbar-color: darkblue #8ad; } @@ -27,46 +18,88 @@ main > div { background: darkblue; } -.programs { - display: grid; - grid-auto-rows: 10em; - grid-template-columns: repeat(auto-fit, minmax(10em, 1fr)); - grid-gap: 0.8em; +details summary .duration { + font-family: monospace; } -.program { - background-color: #099; -} +@media (min-width: 40em) { + main { + display: grid; + grid-template-columns: 50% 50%; + } -.program a { - display: flex; - align-items: center; - justify-content: center; - height: 100%; - width: 100%; - text-decoration: none; - color: inherit; - transition: color 0.5s; -} + main > div { + padding: 1em; + } -.program:hover a { - color: white; -} + .programs { + display: grid; + grid-auto-rows: 10em; + grid-template-columns: repeat(auto-fit, minmax(10em, 1fr)); + grid-gap: 0.8em; + } -.program .summary { - font-weight: bold; - text-align: center; - transition: 0.5s; -} + .program { + background-color: #099; + } -.program:hover .summary { - opacity: 1; -} + .program a { + display: flex; + align-items: center; + justify-content: center; + height: 100%; + width: 100%; + text-decoration: none; + color: inherit; + transition: color 0.5s; + } -details summary .duration { - font-family: monospace; + .program:hover a { + color: white; + } + + .program .summary { + font-weight: bold; + text-align: center; + transition: 0.5s; + } + + .program:hover .summary { + opacity: 1; + } + + .details.active > *:first-child { + margin-top: 0; + } } -.details.active > *:first-child { - margin-top: 0; +@media (max-width: 40em) { + main { + padding-left: 0.8em; + padding-right: 0.8em; + } + + .programs { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(8em, 1fr)); + grid-gap: 0.8em; + grid-auto-rows: 4em; + } + + .program { + background-color: #099; + } + + .program a { + display: flex; + width: 100%; + height: 100%; + justify-content: center; + align-items: center; + text-decoration: none; + } + + .program .summary { + font-weight: bold; + } } -- cgit v1.2.3 From 5f983bd19a422ae515bd19df061f2f03801e4694 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sun, 17 Jan 2021 22:44:43 +0100 Subject: Factor out some CSS in programs page --- programmes.css | 76 ++++++++++++++++++++++------------------------------------ 1 file changed, 29 insertions(+), 47 deletions(-) (limited to 'programmes.css') diff --git a/programmes.css b/programmes.css index 4cb9cb9..87ead6c 100644 --- a/programmes.css +++ b/programmes.css @@ -18,6 +18,31 @@ background: darkblue; } +.programs { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(var(--cell-width), 1fr)); + grid-auto-rows: var(--cell-height); + grid-gap: 0.8em; +} + +.program { + background-color: #099; +} + +.program a { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; + color: inherit; + text-decoration: none; +} + +.program .summary { + font-weight: bold; +} + details summary .duration { font-family: monospace; } @@ -33,41 +58,17 @@ details summary .duration { } .programs { - display: grid; - grid-auto-rows: 10em; - grid-template-columns: repeat(auto-fit, minmax(10em, 1fr)); - grid-gap: 0.8em; - } - - .program { - background-color: #099; + --cell-width: 10em; + --cell-height: 10em; } .program a { - display: flex; - align-items: center; - justify-content: center; - height: 100%; - width: 100%; - text-decoration: none; - color: inherit; transition: color 0.5s; } - .program:hover a { color: white; } - .program .summary { - font-weight: bold; - text-align: center; - transition: 0.5s; - } - - .program:hover .summary { - opacity: 1; - } - .details.active > *:first-child { margin-top: 0; } @@ -80,26 +81,7 @@ details summary .duration { } .programs { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(8em, 1fr)); - grid-gap: 0.8em; - grid-auto-rows: 4em; - } - - .program { - background-color: #099; - } - - .program a { - display: flex; - width: 100%; - height: 100%; - justify-content: center; - align-items: center; - text-decoration: none; - } - - .program .summary { - font-weight: bold; + --cell-width: 8em; + --cell-height: 4em; } } -- cgit v1.2.3