Change mixins-before-declarations Sass-lint rule

We write our Sass to be mobile-first, meaning we
declare the value for a property (for mobile) and
then add all other variations (for other
viewports) afterwards.

Because of this, we need mixins that produce media
queries to be able to follow declarations.

This extension to the rule is also hinted at as
good practice in the docs:

7847511b61/docs/rules/mixins-before-declarations.md
This commit is contained in:
Tom Byers
2020-08-28 15:31:54 +01:00
parent 70007fcb8f
commit 0560066638
2 changed files with 2 additions and 2 deletions

View File

@@ -1,6 +1,5 @@
// GOV.UK Publishing components cookie banner styles
// https://github.com/alphagov/govuk_publishing_components/blob/master/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss
// sass-lint:disable mixins-before-declarations
// component uses .govuk-body and .govuk-button classes from govuk-frontend
@import 'core/typography';

View File

@@ -259,7 +259,8 @@ const lint = {
paths.src + 'stylesheets/views/*.scss',
])
.pipe(plugins.sassLint({
'options': { 'formatter': 'stylish' }
'options': { 'formatter': 'stylish' },
'rules': { 'mixins-before-declarations': [2, { 'exclude': ['media', 'govuk-media-query'] } ] }
}))
.pipe(plugins.sassLint.format())
.pipe(plugins.sassLint.failOnError());