← 返回首页
feat: css filter by triniwiz · Pull Request #11091 · NativeScript/NativeScript · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

feat: css filter#11091

Open
triniwiz wants to merge 6 commits into
mainfrom
feat/css-filter
Open

feat: css filter#11091
triniwiz wants to merge 6 commits into
mainfrom
feat/css-filter

Conversation

Copy link
Copy Markdown
Member

Add support for css filters e.g drop-shadow(16px 16px 20px red) invert(75%);

nx-cloud Bot commented Feb 18, 2026
edited
Loading

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 5cccbdc

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 4m 1s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-03 19:54:53 UTC

Comment thread packages/core/ui/text-base/index.android.ts Outdated Show resolved Hide resolved

PixsaOJ commented Feb 18, 2026

Copy link
Copy Markdown

Omg! BIG!

Comment thread packages/core/ui/core/view/index.android.ts Outdated Show resolved Hide resolved
// NativeScript
//
// Created by Osei Fortune on 17/02/2026.
//

NathanWalker Feb 20, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

We could put this in widgets to be included in the .xcframework, that way it's prebuilt and doesn't imply an extra build source on end users.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

I'll reject the PR to keep this reminder and we can work together to do this part.

// NativeScript
//
// Created by Osei Fortune on 17/02/2026.
//

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

I'll reject the PR to keep this reminder and we can work together to do this part.

}
[filterProperty.setNative](value: string) {
// LayoutBase, ImageView and StyleableTextView has the setFilter method implemented in the native view, so we need to check before call it.
const nativeView: globalAndroid.view.View & {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

@triniwiz Instead of creating a union type here, I have the following thought.
Let's create an interface in ui-mobile-base/widgets (e.g. ICSSFilter.java) with the needed methods and let ImageView, LayoutBase, and StyleableTextView implement it.
This way, we'll have an interface as a type for Java-side and a type in types file to use in TS-side.

return cm
}

internal fun parseCssColor(value: String): Int {

CatchABus May 5, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

@triniwiz @farfromrefug I'll just leave my thought on this one for both android and iOS.
This PR adds maps of colors for each platform and adds color parsing methods on native side.
I understand it all stems from the fact that it's cheaper to pass the raw string from core to native but is having duplicate functionality worth over let's say being afraid of passing more complex parameters to JNI calls?
I was thinking core could at least parse the color values alone since we already have the color module that already does that much.
So, filter property could have a valueConverter for converting the color values only and pass everything as parameters to native methods afterwards where everything else can be parsed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Atm this follows the web of taking a string input then building the filter from said input. Nothing wrong with keeping this in swift/objc or kotlin/java

NathanWalker added this to the 9.1 milestone May 16, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Footer

© 2026 GitHub, Inc.