2021-12-23 02:42:22 +00:00
|
|
|
module.exports = {
|
|
|
|
extends: '@wagtail/stylelint-config-wagtail',
|
|
|
|
rules: {
|
2022-02-27 16:08:38 +00:00
|
|
|
'scss/at-rule-no-unknown': [
|
|
|
|
true,
|
|
|
|
{
|
|
|
|
ignoreAtRules: [
|
|
|
|
'tailwind',
|
|
|
|
'apply',
|
|
|
|
'variants',
|
|
|
|
'responsive',
|
|
|
|
'screen',
|
|
|
|
'layer',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
'no-invalid-position-at-import-rule': [
|
|
|
|
true,
|
|
|
|
{
|
|
|
|
ignoreAtRules: ['tailwind', 'use'],
|
|
|
|
},
|
|
|
|
],
|
2021-12-23 02:42:22 +00:00
|
|
|
// Would be valuable for strict BEM components but is too hard to enforce with legacy code.
|
|
|
|
'no-descending-specificity': null,
|
2023-10-27 06:55:37 +00:00
|
|
|
// Refined ordering to align with media mixin usage - see https://github.com/wagtail/stylelint-config-wagtail/issues/37
|
|
|
|
'order/order': [
|
|
|
|
'dollar-variables',
|
|
|
|
'custom-properties',
|
|
|
|
{ type: 'at-rule', hasBlock: false }, // @-rules that have no nesting.
|
|
|
|
'declarations',
|
|
|
|
],
|
2022-07-09 06:14:52 +00:00
|
|
|
// 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',
|
|
|
|
],
|
|
|
|
{
|
2023-08-01 22:24:26 +00:00
|
|
|
disableFix: true,
|
2022-07-09 06:14:52 +00:00
|
|
|
ignoreValues: [
|
|
|
|
'currentColor',
|
|
|
|
'inherit',
|
|
|
|
'initial',
|
|
|
|
'none',
|
|
|
|
'unset',
|
|
|
|
'transparent',
|
2022-08-04 17:00:27 +00:00
|
|
|
// System colors for forced-colors styling.
|
|
|
|
// See https://drafts.csswg.org/css-color-4/#css-system-colors.
|
|
|
|
'Canvas',
|
|
|
|
'CanvasText',
|
|
|
|
'LinkText',
|
|
|
|
'VisitedText',
|
2022-07-09 06:14:52 +00:00
|
|
|
'ActiveText',
|
2022-08-04 17:00:27 +00:00
|
|
|
'ButtonFace',
|
2022-07-09 06:14:52 +00:00
|
|
|
'ButtonText',
|
2022-08-04 17:00:27 +00:00
|
|
|
'ButtonBorder',
|
|
|
|
'Field',
|
|
|
|
'FieldText',
|
|
|
|
'Highlight',
|
|
|
|
'HighlightText',
|
|
|
|
'SelectedItem',
|
|
|
|
'SelectedItemText',
|
|
|
|
'Mark',
|
|
|
|
'MarkText',
|
|
|
|
'GrayText',
|
|
|
|
'AccentColor',
|
|
|
|
'AccentColorText',
|
2022-07-09 06:14:52 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2023-10-27 06:55:37 +00:00
|
|
|
// Ignore rule until all existing selectors can be updated.
|
|
|
|
'scss/selector-no-union-class-name': null,
|
|
|
|
// Ignore rule until all existing classes can be updated to use BEM.
|
|
|
|
'selector-class-pattern': null,
|
|
|
|
// Allow more specificity until styles can be updated to match the more strict rules.
|
|
|
|
'selector-max-specificity': '0,6,3',
|
|
|
|
// Ignore rule until we confirmed we prefer shorthand properties for positioning.
|
|
|
|
'declaration-block-no-redundant-longhand-properties': null,
|
2021-12-23 02:42:22 +00:00
|
|
|
},
|
|
|
|
};
|