Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(html-view): Additional properties for HtmlView component #8207

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

Merged
merged 5 commits into from
Jan 8, 2020

Conversation

xuhcc
Copy link
Contributor

@xuhcc xuhcc commented Dec 19, 2019

PR Checklist

What is the current behavior?

  • Customizing the font, text color and link color using CSS is not supported.
  • Text is not selectable on Android.
  • Unnecessary left padding on IOS.

What is the new behavior?

  • Allow to set text color with color CSS property.
  • Allow to set link color with link-color CSS property.
  • Allow to set font attributes with font-family and font-size CSS properties.
  • Make text selectable on Android by default (for consistency with IOS).
  • Remove extra padding on IOS.

Implements #1266
Related: #1268 #4358 #4746

BREAKING CHANGES:

The appearance of HtmlView component may change in existing apps.

- Allow to set text color with `color` CSS property.
- Allow to set link color with `link-color` CSS property.
- Allow to set font attributes with `font-family` and `font-size` CSS properties.
- Make text selectable on Android by default (for consistency with IOS).
- Remove extra padding on IOS.
@cla-bot cla-bot bot added the cla: yes label Dec 19, 2019
} from "./html-view-common";
import { ios } from "../../utils/utils";

export * from "./html-view-common";

const majorVersion = ios.MajorVersion;

function uiColorToHex(uiColor: UIColor): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be better if you move the function in the nativescript-core/color/color-common.ts file and use it from there, as it seems like something that can be used in other places as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made it a static method in Color class.

@vtrifonov
Copy link
Contributor

vtrifonov commented Jan 8, 2020

@xuhcc I've added the new properties in the e2e test by committing directly in your branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants