Skip to content

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

@triniwiz
Copy link
Copy Markdown
Member

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

image

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Feb 18, 2026

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
@PixsaOJ
Copy link
Copy Markdown

PixsaOJ commented Feb 18, 2026

Omg! BIG!

Comment thread packages/core/ui/core/view/index.android.ts Outdated
// NativeScript
//
// Created by Osei Fortune on 17/02/2026.
//
Copy link
Copy Markdown
Contributor

@NathanWalker NathanWalker Feb 20, 2026

Choose a reason for hiding this comment

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

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.

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.

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.

@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 {
Copy link
Copy Markdown
Contributor

@CatchABus CatchABus May 5, 2026

Choose a reason for hiding this comment

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

@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.

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

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