drupalux / claro

⛔️ DEPRECATED ⛔️ Project is worked in the Drupal.org issue tracker.
https://www.drupal.org/project/claro
GNU General Public License v2.0
29 stars 15 forks source link

Apply text field style update #57

Closed zolhorvath closed 5 years ago

zolhorvath commented 5 years ago

Issue

This PR fixes #7. Link to the issue

Screenshot / UI changes

Increased font size globally to 16px/1.5 (this is the size that text fields are prepared to). Every brand color is included as variable.

Screenshots (zip)

Testing instructions

After that Drupal is installed, Styleguide will be the front page and you'll have the test form at /contact/testform.

zolhorvath commented 5 years ago

I'd say this is ready for the first review :)

zolhorvath commented 5 years ago

Sorry, this is still WIP (wrong class names)

zolhorvath commented 5 years ago

Form-item classes converted to BEM

zolhorvath commented 5 years ago

New screenshots from my localhost (Chrome, Firefox, Safari on OSX)

textInputTest.zip

lauriii commented 5 years ago

This affects other field types than text fields. If that's intentional, maybe we should rename this issue to include those in the scope?

screen shot 2018-11-26 at 17 05 56

zolhorvath commented 5 years ago

@lauriii

Short answer is yes.

Longer one:

Yes, this does affect other types as well. I'm unsure how to handle this, my initial idea was to handle the situations like this (I mean this autocomplete) by a modifier class.

But for first, let's clarify what we should mean on 'types'.

Type could mean

Current situation is that the mentioned autocomplete also has text type attribute, and the additional magic is controlled by a Drupal script here — worths to mention that it should use a js- prefixed selector for the operation since the current approach is not frontend-agnostic. Besides this, I think that the most basic input type is text since every browser falls back to this if an HTML5 input isn't implemented (e.g. datetime-local, [see] https://robertnyman.com/html5/forms/input-types.html).

Check out this list-gits. I think that Text-related types, Date-related types, and the basics of Color, File and <textarea> could (and should) be covered by this issue:

May be a good idea to forget about the form-text, form-autocomplete or form-email classes and use as less drupalism as possible (targeting these as [type="text"] or [type="email"])?..

zolhorvath commented 5 years ago

Based on a discussion, we will introduce the basics of a standardized form element CSS class set here.

Base class will be form-element. Each input type (or input item name) will get modifiers like form-element--color, form-element--text or form-element--textarea.

zolhorvath commented 5 years ago

@lauriii Refactor happened. I still have to regenerate the screenshots (only the native-one's generation is automated).

Before-after in OSX Chrome:

01--filled-form--mac-os-x--chrome 02--error-states--mac-os-x--chrome 03--inline-error-states--mac-os-x--chrome

zolhorvath commented 5 years ago

Unfortunately screenshots were uploaded to the issue and not here: https://github.com/drupalux/claro/issues/7#issuecomment-445866943

lauriii commented 5 years ago

Thank you @zolhorvath!