Comments

kyuubi’s picture

Hi LewisNyman,

Just started looking at this and begun with the status report system table.

Here is a first patch just for that component.

Some considerations:

  • In terms of markup, I added some sub-component selectors to the status report table component .system-status-report.These components are:
    • The header .system-status-report__header
    • The body .system-status-report__body
    • Each status report entry system-status-report__entry
    • Each status report status entry icon .system-status-report__status-icon
    • Each status report status entry title .system-status-report__status-title
    • Each status report status entry value .system-status-report__status-value
  • I also considered the following states (severity):
    • The error .is-error
    • The warning .is-warning
    • The info .is-info

For this I changed the respective twig file, seven tables.css colors.css (these should probably be moved to a states like states.css or severity.css?) and system system.admin.css.

Also, in regards to the states it feels redundant to have the error state on the entry as well as the status icon. My suggestion is to have it only on the parent but I didn't want to patch it before discussing that.

Let me know if I am on the right track and I will continue working on it. I am still getting used to the new standards as they are, so any guidance is welcome :)

Thanks,

kyuubi’s picture

Status: Active » Needs review
lewisnyman’s picture

Title: Rewrite table components inline with our CSS standards » Rewrite the system status report component inline with our CSS standards
Component: CSS » system.module
Status: Needs review » Needs work

I was thinking that maybe this issue could tackle just the <table> element CSS and related tags, but I guess we are making good progress here with system-status-report so let's carry on.

+++ b/core/modules/system/templates/status-report.html.twig
@@ -18,25 +18,25 @@
-      <tr class="color-{{ requirement.severity_status }}">
+      <tr class="system-status-report__entry is-{{ requirement.severity_status }}">

+++ b/core/themes/seven/css/components/colors.css
@@ -1,15 +1,15 @@
-.color-success {
+.is-success {
...
-.color-warning {
+.is-warning {
...
-.color-error {
+.is-error {

I think that we need to keep these classes as color-x classes. They were added in #2336141: Create reusable color classes as utility classes, so they technically aren't states. Also according to the SMACSS guidelines you are only allows to use states when chained together with a component, on their own they are too generic.

  1. +++ b/core/modules/system/css/system.admin.css
    @@ -194,30 +194,30 @@ small .admin-link:after {
    -.system-status-report .status-icon {
    +.system-status-report__status-icon {
    ...
    -[dir="rtl"] .system-status-report .status-icon {
    +[dir="rtl"] .system-status-report__status-icon {
    ...
    -.system-status-report .status-icon div {
    +.system-status-report__status-icon div {
    

    This is good but is there any chance we can remove the need for the div element within the selector? Can we put everything under the class?

  2. +++ b/core/modules/system/css/system.admin.css
    @@ -194,30 +194,30 @@ small .admin-link:after {
    -.system-status-report .status-icon--error div {
    +.system-status-report__status-icon.is-error div {
    ...
    -.system-status-report .status-icon--warning div {
    +.system-status-report__status-icon.is-warning div {
    

    These classes should stay as --modifiers and not states. I'm pretty sure they fall under the SMACSS definition of variants and not states

  3. +++ b/core/modules/system/css/system.admin.css
    @@ -194,30 +194,30 @@ small .admin-link:after {
    -.system-status-report .status-title {
    +.system-status-report__status-title {
    

    Great

  4. +++ b/core/modules/system/templates/status-report.html.twig
    @@ -18,25 +18,25 @@
    -  <thead>
    +  <thead class="system-status-report__header">
    ...
    -  <tbody>
    +  <tbody class="system-status-report__body">
    

    Do we use these classes anywhere? If we don't we should remove them

  5. +++ b/core/modules/system/templates/status-report.html.twig
    @@ -18,25 +18,25 @@
    -        <td class="status-value">
    ...
    +        <td class="system-status-report__status-value">
    

    Same here, if we don't use this class in CSS we can just remove it from markup

  6. +++ b/core/themes/seven/css/components/colors.css
    index 470537d..18c64ae 100644
    --- a/core/themes/seven/css/components/tables.css
    
    --- a/core/themes/seven/css/components/tables.css
    +++ b/core/themes/seven/css/components/tables.css
    

    Can we move this system-status-report into it's own file? I don't think it makes sense to have it in this file

kyuubi’s picture

Hi LewisNyman,

Thanks for your review!

Makes sense that they are only used as states when used in the component, that was actually where I was heading, however given the https://www.drupal.org/node/2336141 I agree we can maintain them as separate classes.

  1. I assume the reason for that div is to have a placeholder for the icon that sits inside the padded area and has the icon's image dimensions. The way to avoid this I supposed could be to somehow use the background-image in status-icon itself, by using for example, a pseudo element like :before.
  2. Agreed, will fix.
  3. OK
  4. We don't t the moment, however if a theme needs to style those columns one would need to override the twig file to add classes in order to avoid using base elements. If this is the preferred approach I will get ride of them.
  5. Same as above.
  6. Agree 100%.

Will provide a patch with all these changes and get back to you.

Cheers,

lewisnyman’s picture

We don't t the moment, however if a theme needs to style those columns one would need to override the twig file to add classes in order to avoid using base elements. If this is the preferred approach I will get ride of them.

I think that's ok, we don't need to provide every possible class in Classy.

I assume the reason for that div is to have a placeholder for the icon that sits inside the padded area and has the icon's image dimensions. The way to avoid this I supposed could be to somehow use the background-image in status-icon itself, by using for example, a pseudo element like :before.

That sounds like a good idea to me

kyuubi’s picture

Great,

Will give you a patch for everything tomorrow.

kyuubi’s picture

Status: Needs work » Needs review
StatusFileSize
new4.79 KB

Hey,

Ok so I took care of all the issues we identified plus a couple of another ones.

The one thing that is still annoying me is the need for the .system-status-report td in system.admin.css to make the vertical-align:top.

It would be really good to get read of it, but we need the align top here for readability.

Any suggestions?

kyuubi’s picture

Forgot to attach the screens.

idebr’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/system/css/system.admin.css
    @@ -187,37 +187,33 @@ small .admin-link:after {
     .system-status-report td {
    -  padding: 6px;
       vertical-align: top;
     }
    -.system-status-report td:nth-child(-n+2) {
    -  background-color: rgba(0, 0, 0, 0.04);
    -}
    

    This styling is actually used currently in Stark. Is there a reason why this should be removed?

  2. +++ b/core/modules/system/css/system.admin.css
    @@ -187,37 +187,33 @@ small .admin-link:after {
    +.system-status-report__status-icon:before {
    +  content:"";
    

    According to Drupal CSS coding standards every declaration should be followed by a single space, eg. use 'content: ""', instead of 'content:""'.

kyuubi’s picture

Hi idebr,

Thanks for your review!

  1. This seems very specific to be on the system.admin.css. It's setting the first column to grey which for me doesn't make sense from a generic context and will imply all themes to override it. Understood it's being used in Stark but shouldn't it be applied to Stark instead then?
  2. My bad, will put up a patch later tonight for this.

Let me know what you guys think regarding 1)

lewisnyman’s picture

This styling is actually used currently in Stark. Is there a reason why this should be removed?

This styling based off an old design, and is overridden in Seven when it implemented to new design. I think it's ok to remove it here. It makes no sense to include this kind of opinionated design in Stark.

kyuubi’s picture

Status: Needs work » Needs review
StatusFileSize
new4.21 KB
new435 bytes

Attached path and interdiff as per #9.1

lewisnyman’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new878.27 KB
new969 KB

Thanks, these are before/after screenshots in Classy:

Before

After

There are some design differences here, but not user facing, as Seven overrode these anyway. Inline with our CSS standards, modules should not be including this theme-level of styling.

Marking RTBC and we'll see if that makes sense to a committer :)

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

There are some design differences here, but not user facing

Well it is admin user facing if using stark. This change makes the status report much harder to read in stark.

Also can we get screenshots of this in seven

+++ b/core/themes/seven/seven.libraries.yml
@@ -26,6 +26,7 @@ global-styling:
+      css/components/system-status-report.css: {}

Doesn't this mean we should have a screenshots of seven?

lewisnyman’s picture

Issue tags: +Needs screenshots

Well it is admin user facing if using stark. This change makes the status report much harder to read in stark.

The intention of Stark is not to provide a useable interface, it's a functional base theme. It's only selectable as an active theme as a demonstration of Drupal's default output. I think that this issue is just tidying up the separation between the module CSS and the theme CSS.

Doesn't this mean we should have a screenshots of seven?

Ah yes because we need to confirm that the design has not changed in Seven. The previous patch is missing the new system-status-report.css file.

kyuubi’s picture

Status: Needs work » Needs review
StatusFileSize
new4.79 KB
new596 bytes
new361.32 KB
new379.44 KB

Hey,

Sorry guys my bad forgot to add the system status report css file to the commit.

Attaching correct patch along with before and after screens.

idebr’s picture

The intention of Stark is not to provide a useable interface, it's a functional base theme. It's only selectable as an active theme as a demonstration of Drupal's default output. I think that this issue is just tidying up the separation between the module CSS and the theme CSS.

I had a second look after I noted this change earlier in #9 and I have to agree with @LewisNyman here. The styling is too opinionated to apply for all themes and Stark has no theme css of its own, so let's remove it entirely.

One thing I did not see mentioned:

+++ b/core/themes/seven/css/components/tables.css
@@ -124,26 +126,6 @@ th.select-all {
-table.system-status-report td {
-  padding: 12px;
-}

This styling is removed, but never reapplied. This makes the status report a little more dense in Seven. I'll leave this up to @LewisNyman if this is ok.

lewisnyman’s picture

Status: Needs review » Reviewed & tested by the community

This styling is removed, but never reapplied. This makes the status report a little more dense in Seven. I'll leave this up to @LewisNyman if this is ok.

Ah yes, I think that styling was introduced before #1986400: Table style update when tables in Seven didn't have the spacing they have now. It is a design change but it seems like a such a minor change that I don't really see the benefit of keeping the inconsistency across tables.

joelpittet’s picture

Issue tags: -Needs screenshots

Beauty RTBC+1

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record

We should have a CR to tell people about the new classes - there is a change record somewhere that is detailing changes to classes for 8.0.x

kyuubi’s picture

Status: Needs work » Needs review

Hi @alexpott I didn't find a generic CR like that.

What I found are several CRs for different CSS changes.

For the moment at least I created a CR for the system status component which would incorporate any changes to this component (same as for the help component).

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs change record

Thank you @kyuubi. That looks like it has all the bits.

https://www.drupal.org/node/2464095

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

CSS is not frozen in beta. Committed 3d01747 and pushed to 8.0.x. Thanks!

  • alexpott committed 3d01747 on 8.0.x
    Issue #2412949 by kyuubi: Rewrite the system status report component...
nod_’s picture

Looks like the change notice has the class names backwards between D7 and D8

kyuubi’s picture

Hey @nod_,

Thanks for that, honestly dunno what happened there.

Fixed.

joelpittet’s picture

thanks @nod_ and @kyuubi I should have spotted that too:(

Status: Fixed » Closed (fixed)

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