2
0

.stylelintrc.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. module.exports = {
  2. extends: '@wagtail/stylelint-config-wagtail',
  3. rules: {
  4. 'scss/at-rule-no-unknown': [
  5. true,
  6. {
  7. ignoreAtRules: [
  8. 'tailwind',
  9. 'apply',
  10. 'variants',
  11. 'responsive',
  12. 'screen',
  13. 'layer',
  14. ],
  15. },
  16. ],
  17. 'no-invalid-position-at-import-rule': [
  18. true,
  19. {
  20. ignoreAtRules: ['tailwind', 'use'],
  21. },
  22. ],
  23. // Would be valuable for strict BEM components but is too hard to enforce with legacy code.
  24. 'no-descending-specificity': null,
  25. // Override stylelint-config-wagtail’s options to allow all float and clear values for now.
  26. 'declaration-property-value-allowed-list': {
  27. // 'clear': ['both', 'none'],
  28. // 'float': ['inline-start', 'inline-end', 'none', 'unset'],
  29. 'text-align': ['start', 'end', 'center'],
  30. },
  31. // Some parts of declaration-strict-value commented out until we are in a position to enforce them.
  32. 'scale-unlimited/declaration-strict-value': [
  33. [
  34. // Colors should always be defined from variables or functions.
  35. '/color/',
  36. 'fill',
  37. 'stroke',
  38. // Font tokens should come from our design tokens.
  39. 'font-family',
  40. // 'font-size',
  41. // 'font-weight',
  42. // Spacing should use a consistent scale rather than hard-coded values.
  43. // '/margin/',
  44. // '/padding/',
  45. // 'gap',
  46. // Consistently using variables for z-index allows us to define the order of the values globally.
  47. // 'z-index',
  48. ],
  49. {
  50. disableFix: true,
  51. ignoreValues: [
  52. 'currentColor',
  53. 'inherit',
  54. 'initial',
  55. 'none',
  56. 'unset',
  57. 'transparent',
  58. // System colors for forced-colors styling.
  59. // See https://drafts.csswg.org/css-color-4/#css-system-colors.
  60. 'Canvas',
  61. 'CanvasText',
  62. 'LinkText',
  63. 'VisitedText',
  64. 'ActiveText',
  65. 'ButtonFace',
  66. 'ButtonText',
  67. 'ButtonBorder',
  68. 'Field',
  69. 'FieldText',
  70. 'Highlight',
  71. 'HighlightText',
  72. 'SelectedItem',
  73. 'SelectedItemText',
  74. 'Mark',
  75. 'MarkText',
  76. 'GrayText',
  77. 'AccentColor',
  78. 'AccentColorText',
  79. ],
  80. },
  81. ],
  82. },
  83. };