The Wayback Machine - https://web.archive.org/web/20201101030139/https://github.com/NativeScript/NativeScript/pull/8991
Skip to content
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

Open
wants to merge 2 commits into
base: master
from

Conversation

@tralves
Copy link

@tralves tralves commented Oct 28, 2020

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 (and textShadow attribute).

It implements a subset of the text-shadow web syntax. The expected format is:

<offset-x> <offset-y> <blur-radius> <color>
e.g.
2 10 4 rgb(255, 100, 100)
2px 10px 2px rgba(10, 10, 10, 0.5)
1 1 1 #55a
2 2 2 #aaa

The reasons for this limitation are:

  • some of the default values in the web syntax are not clear (i.e., people shouldn't use them anyway);
  • It is impossible to implement multiple shadows (e.g. 1px 1px 2px red, 0 0 1em blue, 0 0 0.2em blue;);
  • parsing/tokenisation would not be trivial because there are multiple formats for colors (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:

  • Unit tests (I didn't add them yet, but I added a demo for this feature in the apps.ui);
  • Add more syntax options (maybe? which ones?);
  • Validation/syntax errors;
  • Support for formatted strings and spans (not sure if it's even possible);
  • Support for tab headers (not sure if it's even possible);

Demo (apps.ui):

ns-text-shadows

Fixes/Implements/Closes #[Issue Number].
#3597 and part of #5268.

@cla-bot cla-bot bot added the cla: yes label Oct 28, 2020
@tralves tralves changed the title feature(ui): add new text-shadow property feat(core): add new text-shadow property Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.