From eb69520763bca2c371ca721f701fcc2c640b6e69 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Fri, 12 Aug 2016 12:02:23 +0100 Subject: [PATCH] MDL-55452 stylelint: prevent use of !important Don't try and fix existing issues, just prevent new ones landing.. --- .stylelintrc | 1 + theme/bootstrapbase/less/moodle/course.less | 3 ++- theme/bootstrapbase/less/moodle/expendable.less | 1 + theme/bootstrapbase/less/moodle/filemanager.less | 1 + theme/bootstrapbase/less/moodle/modules.less | 2 +- theme/bootstrapbase/less/moodle/responsive.less | 2 ++ theme/bootstrapbase/less/moodle/undo.less | 3 +-- 7 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.stylelintrc b/.stylelintrc index e5e61a29c8f..572cd2f4bd5 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -31,6 +31,7 @@ "declaration-colon-newline-after": "always-multi-line", "declaration-colon-space-after": "always-single-line", "declaration-colon-space-before": "never", + "declaration-no-important": true, "function-calc-no-unspaced-operator": true, "function-comma-newline-after": "always-multi-line", "function-comma-space-after": "always-single-line", diff --git a/theme/bootstrapbase/less/moodle/course.less b/theme/bootstrapbase/less/moodle/course.less index 571e3d85539..a64b41ba849 100644 --- a/theme/bootstrapbase/less/moodle/course.less +++ b/theme/bootstrapbase/less/moodle/course.less @@ -850,7 +850,8 @@ span.editinstructions { } .moodle-actionmenu { .iconsmall { - max-width: none !important; /** reset sets 100% !important which breaks on IE8 without this !important */ + /** reset sets 100% !important which breaks on IE8 without this !important */ + max-width: none !important; /* stylelint-disable-line declaration-no-important */ width: 16px; height: 16px; padding: 4px; diff --git a/theme/bootstrapbase/less/moodle/expendable.less b/theme/bootstrapbase/less/moodle/expendable.less index f476212359f..3d2541973e1 100644 --- a/theme/bootstrapbase/less/moodle/expendable.less +++ b/theme/bootstrapbase/less/moodle/expendable.less @@ -1,3 +1,4 @@ +/* stylelint-disable declaration-no-important */ table#explaincaps, table#defineroletable, table.grading-report, diff --git a/theme/bootstrapbase/less/moodle/filemanager.less b/theme/bootstrapbase/less/moodle/filemanager.less index 468207fd53b..13b83098ed8 100644 --- a/theme/bootstrapbase/less/moodle/filemanager.less +++ b/theme/bootstrapbase/less/moodle/filemanager.less @@ -1,3 +1,4 @@ +/* stylelint-disable declaration-no-important */ // File Picker and File Manager .filemanager, .filepicker, diff --git a/theme/bootstrapbase/less/moodle/modules.less b/theme/bootstrapbase/less/moodle/modules.less index faba707254e..29b0eb425cf 100644 --- a/theme/bootstrapbase/less/moodle/modules.less +++ b/theme/bootstrapbase/less/moodle/modules.less @@ -136,7 +136,7 @@ select { // Override hardcoded forum modules styling .forumsearch input[type=text] { - margin-bottom: 0 !important; + margin-bottom: 0 !important; /* stylelint-disable-line declaration-no-important */ } #page-mod-forum-discuss .discussioncontrols { diff --git a/theme/bootstrapbase/less/moodle/responsive.less b/theme/bootstrapbase/less/moodle/responsive.less index 5f8fb001df0..2ad216e7a11 100644 --- a/theme/bootstrapbase/less/moodle/responsive.less +++ b/theme/bootstrapbase/less/moodle/responsive.less @@ -397,8 +397,10 @@ padding-right: 10px; } #helppopupbox { + /* stylelint-disable declaration-no-important */ width: auto !important; left: 0 !important; + /* stylelint-enable declaration-no-important */ } } // Shrink calender when short on space in block diff --git a/theme/bootstrapbase/less/moodle/undo.less b/theme/bootstrapbase/less/moodle/undo.less index 18726b1988d..effa31a1835 100644 --- a/theme/bootstrapbase/less/moodle/undo.less +++ b/theme/bootstrapbase/less/moodle/undo.less @@ -69,10 +69,9 @@ li.section.hidden, * basically if you see things shifted left or right compared * with where they should be check for a .row */ - #turnitintool_style .row, .forumpost .row { - margin-left: 0 !important; + margin-left: 0 !important; /* stylelint-disable-line declaration-no-important */ // not sure if this needs !important } #turnitintool_style .row:before, -- 2.43.0