Problem/Motivation

See: #1995272: [Meta] Refactor module CSS files inline with our CSS standards

Proposed resolution

The page in question can be seen on admin/reports/translations after language modules are enabled.
Review the CSS against our standards, see:
http://drupal.org/node/1887918#best-practices
https://www.drupal.org/node/2408617
#1190252: [573] Use csslint as a weapon to beat the crappy CSS out of Drupal core

Remaining tasks

Run CSSlint against the new CSS

User interface changes

None

API changes

None

CommentFileSizeAuthor
#69 reroll_diff_64-69.txt1.92 KBsagarchauhan
#69 2485497-69.patch3.69 KBsagarchauhan
#68 2485497-nr-bot.txt85 bytesneeds-review-queue-bot
#64 interdiff-61_64.txt1.81 KBGauravvvv
#64 2485497-64.patch3.75 KBGauravvvv
#63 interdiff_[61]-[63].txt552 bytesRishabh Vishwakarma
#63 2485497-63.patch2.87 KBRishabh Vishwakarma
#61 interdiff-59_61.txt541 bytesGauravvvv
#61 2485497-61.patch2.51 KBGauravvvv
#60 2485497-nr-bot.txt1.16 KBneeds-review-queue-bot
#59 2485497-59.patch2.51 KBGauravvvv
#58 2485497-nr-bot.txt162 bytesneeds-review-queue-bot
#48 interdiff-2485497-43-47.txt1.67 KBryanhayes
#47 csslint-output.txt592 bytesryanhayes
#47 css-ltr-additions_1887862-47.patch2.92 KBryanhayes
#43 interdiff-2485497-41-43.txt533 bytesstarshaped
#43 2485497-43.patch1.84 KBstarshaped
#41 2485497-41.patch1.95 KBstarshaped
#38 interdiff-2485497-32-38.txt373 bytesstarshaped
#38 2485497-38.patch2 KBstarshaped
#32 interdiff-2485497-27-32.txt407 bytesmarkdorison
#32 clean_up_locale_css-2485497-32.patch2.17 KBmarkdorison
#27 2485497-25.patch2 KBstarshaped
#27 interdiff-2485497-18-25.txt1.08 KBstarshaped
#25 clean_up_locale_css-2485497-25.patch2 KBreedcodes
#18 clean_up_locale_css-2485497-18.patch1.51 KBAjitS
#16 interdiff-1-14.txt920 bytesMathieuSpil
#16 clean-up-locale-css-2485497-16.patch1.5 KBMathieuSpil
#14 optimised-css-2485497-14.patch1.56 KBSixZeroNine
#10 optimised-css-2485497-10.patch2.29 KBSixZeroNine
#9 optimised-css-2485497-9.patch2.24 KBSixZeroNine
#8 optimised-css-2485497-8.patch2.24 KBSixZeroNine
#7 changed-id's-to-classes-and-fixed-coding-standards-2485497-7.patch2.22 KBSixZeroNine
#3 Screen Shot 2015-06-07 at 16.43.22.png50.5 KBMathieuSpil
#1 Screen Shot 2015-05-09 at 3.00.46 pm.png23.33 KBrudraram
#1 Screen Shot 2015-05-09 at 2.50.10 pm.png29.72 KBrudraram
#1 clean-up-locale-css-2485497-1.patch1.5 KBrudraram
locale.admin_.css_.txt3.11 KBLewisNyman

Issue fork drupal-2485497

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rudraram’s picture

Added patch and screenshots.

Before
before

After
after

rudraram’s picture

Status: Active » Needs review
MathieuSpil’s picture

Issue summary: View changes
Status: Needs review » Needs work
FileSize
50.5 KB

@rudraram:
Thanks for looking into this.

It seems like all the lint-errors would be fixed by patch #1.

Lint errors were:
[16:32:46] 12 errors found in /Applications/MAMP/htdocs/drupal8_local/core/modules/locale/css/locale.admin.css
[16:32:46] [L62:C1] Don't use IDs in selectors. Selectors should not contain IDs. (ids)
[16:32:46] [L65:C1] Don't use IDs in selectors. Selectors should not contain IDs. (ids)
[16:32:46] [L65:C33] Element (th.select-all) is overqualified, just use .select-all without element name. Don't use classes or IDs with elements (a.foo or a#foo). (overqualified-elements)
[16:32:46] [L68:C1] Don't use IDs in selectors. Selectors should not contain IDs. (ids)
[16:32:46] [L71:C1] Don't use IDs in selectors. Selectors should not contain IDs. (ids)
[16:32:46] [L71:C1] Rule is empty. Rules without any properties specified should be removed. (empty-rules)
[16:32:46] [L73:C1] Don't use IDs in selectors. Selectors should not contain IDs. (ids)
[16:32:46] [L85:C1] Don't use IDs in selectors. Selectors should not contain IDs. (ids)
[16:32:46] [L90:C1] Don't use IDs in selectors. Selectors should not contain IDs. (ids)
[16:32:46] [L127:C3] Don't use IDs in selectors. Selectors should not contain IDs. (ids)
[16:32:46] [L130:C3] Don't use IDs in selectors. Selectors should not contain IDs. (ids)
[16:32:46] [L130:C35] Element (th.status) is overqualified, just use .status without element name. Don't use classes or IDs with elements (a.foo or a#foo). (overqualified-elements)

Some thoughts:
1) The current page breaks with me locally:

But this isn't because of the patch itself, it seems to be broken by a other previous commit.

2) The css will need some more refactoring:

.locale-translate-filter-form .form-item-langcode,
.locale-translate-filter-form .form-item-translation,
.locale-translate-filter-form .form-item-customized {
  float: left; /* LTR */
  margin-right: 1em; /* LTR */
  margin-bottom: 0;
  /**
   * In Opera 9, DOM elements with the property of "overflow: auto"
   * will partially hide its contents with unnecessary scrollbars when
   * its immediate child is floated without an explicit width set.
   */
  width: 15em;
}
[dir="rtl"] .locale-translate-filter-form .form-item-langcode,
[dir="rtl"] .locale-translate-filter-form .form-item-translation,
[dir="rtl"] .locale-translate-filter-form .form-item-customized {
  float: right;
  margin-left: 1em;
  margin-right: 0;
}
.locale-translate-filter-form .form-type-select select {
  width: 100%;
}

We shouldn(y be using 3 lines of selectors, instead, this should be something like:.locale-translate-filter-form .form-item

Also the overuse of comments I found very strange

MathieuSpil’s picture

Issue summary: View changes
rudraram’s picture

@MathieuSpil I agree with you. I will work and re-factor the selectors.

@LewisNyman Any thoughts on the comments use in the file?

LewisNyman’s picture

I think the comment is ok. If we need a multi-line comment then I think that's fine.

SixZeroNine’s picture

Changed ID's to classes, fixed CSS to follow coding standards.

SixZeroNine’s picture

Optimised selectors:
[dir="rtl"] .locale-translate-filter-form .form-item-langcode,
[dir="rtl"] .locale-translate-filter-form .form-item-translation,
[dir="rtl"] .locale-translate-filter-form .form-item-customized

SixZeroNine’s picture

Removed space.

SixZeroNine’s picture

Optimised selectors for:
.locale-translate-filter-form .form-item-langcode,
.locale-translate-filter-form .form-item-translation,
.locale-translate-filter-form .form-item-customized
[dir="rtl"] .locale-translate-filter-form .form-item-langcode,
[dir="rtl"] .locale-translate-filter-form .form-item-translation,
[dir="rtl"] .locale-translate-filter-form .form-item-customized

Changed ID's to classes.

SixZeroNine’s picture

Status: Needs work » Needs review
LewisNyman’s picture

Status: Needs review » Needs work
+++ b/core/modules/locale/css/locale.admin.css
@@ -1,9 +1,7 @@
-.locale-translate-filter-form .form-item-langcode,
-.locale-translate-filter-form .form-item-translation,
-.locale-translate-filter-form .form-item-customized {
+.locale-translate-filter-form [class*="form-item"] {

Thanks, I think that this selector is too broad. It could affect other form item elements by mistake. I think for now maybe we are better just using the classes we have right now.

SixZeroNine’s picture

Assigned: Unassigned » SixZeroNine
SixZeroNine’s picture

Yes, I agree. That is also applying to this:

-[dir="rtl"] .locale-translate-filter-form .form-item-langcode,
-[dir="rtl"] .locale-translate-filter-form .form-item-translation,
-[dir="rtl"] .locale-translate-filter-form .form-item-customized {
+[dir="rtl"] .locale-translate-filter-form [class*="form-item"] {
SixZeroNine’s picture

Assigned: SixZeroNine » Unassigned
Status: Needs work » Needs review
MathieuSpil’s picture

As a summary I added the interdiff between #1 and #14.
The patches don't apply anymore, but next to that, I don't think the changes aren't needed started from #1?

Therefor I rerolled the patch from #1, Not sure why the first patch didn't apply anymore...

Status: Needs review » Needs work

The last submitted patch, 16: clean-up-locale-css-2485497-16.patch, failed testing.

AjitS’s picture

Status: Needs work » Needs review
FileSize
1.51 KB

Patch from #16 was not applicable. Rerolled.

Amerie’s picture

Patch from #18 applies cleanly for me and looks good. Note that on a fresh installation it is overridden by CSS in the "Stable" base theme.

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.

markdorison’s picture

Version: 8.1.x-dev » 8.2.x-dev
Status: Needs review » Reviewed & tested by the community
xjm’s picture

Assigned: Unassigned » star-szr

Thanks for working on this! Assigning frontend RTBC issues to Cottser for possible review.

star-szr’s picture

Assigned: star-szr » Unassigned
Status: Reviewed & tested by the community » Needs work
Issue tags: +RTL

Looks like a solid improvement overall, thanks everyone.

When testing in RTL and reviewing the CSS I noticed that this report form has some RTL inconsistencies so I created a separate issue to discuss that. Potentially converting this to <details> is the best way to fix that.

For now can we please add /* LTR */ comments that are missing? https://www.drupal.org/node/1887862#rtl

  1. .locale-translation-update__wrapper {
      background: transparent url(../../../misc/menu-collapsed.png) left .6em no-repeat;
      margin-left: -12px;
      padding-left: 12px;
    }
    .expanded .locale-translation-update__wrapper {
      background: transparent url(../../../misc/menu-expanded.png) left .6em no-repeat;
    }
    • Background positioning to the left - needs LTR comments.
    • The margin/padding I'm fairly sure also needs LTR comments.
  2. .locale-translation-update__details li {
      margin: 0 0 0.25em 1.5em;
      padding: 0;
    }
    

    Left margin - should have an LTR comment.

star-szr’s picture

Forgot to link this up to the related issue I created.

reedcodes’s picture

Status: Needs work » Needs review
FileSize
2 KB

New patch with /* LTR */ comments added per request. This is my first contrib and I'm working with cwells and starshaped at #d4dBoston!

darketaine’s picture

@andrea.piernock an interdiff would be useful to review this. Here are some instructions on how to do it :)

starshaped’s picture

I went ahead and created an interdiff. This is my first time ever creating one so be gentle :) Let me know if this looks good to review.

reedcodes’s picture

@darketaine: thanks for the link and the info on adding an interdiff! and thanks to @starshaped for adding the interdiff :)

benjifisher’s picture

@starshaped: Thanks for providing the interdiff. I hope my criticism is constructive and gentle.

It looks as though you uploaded another copy of the patch from #25 when you added the interdiff. Not a big problem, but it does mean

  1. The testbot does a little extra work re-testing the same patch.
  2. If the maintainer agrees to commit the patch, then (s)he has to spend a minute or two deciding which link to download.

In the interest of avoiding #2, I have checked: the patches attached to #25 and #27 are identical.

Looking at the issue summary, there is one remaining task:

  • Run CSSlint against the new CSS
benjifisher’s picture

Issue summary: View changes

Updating the list of remaining tasks in the issue summary.

sugaroverflow’s picture

first time doing a CSSLint task :)

I ran the patch through a CSS linter and got 1 warning:
At line 104, character 3: The property -epub-hyphens is compatible with -moz-hyphens and should be included as well.

I'm not really sure how to proceed..

markdorison’s picture

Resolved the CSSLint warning reported in #31.

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

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now 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.

anouschka42’s picture

I'm looking at this issue @DrupalCon Dublin

benjifisher’s picture

Looking at the interdiff from #32, it looks as though it might be unrelated to this issue. If so, we should probably use the earlier patch. Has anyone checked whether there is already an issue to deal with -epub-hyphens?

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

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now 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.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now 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.

starshaped’s picture

I went ahead and removed -epub-hyphens, and checked to see if an issue for this exists already. One does not, so should I create an issue for this?

Also, since the only CSS Lint error pertains to -epub-hyphens and this is an issue that will be taken care of in a yet to be created issue, does this mean the CSS Lint task here is completed?

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

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now 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.

starshaped’s picture

Opened a follow-up issue to add -epub-hyphens to locale's css: #2940160: Add -epub-hyphens to locale's css

starshaped’s picture

Re-rolled patch to fix apply failures.

benjifisher’s picture

Status: Needs review » Needs work

In the patch from #16, I see

-#locale-translation-status-form .label {
+.locale-translation-status-form .label {
   color: #1d1d1d;
   font-size: 1.15em;
   font-weight: bold;
 }

That is a +1-1 change with a few lines of context. In the later patches, I see

-#locale-translation-status-form .description {
+.locale-translation-status-form .label {
+  color: #1d1d1d;
+  font-size: 1.15em;
+  font-weight: bold;
+}
+.locale-translation-status-form .description {

That is a +6-1 change. In other words, it introduces three new rules for the selector .locale-translation-status-form .label. I think this is accidentally reverting #2573139: Followup: Remove unneeded label class from admin/reports/translations.

starshaped’s picture

After reviewing #2573139: Followup: Remove unneeded label class from admin/reports/translations, it does appear that .locale-translation-status-form .label is being re-added when it shouldn't be. Updated the patch by taking out this selector.

starshaped’s picture

Status: Needs work » Needs review
benjifisher’s picture

Status: Needs review » Needs work

Sorry I did not notice this earlier, but https://www.drupal.org/node/1887862#rtl (already mentioned by @Cottser in Comment #23) says that, in addition to the /* LTR */ comment, we should add the corresponding [dir="rtl"] variant of the rules. This has already been done for existing LTR comments, but I think we have to do it for the ones we add in this issue.

I would like to see the results of the linter.

rakesh.gectcr’s picture

Issue tags: +Nwdug_may18
ryanhayes’s picture

This patch is built on top of #43's patch. I've added the [dir="rtl"] to the rules with the comments next to them and i've added -epub-hyphens as it still appeared as an error from CSSLint. I'll attach the rest of the CSSLint output to this too.

ryanhayes’s picture

Status: Needs work » Needs review
FileSize
1.67 KB

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

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now 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.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.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.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). 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.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now 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.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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.

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

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
FileSize
162 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Gauravvvv’s picture

Status: Needs work » Needs review
FileSize
2.51 KB

I have refactored the CSS file.
1. Replaced all the ID selectors with class selectors.
2. margin-left, right properties replaced with margin-inline-start, end so it can be used in LTR & RTL.

Please review.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
FileSize
1.16 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Gauravvvv’s picture

Status: Needs work » Needs review
FileSize
2.51 KB
541 bytes

Fixed CCF and attached interdiff for same.

smustgrave’s picture

Status: Needs review » Needs work

There are few instances of hardcoded colors. Should those be variables or least the 6 character colors?

Rishabh Vishwakarma’s picture

Status: Needs work » Needs review
FileSize
2.87 KB
552 bytes

Updated #61 according to #62

Gauravvvv’s picture

Added color variables and added interdiff with #61, for same. please review

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Thanks @Gauravv!

catch’s picture

Title: Clean up locale CSS inline with our CSS standards » Clean up locale CSS in line with our CSS standards

Just adding a space because I keep thinking this is about inline styles.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
FileSize
85 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

sagarchauhan’s picture

Status: Needs work » Needs review
FileSize
3.69 KB
1.92 KB

Rerolled the patch.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Reroll seems fine.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 69: 2485497-69.patch, failed testing. View results

vsujeetkumar’s picture

Status: Needs work » Reviewed & tested by the community

Worked on fail test at #69 and found that the test are passing on local so rerun the test again on #69 and test are passing now, So as per the #70 moving it to RTBC.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work

The Needs Review Queue Bot tested this issue.

While you are making the above changes, we recommend that you convert this patch to a merge request. Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)

Nitin shrivastava made their first commit to this issue’s fork.

djsagar’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

#69 still applied cleanly so this could of been put back into RTBC.

longwave’s picture

Status: Reviewed & tested by the community » Needs work

Manually tested this and all looks fine, but there is one LTR comment that I think is out of place, and we should fix it while we're here.