Problem/Motivation

The base styles for inputs is very general and should be a bit more targeted. Currently we have:

  
  input,
  textarea {
    @include type-scale(label, 16);
    background-color: var(--prototype-color-white);
    border: solid 1px var(--prototype-color-dark);
    border-radius: 0;
    max-width: 100%;
    padding: 8px 12px;
  }
  

The broad input specifically targets texted based inputs, submit/reset inputs, checkboxes/radios. We don't want those to be styled the same way by default.

Proposed resolution

Break things out into clearer and more targeted selectors. Group texted based inputs with:

input[type="text"],
input[type="password"],
input[type="date"],
input[type="email"],
input[type="number"],
textarea {}

There are a lot of other types like tel that should be in this list. I could also see adding select as they often share a lot of similarities.

Move things typically button like into:

input[type="submit"],
input[type="reset"] {}

And then finally update the base styles for checkboxes/radios to not assume Drupal specific field markup. Remove the .form-type__checkbox|radio selector and simply use:

input[type="checkbox"],
input[type="radio"] {
  // Styles...

  + label[for] {}
}

Remaining tasks

  1. Open a MR with changes.

Issue fork prototype-3501793

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jnettik created an issue. See original summary.

jldust made their first commit to this issue’s fork.

jldust’s picture

Version: 5.2.1-alpha5 » 5.x-dev
Assigned: Unassigned » jldust

jldust changed the visibility of the branch 3501793-input-styles to hidden.

jldust changed the visibility of the branch 3501793-default-input-styles to hidden.

jnettik’s picture

Status: Active » Needs review

Ready for review

  • jldust committed 3cc20685 on 5.x authored by jnettik
    Issue #3501793 by jnettik: Default input styles are to general
    
jldust’s picture

Status: Needs review » Reviewed & tested by the community

This has been merged in and will be included in the next tagged release.

jldust’s picture

Status: Reviewed & tested by the community » Fixed
jldust’s picture

Status: Fixed » Closed (fixed)