Make WordPress Core

Ticket #29792: patch

File patch, 15.0 KB (added by x2048, 12 years ago)

Adds CSSLint and a small custom WP CSS style checker as grunt tasks. Removes space around parens in media queries.

  • Gruntfile.js

    diff --git a/Gruntfile.js b/Gruntfile.js
    index 5019f0e..3fd58db 100644
    a b module.exports = function(grunt) { 
    4444                        tinymce: ['<%= concat.tinymce.dest %>'],
    4545                        qunit: ['tests/qunit/compiled.html']
    4646                },
     47    csslint: {
     48      all: {
     49        options: {
     50          'important': false,
     51          'adjoining-classes': false,
     52          'known-properties': false,
     53          'box-sizing': false,
     54          'box-model': false,
     55          'overqualified-elements': true,
     56          'display-property-grouping': false,
     57          'bulletproof-font-face': false,
     58          'compatible-vendor-prefixes': false,
     59          'regex-selectors': true,
     60          'errors': true,
     61          'duplicate-background-images': true,
     62          'duplicate-properties': true,
     63          'empty-rules': true,
     64          'selector-max-approaching': false,
     65          'gradients': false,
     66          'fallback-colors': false,
     67          'font-sizes': false,
     68          'font-faces': false,
     69          'floats': false,
     70          'star-property-hack': true,
     71          'outline-none': false,
     72          'import': false,
     73          'ids': false,
     74          'underscore-property-hack': false,
     75          'rules-count': false,
     76          'qualified-headings': false,
     77          'selector-max': false,
     78          'shorthand': false,
     79          'text-indent': true,
     80          'unique-headings': false,
     81          'universal-selector': false,
     82          'unqualified-attributes': false,
     83          'vendor-prefix': false,
     84          'zero-units': false
     85        },
     86                                src: [
     87          SOURCE_DIR + 'wp-admin/css/*.css',
     88          SOURCE_DIR + 'wp-includes/css/*.css',
     89          // forms.css contains a @moz-document directive that CSSLint cannot currently recognize
     90          '!' + SOURCE_DIR + 'wp-admin/css/forms.css'
     91                                ]
     92      },
     93    },
     94    'wp-css-check': {
     95      all: {
     96                                src: [
     97          SOURCE_DIR + 'wp-admin/css/*.css',
     98          SOURCE_DIR + 'wp-includes/css/*.css',
     99                                ]
     100      },
     101    },
    47102                copy: {
    48103                        files: {
    49104                                files: [
  • package.json

    diff --git a/package.json b/package.json
    index 7f56805..005e73c 100644
    a b  
    1616    "grunt-contrib-concat": "~0.5.0",
    1717    "grunt-contrib-copy": "~0.5.0",
    1818    "grunt-contrib-cssmin": "~0.10.0",
     19    "grunt-contrib-csslint": "~0.3.1",
    1920    "grunt-contrib-imagemin": "~0.4.1",
    2021    "grunt-contrib-jshint": "~0.10.0",
    2122    "grunt-contrib-qunit": "~0.5.2",
     
    2627    "grunt-legacy-util": "^0.2.0",
    2728    "grunt-patch-wordpress": "~0.2.1",
    2829    "grunt-sass": "~0.14.0",
     30    "grunt-wp-css-check": "git://github.com/x1024/grunt-wp-css-check#b00613899f76f64e27fcff7e78f9b5d9f645bb0b",
    2931    "matchdep": "~0.3.0"
    3032  }
    3133}
  • src/wp-admin/css/about.css

    diff --git a/src/wp-admin/css/about.css b/src/wp-admin/css/about.css
    index 50c4d92..2aa1a22 100644
    a b  
    358358/* =Media Queries
    359359-------------------------------------------------------------- */
    360360
    361 @media screen and ( max-width: 782px ) {
     361@media screen and (max-width: 782px) {
    362362        .about-wrap .feature-section.one-col > div,
    363363        .about-wrap .feature-section.two-col > div,
    364364        .about-wrap .feature-section.three-col > div {
     
    379379}
    380380
    381381/* Responsive release video */
    382 @media screen and ( max-width: 710px ) {
     382@media screen and (max-width: 710px) {
    383383        .about-overview {
    384384                position: relative;
    385385                padding-bottom: 56.25%; /* 360 / 640 */
  • src/wp-admin/css/admin-menu.css

    diff --git a/src/wp-admin/css/admin-menu.css b/src/wp-admin/css/admin-menu.css
    index 7f317bd..a2ed1ed 100644
    a b li#wp-admin-bar-menu-toggle { 
    730730
    731731}
    732732
    733 @media screen and ( max-width: 782px ) {
     733@media screen and (max-width: 782px) {
    734734        .auto-fold #wpcontent {
    735735                position: relative;
    736736                margin-left: 0;
  • src/wp-admin/css/common.css

    diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css
    index 48e0857..bfab57d 100644
    a b div.action-links { 
    24762476        font-size: 13px;
    24772477}
    24782478
    2479 @media screen and ( max-width: 771px ) {
     2479@media screen and (max-width: 771px) {
    24802480        #plugin-information-title.with-banner {
    24812481                height: 100px;
    24822482                bottom: 100px;
    body.index-php .tb-close-icon:before { 
    26222622}
    26232623
    26242624/* move plugin install close icon to top on narrow screens */
    2625 @media screen and ( max-width: 830px ) {
     2625@media screen and (max-width: 830px) {
    26262626        body.plugin-install-php .tb-close-icon,
    26272627        body.import-php .tb-close-icon,
    26282628        body.plugins-php .tb-close-icon,
    img { 
    30463046        width: device-width;
    30473047}
    30483048
    3049 @media screen and ( max-width: 782px ) {
     3049@media screen and (max-width: 782px) {
    30503050        html.wp-toolbar {
    30513051                padding-top: 46px;
    30523052        }
  • src/wp-admin/css/customize-controls.css

    diff --git a/src/wp-admin/css/customize-controls.css b/src/wp-admin/css/customize-controls.css
    index f9f11b3..82b3372 100644
    a b p.customize-section-description { 
    823823        100% { color: #d4b146; }
    824824}
    825825
    826 @-ms-keyframes dice-color-change {
    827         0% { color: #d4b146; }
    828         50% { color: #ef54b0; }
    829         75% { color: #7190d3; }
    830         100% { color: #d4b146; }
    831 }
    832 
    833826@keyframes dice-color-change {
    834827        0% { color: #d4b146; }
    835828        50% { color: #ef54b0; }
  • src/wp-admin/css/dashboard.css

    diff --git a/src/wp-admin/css/dashboard.css b/src/wp-admin/css/dashboard.css
    index 7ed45d2..867e682 100644
    a b a.rsswidget { 
    10871087
    10881088}
    10891089
    1090 @media screen and ( max-width: 782px ) {
     1090@media screen and (max-width: 782px) {
    10911091        #dashboard_recent_comments #the-comment-list .comment-item .avatar {
    10921092                height: 30px;
    10931093                width: 30px;
  • src/wp-admin/css/edit.css

    diff --git a/src/wp-admin/css/edit.css b/src/wp-admin/css/edit.css
    index cc64ae5..5011e28 100644
    a b table.links-table { 
    12771277        }
    12781278}
    12791279
    1280 @media screen and ( max-width: 782px ) {
     1280@media screen and (max-width: 782px) {
    12811281        #post-body-content {
    12821282                min-width: 0;
    12831283        }
  • src/wp-admin/css/forms.css

    diff --git a/src/wp-admin/css/forms.css b/src/wp-admin/css/forms.css
    index b80f98a..e55f846 100644
    a b table.form-table td .updated { 
    765765/* =Media Queries
    766766-------------------------------------------------------------- */
    767767
    768 @media screen and ( max-width: 782px ) {
     768@media screen and (max-width: 782px) {
    769769        /* Input Elements */
    770770        textarea {
    771771                -webkit-appearance: none;
  • src/wp-admin/css/install.css

    diff --git a/src/wp-admin/css/install.css b/src/wp-admin/css/install.css
    index 28c071c..c5f8b47 100644
    a b body.rtl, 
    275275        }
    276276}
    277277
    278 @media screen and ( max-width: 782px ) {
     278@media screen and (max-width: 782px) {
    279279
    280280        .form-table {
    281281                margin-top: 0;
  • src/wp-admin/css/list-tables.css

    diff --git a/src/wp-admin/css/list-tables.css b/src/wp-admin/css/list-tables.css
    index 6feaa22..6afb056 100644
    a b tr.active + tr.plugin-update-tr .plugin-update .update-message { 
    12711271        margin-right: 0;
    12721272}
    12731273
    1274 @media screen and ( min-width: 1600px ) {
     1274@media screen and (min-width: 1600px) {
    12751275        .plugin-card {
    12761276                width: 30%;
    12771277                width: -webkit-calc( 33.1% - 8px );
    tr.active + tr.plugin-update-tr .plugin-update .update-message { 
    12971297        }
    12981298}
    12991299
    1300 @media screen and ( max-width: 782px ) {
     1300@media screen and (max-width: 782px) {
    13011301        .plugin-card {
    13021302                margin-left: 0;
    13031303                margin-right: 0;
    div.action-links, 
    14491449/* =Media Queries
    14501450-------------------------------------------------------------- */
    14511451
    1452 @media screen and ( max-width: 1100px ) and ( min-width: 782px ), ( max-width: 480px ) {
     1452@media screen and (max-width: 1100px) and (min-width: 782px), (max-width: 480px) {
    14531453        .plugin-card .action-links {
    14541454                position: static;
    14551455                margin-left: 148px;
    div.action-links, 
    14811481        }
    14821482}
    14831483
    1484 @media screen and ( max-width: 782px ) {
     1484@media screen and (max-width: 782px) {
    14851485        /* WP List Table Options & Filters */
    14861486        .tablenav {
    14871487                height: auto;
  • src/wp-admin/css/login.css

    diff --git a/src/wp-admin/css/login.css b/src/wp-admin/css/login.css
    index 02ee1d8..687d85d 100644
    a b body.interim-login { 
    255255        width: device-width;
    256256}
    257257
    258 @media screen and ( max-width: 782px ) {
     258@media screen and (max-width: 782px) {
    259259        .interim-login input[type=checkbox] {
    260260                height: 16px;
    261261                width: 16px;
  • src/wp-admin/css/media.css

    diff --git a/src/wp-admin/css/media.css b/src/wp-admin/css/media.css
    index e27b665..1d2ba11 100644
    a b  
    334334        right: 0;
    335335}
    336336
    337 @media screen and ( max-width: 782px ) {
     337@media screen and (max-width: 782px) {
    338338        .find-box-inside {
    339339                bottom: 57px;
    340340        }
    341341}
    342342
    343 @media screen and ( max-width: 660px ) {
     343@media screen and (max-width: 660px) {
    344344
    345345        .find-box {
    346346                top: 0;
    audio, video { 
    11001100        }
    11011101}
    11021102
    1103 @media screen and ( max-width: 782px ) {
     1103@media screen and (max-width: 782px) {
    11041104        .wp_attachment_details label[for="content"] {
    11051105                font-size: 14px;
    11061106                line-height: 1.5em;
    audio, video { 
    11311131        }
    11321132}
    11331133
    1134 @media only screen and ( max-width: 782px ) {
     1134@media only screen and (max-width: 782px) {
    11351135        .media-frame.mode-select .attachments-browser.fixed .media-toolbar {
    11361136                top: 46px;
    11371137                right: 10px;
  • src/wp-admin/css/nav-menus.css

    diff --git a/src/wp-admin/css/nav-menus.css b/src/wp-admin/css/nav-menus.css
    index 28e32b8..a2eb723 100644
    a b body.menu-max-depth-11 { min-width: 1280px !important; } 
    751751/* =Media Queries
    752752-------------------------------------------------------------- */
    753753
    754 @media screen and ( max-width: 782px ) {
     754@media screen and (max-width: 782px) {
    755755        body.nav-menus-php {
    756756                min-width: 0 !important;
    757757        }
  • src/wp-admin/css/press-this.css

    diff --git a/src/wp-admin/css/press-this.css b/src/wp-admin/css/press-this.css
    index dbf355a..3b8a423 100644
    a b h3.tb { 
    366366-------------------------------------------------------------- */
    367367
    368368/* Reset responsive styles in Press This */
    369 @media screen and ( max-width: 782px ) {
     369@media screen and (max-width: 782px) {
    370370        .press-this ul.category-tabs li.tabs {
    371371                padding: 3px 5px 5px; /* Reset tabs in Press This to standard size */
    372372        }
  • src/wp-admin/css/revisions.css

    diff --git a/src/wp-admin/css/revisions.css b/src/wp-admin/css/revisions.css
    index f191494..62272b3 100644
    a b div.revisions-controls > .wp-slider > .ui-slider-handle { 
    560560        }
    561561}
    562562
    563 @media screen and ( max-width: 782px ) {
     563@media screen and (max-width: 782px) {
    564564        #diff-next-revision,
    565565        #diff-previous-revision {
    566566                margin-top: -1em;
  • src/wp-admin/css/themes.css

    diff --git a/src/wp-admin/css/themes.css b/src/wp-admin/css/themes.css
    index 6ff0f9f..e7662a3 100644
    a b body.full-overlay-active { 
    17181718        }
    17191719}
    17201720
    1721 @media screen and ( max-width: 782px ) {
     1721@media screen and (max-width: 782px) {
    17221722        .available-theme .action-links .delete-theme {
    17231723                float: none;
    17241724                margin: 0;
  • src/wp-includes/admin-bar.php

    diff --git a/src/wp-includes/admin-bar.php b/src/wp-includes/admin-bar.php
    index 726c50a..e8f4ab5 100644
    a b function _admin_bar_bump_cb() { ?> 
    786786<style type="text/css" media="screen">
    787787        html { margin-top: 32px !important; }
    788788        * html body { margin-top: 32px !important; }
    789         @media screen and ( max-width: 782px ) {
     789        @media screen and (max-width: 782px) {
    790790                html { margin-top: 46px !important; }
    791791                * html body { margin-top: 46px !important; }
    792792        }
  • src/wp-includes/css/admin-bar.css

    diff --git a/src/wp-includes/css/admin-bar.css b/src/wp-includes/css/admin-bar.css
    index 4f5343c..82dd348 100644
    a b html:lang(he-il) .rtl #wpadminbar * { 
    741741}
    742742/* End no @font-face */
    743743
    744 @media screen and ( max-width: 782px ) {
     744@media screen and (max-width: 782px) {
    745745        /* Toolbar Touchification*/
    746746        html #wpadminbar {
    747747                left: 0 !important;
  • src/wp-includes/css/buttons.css

    diff --git a/src/wp-includes/css/buttons.css b/src/wp-includes/css/buttons.css
    index e84a0b5..8d3d7d1 100644
    a b TABLE OF CONTENTS: 
    305305  5.0 - Responsive Button Styles
    306306---------------------------------------------------------------------------- */
    307307
    308 @media screen and ( max-width: 782px ) {
     308@media screen and (max-width: 782px) {
    309309
    310310        .wp-core-ui .button,
    311311        .wp-core-ui .button.button-large,
  • src/wp-includes/css/editor.css

    diff --git a/src/wp-includes/css/editor.css b/src/wp-includes/css/editor.css
    index e69869a..ec7cbaf 100644
    a b i.mce-i-hr:before { 
    961961        margin: 5px 5px 0 0;
    962962}
    963963
    964 @media screen and ( max-width: 782px ) {
     964@media screen and (max-width: 782px) {
    965965        .mce-toolbar .mce-btn button,
    966966        .qt-fullscreen {
    967967                padding: 6px 7px;
    i.mce-i-hr:before { 
    996996        }
    997997}
    998998
    999 @media screen and ( min-width: 782px ) {
     999@media screen and (min-width: 782px) {
    10001000        .wp-core-ui .quicktags-toolbar input.button.button-small {
    10011001                /* .button-small is normaly 11px, but a bit too small for these buttons. */
    10021002                font-size: 12px;
    i.mce-i-hr:before { 
    13791379        margin-bottom: 0;
    13801380}
    13811381
    1382 @media screen and ( max-width: 782px ) {
     1382@media screen and (max-width: 782px) {
    13831383        #wp-link-wrap {
    13841384                height: 280px;
    13851385                margin-top: -140px;
    i.mce-i-hr:before { 
    14021402        }
    14031403}
    14041404
    1405 @media screen and ( max-width: 520px ) {
     1405@media screen and (max-width: 520px) {
    14061406        #wp-link-wrap {
    14071407                width: auto;
    14081408                margin-left: 0;
    i.mce-i-hr:before { 
    14121412        }
    14131413}
    14141414
    1415 @media screen and ( max-height: 520px ) {
     1415@media screen and (max-height: 520px) {
    14161416        #wp-link-wrap {
    14171417                -webkit-transition: none;
    14181418                transition: none;
    i.mce-i-hr:before { 
    14341434        }
    14351435}
    14361436
    1437 @media screen and ( max-height: 290px ) {
     1437@media screen and (max-height: 290px) {
    14381438        #wp-link-wrap {
    14391439                height: auto;
    14401440                margin-top: 0;
    i.mce-i-hr:before { 
    18861886        height: 30px;
    18871887}
    18881888
    1889 @media screen and ( max-width: 782px ) {
     1889@media screen and (max-width: 782px) {
    18901890        #wp-fullscreen-close,
    18911891        #wp-fullscreen-central-toolbar,
    18921892        #wp-fullscreen-mode-bar,
    i.mce-i-hr:before { 
    19261926        }
    19271927}
    19281928
    1929 @media screen and ( max-width: 480px ) {
     1929@media screen and (max-width: 480px) {
    19301930        #wp_fs_help {
    19311931                display: none;
    19321932        }
  • src/wp-includes/css/jquery-ui-dialog.css

    diff --git a/src/wp-includes/css/jquery-ui-dialog.css b/src/wp-includes/css/jquery-ui-dialog.css
    index 78e9741..45b9921 100644
    a b  
    234234        cursor: default;
    235235}
    236236
    237 @media screen and ( max-width: 782px ) {
     237@media screen and (max-width: 782px) {
    238238
    239239        .ui-button {
    240240                padding: 10px 14px;
  • src/wp-includes/css/wp-pointer.css

    diff --git a/src/wp-includes/css/wp-pointer.css b/src/wp-includes/css/wp-pointer.css
    index 1d69823..c5a3f64 100644
    a b  
    205205}
    206206
    207207/* Disable pointers at responsive sizes */
    208 @media screen and ( max-width: 782px ) {
     208@media screen and (max-width: 782px) {
    209209        .wp-pointer {
    210210                display: none;
    211211        }