Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Sub-issue of #1190252: [573] Use csslint as a weapon to beat the crappy CSS out of Drupal core
Inline with the CSS cleanup efforts of the HTML5 initiative, using CSSLint at http://csslint.net provides a quick way to code-sniff our css and tweak styles.
- Copy and paste the the stylesheet(s) below into the css lint tool at http://csslint.net and test.
- Fix any warnings or errors the tool finds.
- Patch Drupal 8 locally and make sure the css changes have not broken anything visually.
- Create patch and upload for the testbot.
Files: modules/locale/locale.css
Comment | File | Size | Author |
---|---|---|---|
#17 | after.png | 81.31 KB | dnotes |
#17 | after-rtl.png | 81.16 KB | dnotes |
#17 | before.png | 80.58 KB | dnotes |
#17 | before-rtl.png | 80.58 KB | dnotes |
#14 | drupal-csslint-locale-1663130-14.patch | 2.92 KB | barraponto |
Comments
Comment #1
droplet CreditAttribution: droplet commentedabbr.ajax-changed is a globally issue to every AJAX-change.
Comment #2
RobLoachAfter applying the patch....
rob@Computron /var/www/drupal/8 $ node ../../csslint/release/npm/cli.js core/modules/locale/
csslint: No errors in core/modules/locale//locale.admin-rtl.css.
csslint: There are 11 problems in core/modules/locale//locale.admin.css.
locale.admin.css
1: warning at line 5, col 3
Using width with padding-right can sometimes make elements larger than you expect.
padding-right: 1em; /* LTR */
locale.admin.css
2: warning at line 19, col 22
Values of 0 shouldn't have units specified.
padding: 3.5ex 0 0 0em; /* LTR */
locale.admin.css
3: warning at line 21, col 1
Don't use IDs in selectors.
#locale-translate-edit-form th{
locale.admin.css
4: warning at line 25, col 1
Don't use IDs in selectors.
#locale-translate-edit-form .form-item{
locale.admin.css
5: warning at line 28, col 1
Don't use IDs in selectors.
#locale-translate-edit-form td {
locale.admin.css
6: warning at line 32, col 1
Don't use IDs in selectors.
#locale-translate-edit-form .changed {
locale.admin.css
7: warning at line 36, col 1
Don't use IDs in selectors.
#locale-translate-edit-form .form-type-item abbr.ajax-changed {
locale.admin.css
8: warning at line 36, col 45
Element (abbr.ajax-changed) is overqualified, just use .ajax-changed without element name.
#locale-translate-edit-form .form-type-item abbr.ajax-changed {
locale.admin.css
9: warning at line 44, col 1
2 IDs in the selector, really?
#locale-translate-edit-form #edit-strings .locale-translate-edit-table {
locale.admin.css
10: warning at line 48, col 43
Don't use adjoining classes.
#locale-translate-edit-form #edit-strings .locale-translate-edit-table.changed {
locale.admin.css
11: warning at line 48, col 1
2 IDs in the selector, really?
#locale-translate-edit-form #edit-strings .locale-translate-edit-table.changed {
Comment #3
droplet CreditAttribution: droplet commentedSeems like I uploaded a wrong patch.
Comment #4
RobLoachrob@Computron /var/www/drupal/8 $ node ../../csslint/release/npm/cli.js core/modules/locale/
csslint: No errors in core/modules/locale//locale-rtl.css.
csslint: No errors in core/modules/locale//locale.admin-rtl.css.
csslint: No errors in core/modules/locale//locale.admin.css.
Comment #5
droplet CreditAttribution: droplet commentedno position: absolute; for following message
"* Changes made in this table will not be saved until the form is submitted."
Comment #6
droplet CreditAttribution: droplet commentedmy editor su*
Comment #7
star-szrJust created #1799124: locale-rtl.css is out of sync with locale.admin.css, is never included due to incorrect filename which is related to this issue.
Comment #8
Risse CreditAttribution: Risse commented#6: locale2.patch queued for re-testing.
Comment #10
Risse CreditAttribution: Risse commentedUpdated patch to work with latest dev.
locale.admin.css = CSS lint found 0 errors and 0 warnings.
locale.rtl.css = CSS lint found 0 errors and 0 warnings.
Comment #11
Risse CreditAttribution: Risse commentedComment #13
Risse CreditAttribution: Risse commentedWell, that was a stupid mistake. New try!
Comment #14
barraponto CreditAttribution: barraponto commentedWonderful, works as expected. Just added spaces before
{
to meet css styles.Comment #15
xjmCSS changes need manual testing in all browsers and all affected core themes:
Post before-and-after screenshots for one browser/theme.
Comment #16
xjmComment #17
dnotes CreditAttribution: dnotes commentedI've confirmed that there are no changes. Screenshots attached. Setting back to RTBC since manual testing is done.
Comment #18
xjmThanks @dnotes!
Comment #19
webchickAwesome work! Committed and pushed to 8.x. :)
Comment #21
frederickjhRemoving Needs screenshots tag. Marked Closed. Issue queue cleanup for those searching for issues needing screenshots.