Make WordPress Core

Opened 5 days ago

Last modified 15 hours ago

#64763 reviewing defect (bug)

Admin reskin: Remove line-height from input elements

Reported by: wildworks's profile wildworks Owned by: audrasjb's profile audrasjb
Milestone: 7.0 Priority: normal
Severity: normal Version: trunk
Component: Administration Keywords: admin-reskin good-first-bug needs-refresh
Focuses: Cc:

Description

The line-height of the input element has a value of 2.71428571 applied to it, making it equal to a height of 40px. This value also seems to affect the height of the background highlight when text is selected. At least, this behavior can be confirmed on Windows OS and Chrome browsers.

I don't know why this line-height value exists, but it's strange to have a highlight background that extends to the full height of the form.

Attachments (1)

highlighted-background.png (24.7 KB) - added by wildworks 5 days ago.
The background when text in an input element is selected. Comparison of the current style and my proposed style.

Download all attachments as: .zip

Change History (15)

@wildworks
5 days ago

The background when text in an input element is selected. Comparison of the current style and my proposed style.

#1 @audrasjb
4 days ago

  • Keywords good-first-bug added
  • Version set to trunk

Adding good-first-bug keyword as this issue would be a nice bug to fix for new contributors who never submitted any Core patch yet.

#2 @wildworks
4 days ago

@fabiankaegy @joedolson Is there any reason why a line-height value equal to min-height is being applied to form elements? Would simply removing the line-height cause any problems?

This ticket was mentioned in PR #11099 on WordPress/wordpress-develop by @hmrisad.


3 days ago
#3

  • Keywords has-patch added

Remove line-height property from URL and week input styles.

Trac ticket: https://core.trac.wordpress.org/ticket/64763

## Use of AI Tools

@hmrisad commented on PR #11099:


3 days ago
#4

Could you please add the ticket URL to the PR description?

Thanks! I’ve added the ticket URL to the PR description.

#5 @manhar
3 days ago

Tested the patch on trunk.

Removing the line-height keeps the 40px height via min-height and improves text alignment/selection. No visual regressions found in admin screen.

Before Patch:
https://postimg.cc/FYXV0Hb0

After Patch:
https://postimg.cc/yJQRp19N

#6 @audrasjb
3 days ago

  • Owner set to audrasjb
  • Status changed from new to reviewing

@audrasjb commented on PR #11099:


3 days ago
#7

Thanks for the PR!

It applies nicely to standard inputs:
https://github.com/user-attachments/assets/f03c608b-a20e-4ddb-a938-4baae9dd6abf

However it doesn't apply to input fields using "compact" styles:
https://github.com/user-attachments/assets/dc21517d-dc40-41f6-8d0f-d37f378bf5c0

#8 @ozgursar
3 days ago

Patch Testing Report

Patch Tested: https://github.com/WordPress/wordpress-develop/pull/11099

Environment

  • WordPress: 7.0-beta2-61752-src
  • PHP: 8.2.29
  • Server: nginx/1.29.4
  • Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
  • Browser: Chrome 145.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.1

Steps taken

  1. Check an input field in Settings > General
  2. ✅ Patch is solving the problem

Expected result

  • Line height is removed from input elements

Screenshots/Screencast with results

Before
https://i.imgur.com/inm2yTo.png

After
https://i.imgur.com/WhqWVXm.png

This ticket was mentioned in PR #11156 on WordPress/wordpress-develop by @manishxdp.


18 hours ago
#9

## Description
Removes the line-height: 2.71428571 declaration from standard admin input elements. Height remains 40px via min-height; only the line-height is removed.

## Changes

  • File: src/wp-admin/css/forms.css
  • Removed one line-height line from the rule that targets input[type="datetime"] through input[type="week"] (and related types).

## Testing

  • Checked inputs on Settings → General and other admin forms.
  • Confirmed input height unchanged (40px) and selection highlight no longer fills the full field.

Trac: https://core.trac.wordpress.org/ticket/64763

Fixes #64763

@huzaifaalmesbah commented on PR #11156:


17 hours ago
#10

Thanks for the PR.
I noticed there is already an older PR (#11099) for the same issue and it has been reviewed by a committer. Maybe it would be better to continue contributing there instead of opening a new PR.

@manishxdp commented on PR #11156:


17 hours ago
#11

@huzaifaalmesbah Thanks for review. okay noted

#12 @noruzzaman
17 hours ago

Test Report

Patch tested: https://github.com/WordPress/wordpress-develop/pull/11099

Environment

  • WordPress: 7.0-beta2-61809
  • PHP: 8.3.30
  • Server: PHP.wasm
  • Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
  • Browser: Chrome 145.0.0.0
  • OS: macOS
  • Theme: Twenty Fourteen 4.4
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.1

Actual Results

  1. ✅ Issue resolved with patch.
Before After
https://i.ibb.co.com/V0GPv2J6/Before.png https://i.ibb.co.com/P0Rv9Fg/After.png

#14 @wildworks
15 hours ago

  • Keywords needs-refresh added; has-patch removed

Thankyou everyone for working on this ticket.

However it doesn't apply to input fields using "compact" styles:

As mentioned here, there's probably more than one thing that needs to be fixed. Let's try to investigate as much as possible where this problem is occurring.

Note: See TracTickets for help on using tickets.