feat: add CSS3 filter support#11176
Closed
shaidshark wants to merge 2 commits intoNativeScript:mainfrom
Closed
Conversation
- Implement filter CSS property with support for: blur, brightness, contrast, grayscale, saturate, invert, sepia, hue-rotate, drop-shadow (iOS), and opacity. - Added filter-parser.ts to parse filter functions. - Added native implementations for iOS (CIFilter) and Android (RenderEffect/ColorMatrix). - Added unit tests for filter parser. Note: drop-shadow on Android not fully implemented due to platform limitations. opacity filter function sets view alpha directly. Fixes NativeScript#1428
Contributor
|
Great effort @shaidshark, I know @triniwiz had some filters going here as well #11091, let's see if makes sense to combine them? |
CatchABus
reviewed
Apr 2, 2026
Contributor
There was a problem hiding this comment.
@shaidshark I believe the PR title has more room for improvement.
For start:
- It's not a fix but a new feature so please follow the PR guidelines and use the proper prefix and title format
- There's no need to mention all those details in title for a feature that is implemented now
- The PR description is a bit confusing, feels as if it analyzes improvements on a current implementation
Contributor
|
I see this is mentioned in your commits: This is also one important detailed that has to be mentioned in the PR details. |
Author
|
Thanks — good call on the title/description. I’ve updated the PR metadata so it’s clearly framed as a feature PR, and I added the platform limitations (especially Android drop-shadow and hue-rotate) to the description. |
Author
|
Also noted on the overlap with #11091. I’m happy to align/merge direction with that work if it makes more sense than keeping the changes separate. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1428
This PR adds CSS3
filterproperty support to NativeScript with parser coverage and native implementations for iOS and Android.Included
Supported filters
Platform limitations / notes
drop-shadowis not fully implemented on Android due to platform limitationshue-rotateis not fully supported on Android and should be treated as a partial implementationopacityoverlaps conceptually with the existing opacity property and may need careful handling in edge casesContext
This PR builds on the CSS filter support work and also addresses follow-up type-safety issues raised during review.