diff --git a/lib/rules/alpha-value-notation/__tests__/index.js b/lib/rules/alpha-value-notation/__tests__/index.js index 3bafc95128..176c8fe9ee 100644 --- a/lib/rules/alpha-value-notation/__tests__/index.js +++ b/lib/rules/alpha-value-notation/__tests__/index.js @@ -79,6 +79,15 @@ testRule({ endLine: 1, endColumn: 31, }, + { + code: 'feDropShadow { flood-opacity: 50% }', + fixed: 'feDropShadow { flood-opacity: 0.5 }', + message: messages.expected('50%', '0.5'), + line: 1, + column: 31, + endLine: 1, + endColumn: 34, + }, { code: 'a { color: rgba(0, 0, 0, 50%) }', fixed: 'a { color: rgba(0, 0, 0, 0.5) }', diff --git a/lib/rules/alpha-value-notation/index.js b/lib/rules/alpha-value-notation/index.js index f0f4561eec..70ab607b8e 100644 --- a/lib/rules/alpha-value-notation/index.js +++ b/lib/rules/alpha-value-notation/index.js @@ -23,7 +23,15 @@ const meta = { fixable: true, }; -const ALPHA_PROPS = new Set(['opacity', 'shape-image-threshold']); +const ALPHA_PROPS = new Set([ + 'opacity', + 'shape-image-threshold', + // SVG properties + 'fill-opacity', + 'flood-opacity', + 'stop-opacity', + 'stroke-opacity', +]); const ALPHA_FUNCS = new Set(['hsl', 'hsla', 'hwb', 'lab', 'lch', 'rgb', 'rgba']); /** @type {import('stylelint').Rule} */