-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(core): add new text-shadow property #8991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): add new text-shadow property #8991
Conversation
Hi! |
* So all code that works on what is expected to be a TextView/TextInput should use `nativeTextViewProtected` so that any third party | ||
* components that need to have two separate components can work properly without them having to duplicate all the TextBase (and decendants) functionality | ||
* by just overriding the nativeTextViewProtected getter. | ||
**/ | ||
get nativeTextViewProtected() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove that comment ? It is actually an important comment
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
offsetY: this.nativeTextViewProtected.getShadowDy(), | ||
color: this.nativeTextViewProtected.getShadowColor(), | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First I dont think we need a default here. We have to be careful. Get default are slow because they make native calls. And yours even make 4 of them.
We now a default view as no shadow so not having a default value should be fine and faster.
Also you should use a const value to access native view protected instead of accessing it 4 times. If a class define it as a getter your would unnecessarly call it 4 times
@@ -188,6 +188,10 @@ export class TextBase extends TextBaseCommon { | |||
this._setNativeText(); | |||
} | |||
|
|||
[textShadowProperty.setNative](value: TextShadow) { | |||
this._setShadow(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why create a _setShadow method If you call it only once?
It makes the class."bigger" for now reason
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@NathanWalker you merged this without review comments being fixed ? that PR removes things which should not have been touched here ! |
@farfromrefug it's on the |
I get it. just that PR removes comments which should remain there for everyone to understand things. |
PR Checklist
What is the current behavior?
NativeScript does not support
text-shadow
. This has been a requested feature (#3597, #5268).What is the new behavior?
Adds
text-shadow
css property (andtextShadow
attribute).It implements a subset of the text-shadow web syntax. The expected format is:
The reasons for this limitation are:
1px 1px 2px red, 0 0 1em blue, 0 0 0.2em blue;
);rba(0, 0, 0)
,#fff
, etc.). It would be a lot of work;I thought I should have more feedback on this PR before adding more work.
I think it PR would still need:
apps.ui
);Demo (apps.ui):
Fixes/Implements/Closes #[Issue Number].
#3597 and part of #5268.