diff --git a/scripts/stylelint_rules/lib/use_theme_colors.js b/scripts/stylelint_rules/lib/use_theme_colors.js index 90f0ce2e6f..bba86fcf38 100644 --- a/scripts/stylelint_rules/lib/use_theme_colors.js +++ b/scripts/stylelint_rules/lib/use_theme_colors.js @@ -33,7 +33,7 @@ const CSS_PROPS_TO_CHECK_FOR_COLOR_USAGE = new Set([ 'outline' ]); -const borderCombinedDeclarations = new Set(['border-top', 'border-bottom', 'border-left', 'border-right']); +const borderCombinedDeclarations = new Set(['border', 'border-top', 'border-bottom', 'border-left', 'border-right']); const COLOR_INDICATOR_REGEXES = new Set([ // We don't have to check for named colors ("blue") as we lint to ban those separately. diff --git a/scripts/stylelint_rules/tests/use_theme_colors_test.js b/scripts/stylelint_rules/tests/use_theme_colors_test.js index 69203dbeee..622571760f 100644 --- a/scripts/stylelint_rules/tests/use_theme_colors_test.js +++ b/scripts/stylelint_rules/tests/use_theme_colors_test.js @@ -239,6 +239,12 @@ describe('use_theme_colors', () => { ]); }); + it('does not error when there is a var for the border width', async () => { + const warnings = await lint('p { border: var(--button-border-size) solid var(--color-primary); }'); + + assert.lengthOf(warnings, 0); + }); + it('is silent when linting code that has an empty var()', async () => { /** * This is a weird test case but if you've got Stylelint in your editor and