MDL-56063 theme_boost: Check and remove extraneous !important rules
authorFrédéric Massart <fred@moodle.com>
Thu, 22 Sep 2016 15:24:46 +0000 (17:24 +0200)
committerDan Poltawski <dan@moodle.com>
Fri, 23 Sep 2016 10:04:33 +0000 (11:04 +0100)
Progress bar styling has been removed as they do not appear to
be used anywhere, though MDL-56095 has been created to style them
as (with or without the styles) they remain unstyled.

The file responsive.scss has been removed, it was not used.

Part of MDL-55071

Gruntfile.js
theme/boost/scss/moodle/core.scss
theme/boost/scss/moodle/expendable.scss
theme/boost/scss/moodle/filemanager.scss
theme/boost/scss/moodle/icons.scss
theme/boost/scss/moodle/modules.scss
theme/boost/scss/moodle/responsive.scss [deleted file]
theme/boost/scss/moodle/undo.scss

index 7f74d61..08b28b6 100644 (file)
@@ -202,14 +202,7 @@ module.exports = function(grunt) {
                 src: ['theme/**/*.less']
             },
             scss: {
-                options: {
-                    syntax: 'scss',
-                    configOverrides: {
-                        rules: {
-                            "declaration-no-important": null // TODO: to be addressed by MDL-56063.
-                        }
-                    },
-                },
+                options: {syntax: 'scss'},
                 src: ['*/**/*.scss']
             }
         }
index c025598..4609b1e 100644 (file)
@@ -21,7 +21,7 @@
 
 /*rtl:ignore*/
 .text-ltr {
-    direction: ltr !important;
+    direction: ltr !important; /* stylelint-disable-line declaration-no-important */
 }
 
 #add,
@@ -1313,21 +1313,15 @@ body#page-lib-editor-tinymce-plugins-moodlemedia-preview {
 }
 
 .moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd .yui3-widget-buttons {
-    padding: 5px;
-    right: 0;
+    padding: $spacer;
 }
 
 .moodle-dialogue-base .closebutton {
     @extend .close;
-    margin: 0;
-    padding: 10px !important;
-    background: 0;
-    border-style: none;
     box-shadow: none;
-}
-
-.moodle-dialogue-base .closebutton::after {
-    content: "×";
+    &::after {
+        content: "×";
+    }
 }
 
 .moodle-dialogue-base .moodle-dialogue .moodle-dialogue-bd {
index 9b0e9d6..941ba2e 100644 (file)
@@ -43,33 +43,7 @@ table#modules,
 table#permissions {
     @extend .table-hover;
 }
-// language editing progress bar
-// copied in because the styles are set on the HTML
-div[id^="bar_pbar_"] {
-    overflow: hidden !important;
-    height: $line-height-base !important;
-    margin-bottom: $line-height-base !important;
 
-    @include gradient-y(#f5f5f5, #f9f9f9);
-    @include box-shadow(inset 0 1px 2px rgba(0, 0, 0, .1));
-    @include border-radius($border-radius);
-    border: none !important;
-}
-
-div[id^="progress_pbar_"] {
-    height: 100% !important;
-    color: $body-bg !important;
-    float: left !important;
-    font-size: 12px !important;
-    text-align: center !important;
-    text-shadow: 0 -1px 0 rgba(0, 0, 0, .25) !important;
-
-    @include gradient-y(#149bdf, #0480be);
-    @include box-shadow(inset 0 -1px 0 rgba(0, 0, 0, .15));
-    @include transition(width .6s ease);
-    padding-top: 0 !important;
-    border: none !important;
-}
 // colored buttons
 input.form-submit,
 input#id_submitbutton,
index 873a368..85ad801 100644 (file)
@@ -651,22 +651,28 @@ a.ygtvspacer:hover {
     width: 100%;
 }
 
-.filemanager .yui3-datatable-header {
-    background: #fff !important;
-    border-bottom: 1px solid #ccc !important;
-    border-left: 0 solid #fff !important;
-    color: #555 !important;
-}
+/* Override YUI default styling */
+/* stylelint-disable declaration-no-important */
+.filemanager {
 
-.filemanager .yui3-datatable-odd .yui3-datatable-cell {
-    background-color: #f6f6f6 !important;
-    border-left: 0 solid #f6f6f6;
-}
+    .yui3-datatable-header {
+        background: #fff !important;
+        border-bottom: 1px solid #ccc !important;
+        border-left: 0 solid #fff !important;
+        color: #555 !important;
+    }
 
-.filemanager .yui3-datatable-even .yui3-datatable-cell {
-    background-color: #fff !important;
-    border-left: 0 solid #fff;
+    .yui3-datatable-odd .yui3-datatable-cell {
+        background-color: #f6f6f6 !important;
+        border-left: 0 solid #f6f6f6;
+    }
+
+    .yui3-datatable-even .yui3-datatable-cell {
+        background-color: #fff !important;
+        border-left: 0 solid #fff;
+    }
 }
+/* stylelint-enable */
 
 .filemanager .fp-filename-icon.fp-hasreferences .fp-reficons1 {
     background: url('[[pix:theme|fp/link_sm]]') no-repeat 0 0;
index dea1892..eb2f802 100644 (file)
@@ -26,7 +26,7 @@ a:first-of-type > .icon {
 
 // YUI 2 Tree View icons must not have a margin left.
 .ygtvcell .icon {
-    margin-left: 0 !important;
+    margin-left: 0 !important; /* stylelint-disable-line declaration-no-important */
 }
 
 // In the navigation, tree icons should not have margins.
index f28ed03..0800833 100644 (file)
@@ -142,7 +142,7 @@ select {
 
 // Override hardcoded forum modules styling
 .forumsearch input[type=text] {
-    margin-bottom: 0 !important;
+    margin-bottom: 0;
 }
 
 #page-mod-forum-discuss .discussioncontrols {
diff --git a/theme/boost/scss/moodle/responsive.scss b/theme/boost/scss/moodle/responsive.scss
deleted file mode 100644 (file)
index c0d8dd2..0000000
+++ /dev/null
@@ -1,757 +0,0 @@
-/* responsive.less */
-
-// Should probably be moved to relevant @mixin less files
-// after 4095 selector issue is solved
-
-@media (min-width: ($navbarCollapseDesktopWidth)) {
-    a[id]:empty::before,
-    a[name]:empty::before {
-        display: inline-block;
-        position: relative;
-        content: '';
-        padding-top: $navbarHeight;
-        margin-top: -$navbarHeight;
-        vertical-align: top;
-    }
-}
-
-@media (min-width: 980px) and (max-width: 1199px) {
-    // Wider form labels.
-    .form-item .form-label,
-    .mform .fitem div.fitemtitle,
-    .userprofile dl.list dt,
-    .form-horizontal .control-label {
-        width: $horizontalComponentOffset980 - 20px;
-    }
-
-    .form-item .form-setting,
-    .form-item .form-description,
-    .mform .fitem .felement,
-    .mform .fdescription.required,
-    .userprofile dl.list dd,
-    .form-horizontal .controls {
-        margin-left: $horizontalComponentOffset980;
-    }
-
-    .path-admin .buttons,
-    .form-buttons {
-        padding-left: $horizontalComponentOffset980;
-    }
-}
-
-@media (max-width: 767px) {
-    .file-picker .fp-repo-area {
-        width: 100%;
-        height: auto;
-        max-height: 220px;
-        float: none;
-        border: 0;
-    }
-
-    .file-picker .fp-repo-items {
-        width: 100%;
-        float: none;
-        margin-left: 0;
-    }
-
-    .file-picker .fp-login-form .fp-login-input label {
-        text-align: left;
-    }
-
-    .file-picker .fp-content form td {
-        display: block;
-        width: 100%;
-        text-align: left;
-    }
-
-    .fp-content .mdl-right {
-        text-align: left;
-    }
-
-    .fp-repo-items .fp-navbar {
-        border-top: 1px solid rgb(187, 187, 187);
-    }
-
-    .fp-formset div {
-        height: auto;
-    }
-}
-
-@media (min-width: 1200px) {
-    // Editor on question page
-    .path-question {
-        #id_answerhdr div.fitem_feditor {
-            padding-right: 6px;
-        }
-    }
-    // Wider form labels.
-    .form-item .form-label,
-    .mform .fitem div.fitemtitle,
-    .userprofile dl.list dt,
-    .form-horizontal .control-label {
-        width: $horizontalComponentOffset1200 - 20px;
-    }
-
-    .form-item .form-setting,
-    .form-item .form-description,
-    .mform .fitem .felement,
-    .mform .fdescription.required,
-    .userprofile dl.list dd,
-    .form-horizontal .controls {
-        margin-left: $horizontalComponentOffset1200;
-    }
-
-    .path-admin .buttons,
-    .form-buttons {
-        padding-left: $horizontalComponentOffset1200;
-    }
-
-    // Core empty block regions.
-
-    @mixin fluid-span($columns) {
-        @include fluid-span-full($columns, $fluidGridColumnWidth1200, $fluidGridGutterWidth1200);
-    }
-
-    .empty-region-side-post.used-region-side-pre,
-    .jsenabled.docked-region-side-post.used-region-side-pre { // All post blocks docked and pre region is in use.
-        #region-main.span8 {
-            /** increase the span size by 1 **/
-
-            @include fluid-span(9);
-        }
-
-        #block-region-side-pre.span4 {
-            /** decrease the span size by 1 **/
-
-            @include fluid-span(3);
-        }
-    }
-}
-
-@media (min-width: 980px) {
-    .loginbox.twocolumns .loginpanel {
-        margin-left: 0;
-    }
-
-    .loginbox.twocolumns .loginpanel,
-    .loginbox.twocolumns .signuppanel {
-        width: 48.617948717948715%;
-    }
-}
-
-@media (min-width: 768px) and (max-width: 979px) {
-    // Core empty block regions.
-
-    @mixin fluid-span($columns) {
-        @include fluid-span-full($columns, $fluidGridColumnWidth768, $fluidGridGutterWidth768);
-    }
-
-    .empty-region-side-post.used-region-side-pre,
-    .jsenabled.docked-region-side-post.used-region-side-pre { // All post blocks docked and pre region is in use.
-        #region-main.span8 {
-            /** increase the span size by 1 **/
-
-            @include fluid-span(9);
-        }
-
-        #block-region-side-pre.span4 {
-            /** decrease the span size by 1 **/
-
-            @include fluid-span(3);
-        }
-    }
-}
-
-@media (max-width: 767px) {
-    #page-mod-quiz-edit div.quizcontents,
-    .questionbankwindow.block {
-        width: 100%;
-        float: none;
-    }
-
-    #page-mod-quiz-edit #block-region-side-pre,
-    #page-mod-quiz-edit #block-region-side-post {
-        clear: both;
-    }
-}
-
-@media (max-width: 480px) {
-    // make tabs act like nav-stacked
-    // (mostly) copied from bootstrap/navs.less
-    .nav-tabs > li {
-        float: none;
-    }
-
-    .nav-tabs > li > a {
-        margin-right: 0; // no need for the gap between nav items
-    }
-
-    .nav-tabs {
-        border-bottom: 0;
-    }
-
-    .nav-tabs > li > a {
-        border: 1px solid #ddd;
-
-        @include border-radius(0);
-    }
-
-    .nav-tabs > .active > a,
-    .nav-tabs > .active > a:hover {
-        border: 1px solid #ddd;
-    }
-
-    .nav-tabs > li:first-child > a {
-        @include border-top-radius(4px);
-    }
-
-    .nav-tabs > li:last-child > a {
-        @include border-bottom-radius(4px);
-    }
-
-    .nav-tabs > li > a:hover,
-    .nav-tabs > li > a:focus {
-        border-color: #ddd;
-        z-index: 2;
-    }
-
-    .fp-content-center {
-        display: block;
-    }
-
-    .course-content ul.topics li.section,
-    .course-content ul.topics li.section .content,
-    .course-content ul.weeks li.section .content,
-    .course-content ul.weeks li.section,
-    .course-content ul.section {
-        margin-right: 0;
-        margin-left: 0;
-        padding: 0;
-    }
-
-    .activityinstance {
-        display: block;
-    }
-
-    .editing .course-content .section .activity {
-        margin-bottom: 0.2em;
-        padding-bottom: 0.2em;
-        border-bottom: thin solid #eee;
-    }
-
-    .course-content .section .activity .commands {
-        text-align: right;
-    }
-    /** Handles display of the activity chooser on small screens **/
-    .jsenabled .choosercontainer #chooseform .alloptions {
-        max-width: 100%;
-    }
-
-    .jsenabled .choosercontainer #chooseform .instruction,
-    .jsenabled .choosercontainer #chooseform .typesummary {
-        position: static;
-    }
-
-    .que .info {
-        float: none;
-        width: auto;
-    }
-
-    .que .content {
-        margin: 0;
-    }
-
-    .path-mod-choice .horizontal  .choices .option {
-        display: block;
-    }
-
-    .path-mod-forum .forumsearch #search {
-        width: 120px;
-    }
-
-    .path-mod-forum .forumheaderlist .picture {
-        display: none;
-    }
-}
-
-// Stuart's 2,1,3 layout
-
-@media (min-width: 768px) {
-    .row-fluid .desktop-first-column {
-        margin-left: 0;
-    }
-
-    #page-navbar .breadcrumb-button {
-        display: inline;
-    }
-}
-
-@media (max-width: 767px) {
-    .row-fluid .desktop-first-column {
-        clear: both;
-    }
-}
-// Forms
-
-@media (max-width: 767px) {
-    // Remove the horizontal form styles
-    .form-item .form-label,
-    .mform .fitem div.fitemtitle {
-        // copied from .control-label {
-        float: none;
-        width: auto;
-        padding-top: 0;
-        text-align: left;
-    }
-
-    .form-item .form-label label {
-        display: inline-block;
-        margin-right: .5em;
-    }
-
-    .form-item .form-setting .form-checkbox {
-        margin-top: 0;
-    }
-
-    .form-label span.form-shortname {
-        display: inline-block;
-    }
-
-    .form-item .form-setting,
-    .mform .fitem .felement,
-    .path-backup .mform .fitem .felement,
-    .mform .fdescription.required,
-    .form-item .form-description {
-        margin-left: 0;
-    }
-
-    .form-buttons,
-    #fitem_id_submitbutton,
-    .fp-content-center form + div,
-    #fgroup_id_buttonar,
-    .form-horizontal .form-actions,
-    .fitem_fsubmit .felement.fsubmit {
-        padding-left: 10px;
-        padding-right: 10px;
-    }
-
-    #helppopupbox {
-        width: auto !important;
-        left: 0 !important;
-    }
-}
-// Shrink calender when short on space in block
-
-@media (min-width: 768px) and (max-width: 979px) {
-    .block_calendar_month .content,
-    .block .minicalendar td {
-        padding-left: 0;
-        padding-right: 0;
-    }
-}
-
-@media (max-width: 979px) {
-    .nav-collapse {
-        height: 0;
-
-        .nav > li > a {
-            color: $grayDark;
-        }
-
-        .nav > li > a:hover,
-        .nav > li > a:focus,
-        .dropdown-menu a:hover,
-        .dropdown-menu a:focus,
-        .dropdown-submenu a:hover,
-        .dropdown-submenu a:focus,
-        .dropdown-submenu a:active,
-        .dropdown-menu > li > a:hover,
-        .dropdown-menu > li > a:focus,
-        .dropdown-submenu:hover > a,
-        .dropdown-submenu:focus > a {
-            background-image: none;
-            color: $grayDark;
-        }
-    }
-
-    .nav-collapse.in {
-        height: auto;
-
-        .usermenu .moodle-actionmenu[data-enhanced] {
-            .toggle-display {
-                display: none;
-            }
-
-            .menu {
-                display: block;
-
-                li {
-                    margin: 0 0.5em;
-                }
-            }
-        }
-    }
-
-    .path-mod-data .box > table > tbody > tr > td {
-        display: block;
-    }
-
-    .path-mod-forum .forumheaderlist {
-        thead .header {
-            font-weight: normal;
-            font-size: round($font-size-sm);
-        }
-
-        .discussion {
-            .author,
-            .replies,
-            .lastpost {
-                font-size: round($font-size-sm);
-            }
-
-            .replies .unread a {
-                padding: 0;
-            }
-        }
-    }
-
-    .navbar {
-        .nav-collapse.in {
-            border-top: 1px solid $navbarBorder;
-
-            &.pull-left,
-            &.pull-right {
-                float: none;
-            }
-
-            > .nav {
-                margin: 0;
-
-                // Add padding to first-level links.
-                > li > a {
-                    padding-left: 20px;
-                    border-radius: 0;
-                }
-
-                .dropdown-menu {
-                    margin: 0 0 0 15px;
-
-                    li > a {
-                        border-radius: 0;
-                    }
-                }
-            }
-
-            .nav,
-            .nav .dropdown-menu {
-                .dropdown-submenu {
-                    .dropdown-toggle {
-                        &:after {
-                            display: inline-block;
-                            float: none;
-
-                            @include caret();
-                            border-top-color: $navbarBorder;
-                            margin-left: 4px;
-                            margin-top: 8px;
-                        }
-                    }
-
-                    &.open {
-                        > a {
-                            background-color: $navbarBackground;
-                        }
-                    }
-
-                    // Suppress showing of submenu menu content on hover.
-                    &:hover {
-                        .dropdown-menu {
-                            display: none;
-                        }
-
-                        &.open {
-                            > a {
-                                background-color: $navbarBackground;
-                            }
-
-                            > .dropdown-menu,
-                            .open > .dropdown-menu {
-                                display: block;
-                            }
-                        }
-                    }
-                }
-
-                .divider {
-                    width: auto;
-                    display: block;
-                    height: 0;
-                    margin: 4px 1px;
-                    border-left: 0 none;
-                    border-right: 0 none;
-                    border-top: 1px solid $navbarBorder;
-                    border-bottom: 1px solid $navbarBackgroundHighlight;
-                }
-            }
-        }
-    }
-
-    .navbar-inverse {
-        .nav-collapse.in {
-            border-top-color: $navbarInverseBorder;
-
-            .nav,
-            .nav .dropdown-menu {
-                .dropdown-submenu {
-                    .dropdown-toggle {
-                        &:after {
-                            border-top-color: $navbarInverseBorder;
-                        }
-                    }
-
-                    &.open {
-                        > a {
-                            background-color: $navbarInverseBackground;
-                        }
-                    }
-
-                    &:hover {
-                        &.open {
-                            > a {
-                                background-color: $navbarInverseBackground;
-                            }
-                        }
-                    }
-                }
-
-                .divider {
-                    width: auto;
-                    display: block;
-                    height: 0;
-                    margin: 4px 1px;
-                    border-top: 1px solid $navbarInverseBackground;
-                    border-bottom: 1px solid lighten($navbarInverseBackground, 25%);
-                }
-            }
-
-            .nav {
-                > li > a {
-                    &:hover,
-                    &:focus {
-                        color: $navbarInverseLinkColorHover;
-                    }
-                }
-            }
-
-            .dropdown-menu a {
-                &:hover,
-                &:focus {
-                    color: $navbarInverseLinkColorHover;
-                }
-
-                > li > a {
-                    &:hover,
-                    &:focus {
-                        color: $navbarInverseLinkColorHover;
-                    }
-                }
-            }
-
-            .dropdown-submenu a {
-                &:hover,
-                &:focus,
-                &:active {
-                    color: $navbarInverseLinkColorHover;
-                }
-            }
-        }
-    }
-}
-
-@media (max-width: 767px) {
-    // Resize, reflow file-picker on small devices
-    #filesskin .yui3-panel,
-    #filesskin .file-picker.fp-generallayout {
-        width: 100%;
-        left: 0;
-    }
-
-    .userprofile dl.list {
-        // copied from dl-horizontal in bootstrap/repsonsive.less
-        dt {
-            float: none;
-            clear: none;
-            width: auto;
-            text-align: left;
-        }
-
-        dd {
-            margin-left: 0;
-        }
-    }
-    // Reset the alignment for required label to display inline on mobile devices
-    #page-mod-wiki-create .mform .fitem div.fitemtitle {
-        float: left;
-    }
-
-    // GRID & CONTAINERS
-    // -----------------
-    // Remove width from containers
-    .container {
-        width: auto;
-    }
-    // Fluid rows
-    .row-fluid {
-        width: 100%;
-    }
-
-    .row-fluid .span8.pull-right,
-    .row-fluid .span9.pull-right {
-        float: none;
-    }
-    // Undo negative margin on rows and thumbnails
-    .row {
-        margin-left: 0;
-    }
-    // Make all grid-sized elements block level again
-    [class*="span"],
-    .row-fluid [class*="span"] {
-        float: none;
-        display: block;
-        width: 100%;
-        margin-left: 0;
-
-        @include box-sizing(border-box);
-    }
-
-    // We need to specify a more specific selector to reset the width for
-    // cases when we have content in the side-pre blockregion but not in the
-    // side-post blockregion as there are more specific selectors in
-    // core.less which take precedence which break responsiveness.
-    .empty-region-side-post.used-region-side-pre,
-    .jsenabled.docked-region-side-post.used-region-side-pre { // All post blocks docked and pre region is in use.
-        #block-region-side-pre.span4,
-        #region-main.span8 {
-            @include fluid-span(12);
-        }
-    }
-
-    .row-fluid .span12 {
-        width: 100%;
-
-        @include box-sizing(border-box);
-    }
-
-    .row-fluid [class*="offset"]:first-child {
-        margin-left: 0;
-    }
-
-    div[role=main] {
-        margin-bottom: 1em;
-    }
-
-    .coursebox {
-        .info {
-            .name {
-                a {
-                    background-position: 0 13px;
-                }
-            }
-        }
-    }
-
-    .category-browse {
-        .coursebox {
-            .info {
-                .name {
-                    a {
-                        background-position: 0 13px;
-                    }
-                }
-            }
-        }
-    }
-}
-
-// All widths between 1200px and 1600px
-
-@media (min-width: 1200px) and (max-width: 1600px) {
-    @mixin fluid-span($columns) {
-        @include fluid-span-full($columns, $fluidGridColumnWidth1200, $fluidGridGutterWidth1200);
-    }
-    // CSS for the course management pages.
-    #course-category-listings.columns-3 {
-        background-color: $tableBackground;
-        border: 0;
-
-        #category-listing,
-        #course-listing {
-            @include fluid-span(6);
-            margin-left: $fluidGridGutterWidth1200;
-
-            &:first-child {
-                margin-left: 0;
-            }
-        }
-
-        #course-detail {
-            @include fluid-span(12);
-            margin: 1em 0 0;
-        }
-    }
-}
-
-// All widths up to 1199px@mixin
-
-@media (max-width: 1199px) {
-
-    // Editor on question pages
-    .path-question {
-        #id_answerhdr div.fitem {
-            padding-right: 6px;
-            padding-left: 4px;
-        }
-    }
-    // CSS for the course management pages.
-    #course-category-listings.columns-3 {
-        background-color: $tableBackground;
-        border: 0;
-
-        #category-listing,
-        #course-listing,
-        #course-detail {
-            @include fluid-span(12);
-            margin: 0 0 1em 0;
-        }
-    }
-
-    #page-mod-forum-discuss .discussioncontrols {
-        text-align: right;
-
-        .discussioncontrol {
-            float: none;
-            width: auto;
-            display: inline-block;
-            margin: 0 3px 0.5em;
-
-            select,
-            input {
-                margin-bottom: 0;
-            }
-
-            &.movediscussion {
-                margin-right: 0;
-                padding-right: 0;
-            }
-        }
-    }
-}
-
-
-// File Picker@mixin
-
-@media (max-width: 768px) {
-    .fp-forminset .control-group .controls {
-        margin-left: 0;
-    }
-}
index b6dfe28..8f5c3ad 100644 (file)
@@ -71,14 +71,10 @@ li.section.hidden,
  * with where they should be check for a .row
  */
 
-#turnitintool_style .row,
 .forumpost .row {
-    margin-left: 0 !important;
-    // not sure if this needs !important
+    margin-left: 0 !important; /* stylelint-disable-line declaration-no-important */
 }
 
-#turnitintool_style .row:before,
-#turnitintool_style .row:after,
 .forumpost .row:before,
 .forumpost .row:after {
     content: none;