mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-24 09:58:43 -04:00
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:
@@ -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';
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user