Problem/Motivation

Seven transforms all details summaries to uppercase. The Simpletest results form shows class names as details summaries.

Uppercased class names are very hard to read.

Status quo:
The Simpletest results form in current 8.0.x with an uppercased class name.

Proposed resolution

Remove the uppercasing for the Simpletest results form.

Result:
The Simpletest results form with the patch from this issue applied with a properly cased class name.

Remaining tasks

User interface changes

Class names on the Simpletest results form are no longer uppercased.

API changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LewisNyman’s picture

Issue tags: +frontend, +CSS
LewisNyman’s picture

Status: Needs review » Needs work

Thanks for raising this issue. I didn't notice this.

  1. +++ b/core/themes/seven/css/style.css
    @@ -1581,3 +1581,13 @@ details.fieldset-no-legend {
    +.simpletest-results-form summary {
    

    We should write this class in a way that is reusable, something like .summary--camel-case? Then other modules can use this if they also display camel cased strings in summaries.

  2. +++ b/core/themes/seven/css/style.css
    @@ -1581,3 +1581,13 @@ details.fieldset-no-legend {
    +  text-transform: none;
    

    Maybe this would look better using small caps? It looks a little weird now https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant#Examples

tim-diels’s picture

Assigned: Unassigned » tim-diels

Assigning this to me as part of the Drupal Code Sprint.

tim-diels’s picture

Issue tags: +DUGBE1409
tim-diels’s picture

Status: Needs work » Needs review
FileSize
425 bytes
17.3 KB

I've added the summary.summary-camel-case class that can be used in other modules.

Result:
Screen Shot 2014-09-07 at 15.13.01

LewisNyman’s picture

Status: Needs review » Needs work

Thanks!

+++ b/core/themes/seven/css/style.css
@@ -693,6 +693,11 @@ details summary {
+.simpletest-results-form summary,
+summary.summary--camel-case {

Can we remove the old class and insert that class in to the summary? Then we wouldn't need to have both.

Also, we can remove the element from the selector and just have .summary--camel-case

LewisNyman’s picture

Issue tags: +Novice

Novice task

The last submitted patch, 5: seven-simpletest-no-uppercase-2331907-5.patch, failed testing.

alvar0hurtad0’s picture

Assigned: tim-diels » Unassigned
Status: Needs work » Needs review
FileSize
396 bytes

Previous patch now (with the new file structure) don't apply.

this new one applies and solves the problem.

LewisNyman’s picture

Status: Needs review » Needs work
+++ b/core/themes/seven/css/base/elements.css
@@ -27,6 +27,9 @@ summary,
+#edit-drupalsystemtestsactionactionunittest summary{
+  text-transform: none;
+}

hmm I'd still rather not use IDs, classes are better, a reusable class is great.

alvar0hurtad0’s picture

alvar0hurtad0’s picture

Status: Needs work » Needs review

Ups,

I forgot the status

jOksanen’s picture

Taking this up, fixing the whitespace and reviewing.

jOksanen’s picture

Added a whitespace to keep the CSS format correct, and reviewed the patch by running tests.

jOksanen’s picture

lduerig’s picture

Tested, works in lowercase.

lduerig’s picture

Status: Needs review » Reviewed & tested by the community
LewisNyman’s picture

Status: Reviewed & tested by the community » Needs work

hm, so patch #5 had styling like this:

+++ b/core/themes/seven/css/style.css
@@ -693,6 +693,11 @@ details summary {
+.simpletest-results-form summary,
+summary.summary--camel-case {
+  text-transform: none;
+  font-variant: small-caps;
+}

But now patch #15 has styling like this?

+++ b/core/themes/seven/css/base/elements.css
@@ -27,6 +27,9 @@ summary,
+.simpletest-results-form summary {
+  text-transform: none;
+}

Can we also use the summary--camel-case class? I'm happy to help to show how we will add the class to the right elements

lduerig’s picture

Here's a new patch with both classnames

lduerig’s picture

Status: Needs work » Needs review
jOksanen’s picture

Yes, my bad. The latest one seems to be correct.

jOksanen’s picture

Status: Needs review » Reviewed & tested by the community

Setting as RTBC.

LewisNyman’s picture

Status: Reviewed & tested by the community » Needs work

Thanks, we are still using the previous styling, I think the styling with the small caps is good (see #5).

I would love it if we could do two tother things:
1. Remove the summary from summary.summary--camel-case as it is not needed
2. Remove .simpletest-results-form summary and then apply the .summary--camel-case to the simple test summary elements. This will involve some php but we can do that after the other stuff

Outi’s picture

So this is a patch with the small-caps font-variant and only the .summary--camel-case class, but the .summary--camel-case class hasn't yet been applied to the simple test summary elements.

LewisNyman’s picture

Issue summary: View changes

Working on adding the class

LewisNyman’s picture

Ok I added this class to only simpletest summary elements. I'm not sure if I'm checking the right variable though.

Status: Needs review » Needs work

The last submitted patch, 27: seven_theme_uppercasing_simpletest-2331907-27.patch, failed testing.

LewisNyman’s picture

Status: Needs work » Needs review
FileSize
702 bytes
1.15 KB

Go tests!

alvar0hurtad0’s picture

Status: Needs review » Reviewed & tested by the community

I works fine for me

tstoeckler’s picture

+++ b/core/themes/seven/seven.theme
@@ -232,3 +232,14 @@ function seven_form_node_form_alter(&$form, FormStateInterface $form_state) {
+  if( isset($variables['element']['summary']['#theme']) && $variables['element']['summary']['#theme'] == 'simpletest_result_summary') {

Minor:
if( isset... -> if (isset...

(Can maybe be fixed during commit?!)

Also noting that in light of all the "move classes in X from preprocess to templates" issues it would be possible to make simpletest use a "details--simpletest-result-summary" theme suggestion for the given details element. I personally think that would be a bit too specific but I'm also not really involved in that initiative.

Thus, leaving at RTBC. Thanks everyone for the hard work on this!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

But the second part that is all has no caps looks weird with the font-variant: small-caps; - why are we doing this? Also it is not camel case - our class names are Drupal\user\Tests\UserPasswordResetTest - not that \user\ is not camel case.

dinarcon’s picture

Issue summary: View changes
Issue tags: +Needs reroll
FileSize
152.47 KB

Based on @alexpott comment in #32 and making the suggested change in the original report, we can apply @jOksanen suggestion in #15. The patch no longer applies. This needs a reroll.

Result:
SimpleTest result summary

psebborn’s picture

After speaking with dinarcon during Core Mentoring hours, I'll look at getting this reroll done tonight.

psebborn’s picture

Rerolled patch from #15.
Conflicted in merge, where a comment had been added since. I changed the order so the comment related to the CSS below..

/**
 * Reusable heading classes are included to help modules change the styling of
 * headings on a page without affecting accessibility.
 */
psebborn’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
tim-diels’s picture

I tested this and seems ok to me + Screenshot attached.
Anyone else can say if it's fine?

Result:
Screen Shot 2015-03-20 at 14.34.30

LewisNyman’s picture

Status: Needs review » Reviewed & tested by the community

Sounds good, not a perfect solution but at least we fix this bug.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed f8bf34c and pushed to 8.0.x. Thanks!

  • alexpott committed f8bf34c on 8.0.x
    Issue #2331907 by LewisNyman, alvar0hurtad0, tim-diels, tstoeckler,...

Status: Fixed » Closed (fixed)

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