From b4cdd3322473a34c7602bf173f1c501eb2d086f1 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Wed, 29 Nov 2023 13:37:34 +0000 Subject: [PATCH] Fix rule `media-feature-range-notation` to use `'prefix'` notation Media Queries Level 4 feature range syntax lacks both Autoprefixer and Internet Explorer support so we should override the rule default `'context'` to `'prefix'` https://stylelint.io/user-guide/rules/media-feature-range-notation https://www.w3.org/TR/mediaqueries-4/#mq-range-context https://caniuse.com/css-media-range-syntax --- CHANGELOG.md | 4 ++++ css-rules.js | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b70f1a..0fb0b6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ useful summary for people upgrading their application, not a replication of the commit log. +## Unreleased + +* [pull request #59: Fix rule `media-feature-range-notation` to use `'prefix'` notation](https://github.com/alphagov/stylelint-config-gds/pull/59) + ## 1.1.0 This release includes: diff --git a/css-rules.js b/css-rules.js index ea45a2c..4ecf028 100644 --- a/css-rules.js +++ b/css-rules.js @@ -84,6 +84,11 @@ module.exports = { // that tool across GDS products. // https://stylelint.io/user-guide/rules/media-feature-name-no-vendor-prefix/ 'media-feature-name-no-vendor-prefix': null, + // Require media query feature ranges to use prefix notation, this is + // required for Internet Explorer support which doesn't understand the + // modern syntax. + // https://stylelint.io/user-guide/rules/media-feature-range-notation/ + 'media-feature-range-notation': 'prefix', // This rules attempts to prevent defining defining rules with a more // specific selector than a previous one, where they may override. This // is disables as it conflicts with our common usage of nesting rules