From 08a7c9a4e45f8ef8fa0a5d50d70f332d2a67fb4f Mon Sep 17 00:00:00 2001
From: Thibaud Colas <thibaudcolas@gmail.com>
Date: Sat, 9 Jul 2022 07:14:52 +0100
Subject: [PATCH] Configure stylelint to pick up hard-coded colors

---
 .stylelintrc.js | 34 ++++++++++++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/.stylelintrc.js b/.stylelintrc.js
index bce499ad89..7bcc5a36f1 100644
--- a/.stylelintrc.js
+++ b/.stylelintrc.js
@@ -28,7 +28,37 @@ module.exports = {
       // 'float': ['inline-start', 'inline-end', 'none', 'unset'],
       'text-align': ['start', 'end', 'center'],
     },
-    // Disable declaration-strict-value until we are in a position to enforce it.
-    'scale-unlimited/declaration-strict-value': null,
+    // Some parts of declaration-strict-value commented out until we are in a position to enforce them.
+    'scale-unlimited/declaration-strict-value': [
+      [
+        // Colors should always be defined from variables or functions.
+        '/color/',
+        'fill',
+        'stroke',
+        // Font tokens should come from our design tokens.
+        'font-family',
+        // 'font-size',
+        // 'font-weight',
+        // Spacing should use a consistent scale rather than hard-coded values.
+        // '/margin/',
+        // '/padding/',
+        // 'gap',
+        // Consistently using variables for z-index allows us to define the order of the values globally.
+        // 'z-index',
+      ],
+      {
+        ignoreValues: [
+          'currentColor',
+          'inherit',
+          'initial',
+          'none',
+          'unset',
+          'transparent',
+          'ActiveText',
+          'Highlight',
+          'ButtonText',
+        ],
+      },
+    ],
   },
 };