The views form labels don't follow generic core class naming and the form label is made bold where no other form label on a site is bold. I'm not sure what the reason for this is and I'd like to remove this as this would otherwise required extra theming only for views.

[css/views.css]

.views-exposed-form label {
  font-weight: bold;
}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Title: Remove views own form label style » Remove views own form label style of exposed form elements
Issue tags: +VDC

Just update the issue for easier finding. (if you look at the tpl) you will know the difference.

hass’s picture

views-exposed-form.tpl.php :-(. But I see no comment why the label need to be bold.

hass’s picture

Aside the form is missing the element-visible and other classes that we have for blind people.

dawehner’s picture

Well this allows actual theming, that's my oppinion, but probably back in the days you also needed a certain look and field.
Another reason is the special handling of checkboxes, see template_preprocess_views_exposed_form

But sure, cleaner code would be better, so feel free to work on this issue.

xjm’s picture

Title: Remove views own form label style of exposed form elements » Remove view' overridden styling for exposed form element labels
Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.x-dev
Component: Code » views.module
Issue tags: +Novice
xjm’s picture

#1812048: Build the exposed form using form API functions would probably help with some of what @dawehner describes in #4.

dead_arm’s picture

I believe that the views exposed form label styling was removed when the views.css sheet was refactored into views.base.css. Exposed form labels now use the enabled theme's label styling.

hass’s picture

This sounds good. Than we just need zo backport to D7.

dawehner’s picture

Status: Active » Fixed

There is no reason to backport that, as this changes the visual output.

hass’s picture

Status: Fixed » Active

What is the problem with fixing visual inconsistency bugs?

dawehner’s picture

Noone will do it?

hass’s picture

Not sure about your comment. Should I roll a patch?

bookmarvel’s picture

FileSize
103.41 KB

manningpete’s picture

Status: Active » Closed (won't fix)

Adding to bookmarvel's screenshot in comment #13, we created a view in d7 and exposed the filter to test its boldness. Then we created a view in d8 to verify it was no longer bold, but it was in fact still bold. We looked for the .views-exposed-form and found that it is no longer adding any extraneous bolding. The bold comes from the line 38 in drupal.base.css, which adds bold to the .label class.

It seems that the default behavior for labels is now bold, but views css is no longer affecting that, so unless we misunderstand, we think this ticket can be closed (won't fix) because the original issue (that views was adding a class override) is no longer valid.

Also, dawehner and I discussed backporting on IRC and both leaned against it, in that it would change styling in already-live sites with no clear benefit.

hass’s picture

Version: 8.x-dev » 7.x-dev
Status: Closed (won't fix) » Active

What is drupal.base.css? That's your theme. The views style is not consistent with d7 core as I know.

dawehner’s picture

Project: Drupal core » Views (for Drupal 7)
Version: 7.x-dev » 7.x-3.x-dev
Component: views.module » Miscellaneous

Also, dawehner and I discussed backporting on IRC and both leaned against it, in that it would change styling in already-live sites with no clear benefit.

@Hass
Do you have an oppinion about that? This is basically the same problem as we had with the string freeze, but I consider it as worse.

hass’s picture

I think we should make it consistent and fix this bug. We are only removing a bold style here. So if someone has overridden the style in the theme they will not see any difference at all. Others will experience a consistent style within all forms and may be happy. It cannot really break anything, but I leave this up to you now. Just reopened it as #13 and #14 is just wrong.

I've overridden it in my distributions and would be happy to get rid of the overriding, but will not fight for it as it has been fixed in D8.

manningpete’s picture

I'm really sorry I seemed to have made some mistake here, but I honestly do not know what it is. Can you please explain what I wrote in #14 that is "just wrong"? I have been using Drupal for many years but am very new to "contributing" and am trying to do things the right way. I was at a contrib meetup when I posted that, working with another developer, and asked my mentor (YesCT) whether it was appropriate to close it. Is that what was "just wrong"? It would be helpful if you could explain what I did wrong so I don't do it again.

You asked what is drupal.base.css, and I'm not sure if that was rhetorical, but I believe that's the default theme in Drupal 8 that comes with core. Without making any changes to core or any themes, those labels (all labels) are bold.

hass’s picture

This is a D7 or D6 issue, not D8. There is no drupal.base.css in D7 and the issue is already fixed in D8. See #1812048: Build the exposed form using form API functions

manningpete’s picture

My confusion comes from the fact that this was marked as a D8 issue until it was changed to D7 yesterday, after I made my "just wrong" comment. Sorry I misunderstood the issue.

MustangGB’s picture

Issue summary: View changes

Looks like dawehner's prediction in #11 was correct.

DamienMcKenna’s picture

Title: Remove view' overridden styling for exposed form element labels » Remove view' overridden styling for exposed form element labels (backport from D8)
Component: Miscellaneous » User interface

But it does mean we have a novice D7 issue, and I happen to have need of one..

gpollner’s picture

gpollner’s picture

Status: Active » Needs review