Skip to content

Conversation

@yisibl
Copy link
Collaborator

@yisibl yisibl commented Apr 11, 2025

Currently, only Safari supports it: https://caniuse.com/css-filter-function

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The syntax for the filter() function is:

filter() = filter( [ <image> | <string> ], <filter-value-list> )

So three annotations:

  1. The first parameter can also be a <string>. Though that's a bit strange, because the spec. doesn't define what this value refers to. I'll try to dig deeper and may create a spec. issue for that.
  2. The second parameter is a <filter-value-list>. That means we should have at least one test for multiple filters.
  3. <image> includes more than just gradients and URLs. So maybe we should add a few tests regarding those other values.

},
tests: [
// filter() = filter( [ <image> | <string> ], <filter-value-list> )
'filter(conic-gradient(red), invert(1))',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single-stop gradients were only added recently, as far as I know. So I wouldn't include those in the tests for filter().

Generally, I don't think it is necessary to test (so many) different gradient syntaxes here. One basic test per gradient function or even just one for gradients in general should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants