From b8d95ace64d78ffef2b663930235e590f0e672d0 Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 16 Feb 2021 02:47:37 -0600 Subject: [PATCH] css: adjust form input box sizes. Adjust input boxes to fit the screen better on mobile, and to use consistent sizes throughout the site (no ad-hoc overrides to make certain input boxes a bit bigger in random places). On desktop, this makes most input boxes a bit taller and narrower. On mobile, it makes input boxes the full width of the screen. This most notably affects the tag edit box, the comment and forum post box, the wiki page edit box, and the commentary box. --- .../src/javascripts/post_mode_menu.js | 6 ---- .../src/styles/common/simple_form.scss | 27 +++++++++++++---- app/javascript/src/styles/specific/posts.scss | 29 ++----------------- app/logical/dtext_input.rb | 2 +- app/views/api_keys/_form.html.erb | 2 +- app/views/artist_commentaries/_form.html.erb | 4 +-- app/views/artists/_form.html.erb | 4 +-- app/views/bulk_update_requests/_form.html.erb | 2 +- app/views/news_updates/edit.html.erb | 2 +- app/views/news_updates/new.html.erb | 2 +- app/views/pool_elements/_new.html.erb | 2 +- app/views/posts/partials/show/_edit.html.erb | 6 ++-- app/views/uploads/new.html.erb | 12 ++++---- app/views/users/edit.html.erb | 6 ++-- app/views/wiki_pages/_form.html.erb | 2 +- app/views/wiki_pages/new.html.erb | 2 +- 16 files changed, 48 insertions(+), 62 deletions(-) diff --git a/app/javascript/src/javascripts/post_mode_menu.js b/app/javascript/src/javascripts/post_mode_menu.js index d1f3fa871..2a518f62f 100644 --- a/app/javascript/src/javascripts/post_mode_menu.js +++ b/app/javascript/src/javascripts/post_mode_menu.js @@ -124,12 +124,6 @@ PostModeMenu.open_edit = function(post_id) { $("#quick-edit-div").slideDown("fast"); $("#quick-edit-form").attr("data-post-id", post_id); $("#post_tag_string").val($post.data("tags") + " ").focus().selectEnd(); - - /* Set height of tag edit box to fit content. */ - $("#post_tag_string").height(80); // min height: 80px. - var padding = $("#post_tag_string").innerHeight() - $("#post_tag_string").height(); - var height = $("#post_tag_string").prop("scrollHeight") - padding; - $("#post_tag_string").height(height); } PostModeMenu.click = function(e) { diff --git a/app/javascript/src/styles/common/simple_form.scss b/app/javascript/src/styles/common/simple_form.scss index 338f316f4..6f2ed942c 100644 --- a/app/javascript/src/styles/common/simple_form.scss +++ b/app/javascript/src/styles/common/simple_form.scss @@ -31,12 +31,17 @@ form.simple_form { margin-bottom: 1em; input[type=text], input[type=file], input[type=password], input[type=email] { - max-width: 20em; + width: 100%; + max-width: 25em; } .hint { @extend .fineprint; padding-left: 1em; + + @media (max-width: 660px) { + display: none; + } } input.validation-error { @@ -48,10 +53,20 @@ form.simple_form { padding-left: 0; display: block; } + + textarea { + width: 100%; + max-width: 60rem; + max-height: 15rem; + + &.text { height: 20vh; } + &.dtext { height: 40vh; } + } } - textarea { - width: 70%; + select[multiple] { + height: 20vh; + max-height: 15rem; } label { @@ -80,6 +95,7 @@ form.simple_form { form.inline-form { display: table; + width: 100%; > div.input { display: table-row; @@ -87,12 +103,13 @@ form.inline-form { label { text-align: right; + padding-right: 1em; + white-space: nowrap; + width: 1%; } label, input { display: table-cell; - padding-right: 1em; - white-space: nowrap; line-height: 1em; } } diff --git a/app/javascript/src/styles/specific/posts.scss b/app/javascript/src/styles/specific/posts.scss index 56e651cef..82fc193c1 100644 --- a/app/javascript/src/styles/specific/posts.scss +++ b/app/javascript/src/styles/specific/posts.scss @@ -155,10 +155,6 @@ div#c-posts { margin: 1em 0 0.5em; } - #edit textarea { - width: 100%; - } - #favlist { word-wrap: break-word; } @@ -188,14 +184,6 @@ div#c-posts { } } } - - div#quick-edit-div { - textarea { - width: 70%; - height: 4em; - display: block; - } - } } body[data-post-current-image-size="large"] #post-options .image-view-large-link, @@ -253,6 +241,8 @@ div#c-posts, div#c-uploads { /* Container for the tag edit