From 5c6906cef4d4858bfe8d00de94eb797aa40b31fd Mon Sep 17 00:00:00 2001 From: Rapha S Date: Fri, 22 Dec 2023 06:49:05 +0200 Subject: [PATCH] Fixed #35008 -- Added CSS rule for HTML tags with no type. Minifiers remove the default (text) "type" attribute from "input" HTML tags. This adds input:not([type]) to make the CSS stylesheet work the same. --- .../contrib/admin/static/admin/css/base.css | 19 ++++++++++++++----- .../admin/static/admin/css/responsive.css | 5 +++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/django/contrib/admin/static/admin/css/base.css b/django/contrib/admin/static/admin/css/base.css index 2f7557fa1b..aaa9c3441a 100644 --- a/django/contrib/admin/static/admin/css/base.css +++ b/django/contrib/admin/static/admin/css/base.css @@ -482,8 +482,13 @@ textarea { vertical-align: top; } -input[type=text], input[type=password], input[type=email], input[type=url], -input[type=number], input[type=tel], textarea, select, .vTextField { +/* +Minifiers remove the default (text) "type" attribute from "input" HTML tags. +Add input:not([type]) to make the CSS stylesheet work the same. +*/ +input:not([type]), input[type=text], input[type=password], input[type=email], +input[type=url], input[type=number], input[type=tel], textarea, select, +.vTextField { border: 1px solid var(--border-color); border-radius: 4px; padding: 5px 6px; @@ -492,9 +497,13 @@ input[type=number], input[type=tel], textarea, select, .vTextField { background-color: var(--body-bg); } -input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, -input[type=url]:focus, input[type=number]:focus, input[type=tel]:focus, -textarea:focus, select:focus, .vTextField:focus { +/* +Minifiers remove the default (text) "type" attribute from "input" HTML tags. +Add input:not([type]) to make the CSS stylesheet work the same. +*/ +input:not([type]):focus, input[type=text]:focus, input[type=password]:focus, +input[type=email]:focus, input[type=url]:focus, input[type=number]:focus, +input[type=tel]:focus, textarea:focus, select:focus, .vTextField:focus { border-color: var(--body-quiet-color); } diff --git a/django/contrib/admin/static/admin/css/responsive.css b/django/contrib/admin/static/admin/css/responsive.css index bb539456d3..b9553415d7 100644 --- a/django/contrib/admin/static/admin/css/responsive.css +++ b/django/contrib/admin/static/admin/css/responsive.css @@ -174,6 +174,11 @@ input[type="submit"], button { font-size: 0.875rem; } + /* + Minifiers remove the default (text) "type" attribute from "input" HTML + tags. Add input:not([type]) to make the CSS stylesheet work the same. + */ + .form-row input:not([type]), .form-row input[type=text], .form-row input[type=password], .form-row input[type=email],