I know we are looking very closely at styling so I wonder why there is a 0.2em left margin for the label in the seven theme? I'm also adding a little cut space between the baseline of the label and the top of the form field which reduces the typographic tension between the descenders and the form field.

If this is something that's already been decided upon, please let me know. I'll add a patch for the changes as soon as I get the issue number.

BEFORE why-0.2em-label-indent.png







AFTER why-0.2em-label-indent.png







BEFORE why-0.2em-label-indent-rtl.png







AFTER why-0.2em-label-indent-rtl.png


Comments

esod’s picture

Title: Why the 0.2em left margin for label in seven? » Why the 0.2em left margin for label in the seven theme?
esod’s picture

Status: Active » Needs review
StatusFileSize
new531 bytes
esod’s picture

Same patch. Added the issue number to its file name.

lewisnyman’s picture

Status: Needs review » Closed (works as designed)

Hi, thanks for the feedback. It was added during #1986418: Update textfield & textarea style so they labels align better with the inputs below them. I guess in your example the input isn't aligned under the label. I'm not sure what to do in this situation.

Changing status to works as designed just for cleanliness, feel free to reopen if you want to continue discussion.

esod’s picture

Status: Closed (works as designed) » Needs work

OMG that's a lot to read. ;) Starting with comment #211 in https://www.drupal.org/node/1986418, the screen shots start to show the 0.2em left margin (or right margin for rtl). And perhaps no one else sees the tension between the baseline/descenders and the top of the form field. I've been looking at type for some time now.

Clearly a lot of eyes have been scrutinizing the seven theme, which is great. But let me ask you, don't you think the labels should flush left with their form fields? Is there an intention to the 0.2em left margin?

lewisnyman’s picture

StatusFileSize
new125.75 KB

I think it is intentional, but I think we were influenced by the example "Title" text and the way the Ascender juts out to the left. It doesn't look too bad without the margin... What do you think?

esod’s picture

What caught my eye originally was the label for the body field. The cap B doesn't need to be indented.







In those days, when typesetting was all we did, you wouldn't add an indent for a letter's arm like the cap T in the title label. See the capital letter F in this page from James Felici The Complete Manual of Typography (2003) for terminology.







Indenting the D in database looks wrong to me in these "before" screen shots:





So yes, I think it looks better without the indent, like in your screen shot in #6. Damn the T. :)

Type is subtle. Check this out. Visually the cap D in Database configuration in the next screen shot looks indented when you view it above the capital letter D in Database type. A type "hint" was probably added by the typeface designer to the larger font size. Should we change that now with code? I don't think so. It's very subtle.


esod’s picture

You don't want to add more things like an indent for one letter, but not, conceivably for another letter. It's type. It may be inconsistent on a purely technical level, but this inconsistency is accepted as the way things are in type. For instance, why are the cap heights of san-serif typefaces taller than the cap heights of serif typefaces? Perhaps three to five hundred years ago there actually was a technical reason. Now, it's just something that's known about cap heights.

To my practiced eye, the 0.2em left margin looks jarring and we should remove it. I think adding the air between the baseline/descenders and the top border of their form fields is a good idea too.

esod’s picture

This is all lingo (cap, cap height, cut space, descender, ascender, arm, air) from the somewhat arcane world of type. I hope I'm not being boring or making it difficult to understand.

lewisnyman’s picture

Ok great :-) I'm convinced. Let's remove this, I will review this patch.

+++ b/core/themes/seven/css/components/form.css
@@ -24,12 +24,13 @@ fieldset {
-  margin: 0 0 0 0.2em; /* LTR */
-  padding: 0;
+  margin: 0; /* LTR */
+  padding: 0 0 0.1em 0;

Is the plan here to have an indent, but less so?
What's the logic in moving the spacing from margin to padding?
Is there a need to reset the margin to 0? It seems better to just delete the line.

esod’s picture

Status: Needs work » Needs review
StatusFileSize
new493 bytes

Yes, better to just delete the line. There's no need to reset the margin to 0.

lewisnyman’s picture

Version: 8.0.0-beta2 » 8.0.x-dev
Assigned: esod » Unassigned
Status: Needs review » Reviewed & tested by the community
Issue tags: -assign css styles +CSS, +frontend, +styleguide

Sorry looks like I forgot to review this last patch. Looks good!

alexpott’s picture

Status: Reviewed & tested by the community » Needs review

From #10

What's the logic in moving the spacing from margin to padding?
esod’s picture

Hi. Wow, I was really into this discussion two months ago. That's okay. I do love typography.

Sure, we can stay with margin changes only. I guess I thought padding: 0: on line 28 of form.css seemed unnecessary.

New patch attached.

lewisnyman’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, this make it much easier to review and approve.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 14: why-0.2em-left-margin-label-seven-2359371-14.patch, failed testing.

Status: Needs work » Needs review

idebr’s picture

Status: Needs review » Needs work

I did some manual testing on this, looks great!

Two minor remarks though

+++ b/core/themes/seven/css/components/form.css
@@ -24,12 +24,12 @@ fieldset {
 label {
...
+  margin: 0 0 0.1em 0; /* LTR */
...
 [dir="rtl"] label {
...
+  margin: 0 0 0.1em 0;

Now that the margins for LTR and RTL are identical, the RTL override can be removed.

+++ b/core/themes/seven/css/components/form.css
@@ -24,12 +24,12 @@ fieldset {
+  margin: 0 0 0.1em 0; /* LTR */

The trailing 0 can removed, it will take the value of the 'right' value.

esod’s picture

Status: Needs work » Needs review
StatusFileSize
new468 bytes

Indeed yes @idebr. Thanks for your eye.

New patch attached, rolled from root directory this time.

idebr’s picture

Sorry to be a pain on such details, but this question was raised before in #10 and #13 and should at least be addressed (not necessarily changed) before RTBC:

What's the logic in moving the spacing from margin to padding?

Thanks for your work and patience on this issue :)

esod’s picture

StatusFileSize
new468 bytes

D'oh! #20 was the patch with the padding. We're going with changes to the margins only. Ignore #20, please.

New patch attached.

lewisnyman’s picture

I'm not sure if adding margins to both sides of the label is a good idea, how does this affect inline form like the views exposed filters? I would prefer to just tweak that value instead of going beyond the objective of the issue.

lewisnyman’s picture

Status: Needs review » Needs work
+++ b/core/themes/seven/css/components/form.css
@@ -24,13 +24,10 @@ fieldset {
-  margin: 0 0 0 0.2em; /* LTR */
+  margin: 0 0 0.1em;

Also, this adds spacing to the bottom of the label. It took me a while of staring to see that :)

esod’s picture

Well sure, adding space to the bottom of the label is my intent. It alleviates the visual tension between the descenders and the top border of the form field. I'll have a look at #23 and comment again.

idebr’s picture

StatusFileSize
new33.33 KB
new54.57 KB

@LewisNyman #23

I'm not sure if adding margins to both sides of the label is a good idea

This patch removes the margin from the side and adds margin to the bottom. Was this a typo or did you misread the patch? :)

Screenshot before:

Screenshot after:

lewisnyman’s picture

Status: Needs work » Reviewed & tested by the community

Sorry I forgot what we were doing for five minutes! Ignore me. Looks like we're good to go then?

esod’s picture

Yes, I think we're good to go. Per @idebr comments, there is no reason to keep [dir="rtl"] label {} since the margin we're changing is now identical to label {}. As well as margin: 0 0 0.1em 0 is identical to margin: 0 0 0.1em;. I'm trying to find a views exposed filters form to check if there's anything amiss. But, otherwise, let's commit this. This is a significant change even if the code change is minor.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

CSS is unfrozen in beta. Committed e631fbf and pushed to 8.0.x. Thanks!

  • alexpott committed e631fbf on 8.0.x
    Issue #2359371 by esod, idebr, LewisNyman: Why the 0.2em left margin for...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.