From e5da1f532334a265e1b1c88d2a942e92654370d6 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Sun, 13 Jun 2021 00:14:38 +0200 Subject: Replace the flex layout in favor of a grid layout This commit replaces the initial CSS flexbox layout for forms of the admin theme with a more elegant approach called "grid layout". :) Some interesting information: https://www.w3schools.com/css/css_grid.asp https://blog.logrocket.com/flexbox-vs-css-grid/ --- theme/admin/rsrc/css/main.scss | 99 ++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 53 deletions(-) (limited to 'theme/admin/rsrc/css/main.scss') diff --git a/theme/admin/rsrc/css/main.scss b/theme/admin/rsrc/css/main.scss index c60f354..e00c60a 100644 --- a/theme/admin/rsrc/css/main.scss +++ b/theme/admin/rsrc/css/main.scss @@ -527,83 +527,72 @@ table, td { } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Form flex-box +# Grids ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -form { - border: 0.05rem solid #AAA; -} - -.flex { - display: flex; - width: 100%; - justify-content: center; - overflow: hidden; - box-sizing: border-box; +.form-grid { + display: grid; + grid-template-columns: 8rem auto 8rem auto; - + .flex { - border-top: 0.05rem solid #AAA; - } -} - -.flex > .flex-item { - border-right: 0.05rem solid #AAA; - display: flex; - width: 100%; + border-left: 0.05rem solid #AAA; + border-bottom: 0.05rem solid #AAA; - &:last-child { - border-right: none; + &.two-columns { + grid-template-columns: auto auto; } - > div { + > label { display: flex; align-items: center; - padding: 0.5rem; - box-sizing: border-box; + background: #DDD; - + div { - border-left: 0.05rem solid #AAA; + .fa { + margin-left: 0.5rem; + margin-right: 1rem; } } -} -.flex.flex-responsive > .flex-item { - width: 50%; -} - -.form-icon-flex { - background: #DDD; - width: 10%; - justify-content: center; + &-item, + > label { + padding: 0.5rem; + border-top: 0.05rem solid #AAA; + border-right: 0.05rem solid #AAA; + } } -.form-label-flex { - background: #DDD; - width: 30%; - border-left: none !important; -} +.form-border-box { + border: 0.05rem solid #AAA; -.form-field-flex { - width: 60%; -} + &.padding { + padding: 0.5rem; + } -.background { - background: #DDD; -} + &.background { + background: #DDD; + } -.flex-padding { - padding: 0.5rem; -} + &.nobordertop { + border-top: none; + } -.flex-direction-column { - flex-direction: column; + +.form-border-box { + border-top: none; + } } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Form buttons ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +#emoticon-list-wrapper { + display: flex; + width: 100%; + justify-content: center; + box-sizing: border-box; +} + #button-list-wrapper { border-bottom: 0.05rem solid #AAA; background: #EEE; + overflow: hidden; } .button-list { @@ -641,6 +630,10 @@ form { #content-editor { border: none; margin: 0; + + &-wrapper { + border-top: none; + } } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -664,7 +657,7 @@ input, select, textarea { textarea { font-family: "Kadwa", "sans-serif"; box-sizing: border-box; - display: inline-block; + display: block; resize: vertical; min-height: 15rem; line-height: 1.2rem; -- cgit v1.2.3