Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LewisNyman’s picture

FileSize
5.88 KB

Uploaded the css file so it can reviewed with Dreditor

Not really sure where to start here :P Maybe we can split up the file a bit more?

LewisNyman’s picture

Issue summary: View changes
joaogarin’s picture

Not sure if you mean separating the file into two or three files (the file is a bit long). one suggestion would be :

form (form, fieldsets, fieldgroups, legends etc)
form-selects (specific to selects in forms)
form-inputs (input fields and textareas)
form-filters (filters)
form-states (some state specific styling for inputs and other elements such as :hover,:focus etc)

In terms of the selectors. Some of the elements like :

.form-disabled input.form-text,
.form-disabled input.form-tel,
.form-disabled input.form-email,
.form-disabled input.form-url,
.form-disabled input.form-search,
.form-disabled input.form-number,
.form-disabled input.form-color,
.form-disabled input.form-file,
.form-disabled textarea.form-textarea,
.form-disabled select.form-select

shoulb be replaced by

.form-disabled .form-text,
.form-disabled .form-tel,
.form-disabled .form-email,
.form-disabled .form-url,
.form-disabled .form-search,
.form-disabled .form-number,
.form-disabled .form-color,
.form-disabled .form-file,
.form-disabled .form-textarea,
.form-disabled .form-select

#edit-cancel : should be replaced by class in the HTML so that a class could be used here.

We can discuss it a little and I can then try to work on a patch for the file.

LewisNyman’s picture

I think all the general form stuff should stay in form.css, there's loads of stuff that belongs elsewhere though:

  1. /* Filter */
    .filter-wrapper {
      font-size: 0.923em;
    }
    

    File should go in it's own file, but where is this used?

  2. ul.tips,
    div.description,
    .form-item .description {
      margin: 0.2em 0 0 0;
      color: #595959;
      font-size: 0.9em;
    }
    .form-item .description.error {
      color: #a51b00;
    }
    

    There is a lot of overlap here with generic classes. Let's figure out where all these classes are coming from

  3. .confirm-parent,
    .password-parent {
      overflow: visible;
      width: auto;
    }
     
    .form-item .password-suggestions {
      float: left; /* LTR */
      clear: left;
      width: 100%;
    }
    [dir="rtl"] .form-item .password-suggestions {
      float: right;
    }
    .form-item-pass .description {
      clear: both;
    }
    ...
      .password-strength {
        width: 100%;
      }
      div.form-item div.password-suggestions {
        float: none;
      }
    

    Let's move the password related stuff to it's own file

  4. /**
     * Improve spacing of cancel link.
     */
    #edit-cancel {
      margin-left: 10px; /* LTR */
    }
    [dir="rtl"] #edit-cancel {
      margin-left: 0;
      margin-right: 10px;
    }
    ...
      #edit-cancel {
        display: block;
        margin: 10px 0 0 0;
      }
    

    Move this to it's own file, also what is this for?

  5. /* Exceptions */
    #diff-inline-form select,
    div.filter-options select {
      padding: 0;
    }
    

    What is this? We should move it to it's own file... once we figure out what it's for

Here are the results from csslint:

 10 errors found in /Library/WebServer/Documents/core/themes/seven/css/components/form.css
 [L14:C1] Unknown @ rule: @-moz-document. This rule looks for recoverable syntax errors. (errors)
 [L144:C3] Duplicate property 'background' found. Duplicate properties must appear one after the other. (duplicate-properties)
 [L147:C3] Duplicate property 'color' found. Duplicate properties must appear one after the other. (duplicate-properties)
 [L219:C5] Background image '../../../../misc/icons/333333/caret-down.svg' was used multiple times, first declared at line 204, col 5. Every background-image should be unique. Use a common class for e.g. sprites. (duplicate-background-images)
 [L231:C1] Don't use IDs in selectors. Selectors should not contain IDs. (ids)
 [L234:C1] Don't use IDs in selectors. Selectors should not contain IDs. (ids)
 [L292:C3] Don't use IDs in selectors. Selectors should not contain IDs. (ids)
 [L296:C3] Don't use IDs in selectors. Selectors should not contain IDs. (ids)
 [L303:C1] Don't use IDs in selectors. Selectors should not contain IDs. (ids)
 [L304:C1] Element (div.filter-options) is overqualified, just use .filter-options without element name. Don't use classes or IDs with elements (a.foo or a#foo). (overqualified-elements)

mortendk’s picture

in the process of banana concensus ive seen a lot of js dependencies in the form, wonder if we wanna fix that issue here or that should be a seperate issue. What it would result in was a massive overhall of all the js dependency classes or rewrite them call to data-attributes selectors, that might grow this to become a mega patch

LewisNyman’s picture

There should be no js- selectors in this CSS file, so I think we can move it into a separate issue.

joaogarin’s picture

I am trying to find where edit-cancel is being used.. I cant find anything. not from core anyway.

joaogarin’s picture

Regarding number 2 :

My biggest concern here would be the tips. I found this basically applies to the input filter tips when switching between filters in edit content or blocks.

My suggestion would be something like :

.filter-guidelines .tips,
.description,
.form-item .description {
  margin: 0.2em 0 0 0;
  color: #595959;
  font-size: 0.9em;
}
.form-item .description.error {
  color: #a51b00;
}

But I would like to still be sure if it only applies to the filter guidelines or if we keep it more general and just leave ".tips"

".description" also looks a bit too general but I guess this is already a well know class for descriptions (but mostly inside form-item elements)

joaogarin’s picture

FileSize
4.51 KB

Hello,

I have made some adjustments to the file. I separated it into form.css, password.css and cancel-button.css .

There is still an issue with the @-moz-document, I don't know where this is being used and could quite find out if we still need it.

Maybe some more eyes can make some other things more clear so I can work a bit more on it.

joaogarin’s picture

Fixed some issues, namely missing spaces at the end of the files.

joaogarin’s picture

Updating issues status to needs review.

I couldnt find what the following is for , I will keep searching on these missing things I don't know where are used so we can figure out if they are indeed needed.

/* Exceptions */
#diff-inline-form select,
div.filter-options select {
  padding: 0;
}
joaogarin’s picture

Status: Active » Needs review
joaogarin’s picture

By the way I searched core folder entirely for edit-cancel Id and found nothing.

The same for the two exceptions at the end of form.css file diff-inline-form id and filter-options class.

Maybe someone else might know more about what these are and where they are used, if they are.

joaogarin’s picture

Just some screens of some of the forms. More testing required though

LewisNyman’s picture

Status: Needs review » Needs work
  1. --- /dev/null
    +++ b/core/themes/seven/css/components/cancel-button.css
    
    +++ b/core/themes/seven/css/components/cancel-button.css
    @@ -0,0 +1,24 @@
    
    @@ -0,0 +1,24 @@
    +/**
    + * @file
    ...
    + *
    + * Improve spacing of cancel link.
    + */
    +
    

    Now that the cancel links are styled as buttons, we no longer need this CSS. We can delete this file! Yay

  2. +++ b/core/themes/seven/css/components/cancel-button.css
    @@ -0,0 +1,24 @@
    + * Cancel buttons
    

    This comment requires a full stop.

  3. +++ b/core/themes/seven/css/components/form.css
    @@ -1,6 +1,10 @@
     /**
    - * Form elements.
    + * @file
    + * Form
    + *
    + * General form elements
    

    I actually think this was fine before when it just said "Form elements." We don't need the word "form " in there

  4. +++ b/core/themes/seven/css/components/form.css
    @@ -147,13 +150,11 @@ textarea.form-textarea {
    -  color: #333;
    -  border-radius: 2px;
       background: #fcfcfa;
    +  color: #595959;
    

    This is changing the design, I don't think we should do this here.

  5. +++ b/core/themes/seven/css/components/form.css
    --- /dev/null
    +++ b/core/themes/seven/css/components/password.css
    

    Can we call this file "password-suggestions" to match the class?

  6. +++ b/core/themes/seven/css/components/password.css
    @@ -0,0 +1,37 @@
    +.confirm-parent,
    +.password-parent {
    +  overflow: visible;
    +  width: auto;
    +}
    +
    +.form-item .password-suggestions {
    +  float: left; /* LTR */
    +  clear: left; /* LTR */
    +  width: 100%;
    +}
    +[dir="rtl"] .form-item .password-suggestions {
    +  float: right;
    +  clear: right;
    +}
    +.form-item-pass .description {
    +  clear: both;
    +}
    +
    +/**
    + * Improve password elements usability on narrow devices.
    + */
    +@media screen and (max-width: 600px) {
    +  .password-strength {
    +    width: 100%;
    +  }
    +  div.form-item div.password-suggestions {
    +    float: none;
    +  }
    +}
    

    I tried removing this CSS and it doesn't seem to do anything. I think it was overriding the old styling.Can we try removing this?

Manjit.Singh’s picture

Status: Needs work » Needs review
FileSize
2.16 KB
2.62 KB

removing password.css file and cancel-button.css

LewisNyman’s picture

Issue tags: +Needs screenshots

Nice, now we just need to show we aren't causing any regressions.

Manjit.Singh’s picture

Issue tags: +Novice

adding novice tag,

Please take a screenshots of forms of seven theme ;)

manmohandream’s picture

Hi Manjit,

I am attaching some screenshots here. Let me know if this works or we need any specific forms screenshots.

Manjit.Singh’s picture

Please Upload RTL screenshots as well :)

rudraram’s picture

Attaching RTL screenshots

Add Node rtl:
node-add

Add Menu rtl:
menu-add

Add Menu Link rtl:
menu-add

Install new theme rtl:
install theme

LewisNyman’s picture

Status: Needs review » Needs work

I found a few more errors being reported by CSSlint:

Line	Column	Message
29	1	Unknown @ rule: @-moz-document.
71	16	Element (select.form-select) is overqualified, just use .form-select without element name.
213	5	Background image '../../../../misc/icons/333333/caret-down.svg' was used multiple times, first declared at line 198, col 5.
262	3	Don't use IDs in selectors.
269	1	Don't use IDs in selectors.
deepak manhas’s picture

Status: Needs work » Needs review
Issue tags: -Novice
FileSize
1.13 KB
2.82 KB

changes as suggested in #22 by lewis.

Manjit.Singh’s picture

Issue tags: +SrijanSprintNight
LewisNyman’s picture

Status: Needs review » Needs work
Issue tags:
  1. +++ b/core/themes/seven/css/components/form.css
    @@ -210,8 +210,7 @@ select {
    -    background-image: url(../../../../misc/icons/333333/caret-down.svg),
    -    -webkit-linear-gradient(top, #fcfcfa, #e9e9dd);
    +    background-image: -webkit-linear-gradient(top, #fcfcfa, #e9e9dd);
    

    I discussed this with manjit on IRC, it looks like we have to include it twice when we define multiple backgrounds, we should undo this change and we'll just have to put up with the csslint error for now.

  2. +++ b/core/themes/seven/css/components/form.css
    @@ -259,14 +258,14 @@ select {
    -  #dblog-filter-form .form-actions {
    +  .dblog-filter-form .form-actions {
    ...
    -#diff-inline-form select,
    +.diff-inline-form select,
    

    Do these classes exist in the markup? Can we get screenshots to show that it still works?

    Also I think these classes should be moved into their own files. We should use form.css for generic form styling only

LewisNyman’s picture

Status: Needs work » Needs review
Issue tags:
FileSize
11.25 KB

This patch needed a reroll and it was tricky so re-implemented the patch by hand. I found quite a lot of styling to move around. Seven had a lot of mobile only CSS that was overridding module CSS. In those situations I just added a desktop only media query to the original CSS.

joaogarin’s picture

I cant really apply the patch. I think some structure of the folder has changed :

error: core/modules/user/css/user.theme.css: No such file or directory
error: patch failed: core/themes/seven/seven.libraries.yml:28
error: core/themes/seven/seven.libraries.yml: patch does not apply

but regarding the css it looks like this would fixed the issue here : https://www.drupal.org/node/2614198

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

andypost’s picture

Version: 8.9.x-dev » 9.4.x-dev
Status: Needs review » Needs work
Issue tags: +Needs reroll

patch no longer applies

srilakshmier’s picture

Status: Needs work » Needs review
FileSize
11.26 KB

Rerolled patch #26 to 9.4.x-dev.

Thank you

ankithashetty’s picture

Issue tags: -Needs reroll
FileSize
11.13 KB
5.31 KB

Tried to fix custom command failure errors in #37 patch, thanks!

andypost’s picture

Status: Needs review » Needs work

still does not pass

srilakshmier’s picture

Status: Needs work » Needs review
FileSize
11.13 KB
418 bytes

Tried to fix the custom command failure in #38.

Thanks

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

longwave’s picture

Project: Drupal core » Seven
Version: 9.5.x-dev » 1.0.0-alpha1
Component: Seven theme » Code

The Seven theme has been removed from Drupal 10 core. I confirmed that this issue only affects Seven and no other themes included with Drupal core, so I am moving this to the contributed Seven project.