From ac79183603c1fb978e4462b0ec65e544b7ffa753 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 23 Sep 2018 15:08:39 -0700 Subject: [PATCH] Use more CSS grid on body and content_body. I learned that grid-template lets you specify row and col sizes all at once. --- .../etiquette_flask/static/css/common.css | 39 ++-- .../etiquette_flask/templates/photo.html | 6 + .../etiquette_flask/templates/search.html | 32 ++- frontends/etiquette_flask/templates/tags.html | 207 +++++++++--------- 4 files changed, 151 insertions(+), 133 deletions(-) diff --git a/frontends/etiquette_flask/static/css/common.css b/frontends/etiquette_flask/static/css/common.css index a626891..b677c2c 100644 --- a/frontends/etiquette_flask/static/css/common.css +++ b/frontends/etiquette_flask/static/css/common.css @@ -1,7 +1,8 @@ /* Organization: { - display and flexing + own grid area name + display, flexing, gridding positioning and alignment bounding box (width, margin, overflow, ...) borders and shadows @@ -19,26 +20,32 @@ Organization: --color_3d_shadow: rgba(0, 0, 0, 0.5); --color_3d_highlight: rgba(255, 255, 255, 0.5); } + body { - display: flex; - flex-direction: column; + display: grid; + grid-template: + "header" auto + "content_body" 1fr + /1fr; background-color: var(--color_site_theme); } - -pre -{ - white-space: pre-line; -} - #header { + grid-area: header; display: grid; grid-template-columns: 1fr 1fr 1fr 1fr auto; grid-template-rows: auto; margin-bottom: 4px; + + background-color: var(--color_site_transparency); +} +#content_body +{ + grid-area: content_body; + display: grid; } #header button { @@ -50,29 +57,27 @@ pre display: flex; flex: 1; justify-content: center; - - background-color: var(--color_site_transparency); } .header_element:hover { background-color: var(--color_site_secondary); } +pre +{ + white-space: pre-line; +} + .editor_input { width: 100%; max-width: 800px; } + .hidden { display: none !important; } -#content_body -{ - display: flex; - flex: 0 0 auto; - flex-direction: row; -} .gray_button { diff --git a/frontends/etiquette_flask/templates/photo.html b/frontends/etiquette_flask/templates/photo.html index 86d73af..58969cc 100644 --- a/frontends/etiquette_flask/templates/photo.html +++ b/frontends/etiquette_flask/templates/photo.html @@ -13,9 +13,15 @@