mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
feat(html-view): Additional properties for HtmlView component (#8207)
* feat(html-view): Additional properties for HtmlView component - 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. * refactor: Move uiColorToHex function to nativescript-core/color module * test: adding test for new HtmlView css properties Co-authored-by: Vasil Trifonov <v.trifonov@gmail.com>
This commit is contained in:

committed by
Vasil Trifonov

parent
3c340b42dc
commit
9217094a8e
@ -1,5 +1,7 @@
|
||||
import { HtmlView as HtmlViewDefinition } from ".";
|
||||
import { Color } from "../../color";
|
||||
import { Style, CssProperty } from "../core/properties";
|
||||
import { View, Property, CSSType } from "../core/view";
|
||||
import { HtmlView as HtmlViewDefinition } from ".";
|
||||
|
||||
export * from "../core/view";
|
||||
|
||||
@ -13,3 +15,11 @@ HtmlViewBase.prototype.recycleNativeView = "auto";
|
||||
// TODO: Can we use Label.ios optimization for affectsLayout???
|
||||
export const htmlProperty = new Property<HtmlViewBase, string>({ name: "html", defaultValue: "", affectsLayout: true });
|
||||
htmlProperty.register(HtmlViewBase);
|
||||
|
||||
export const linkColorProperty = new CssProperty<Style, Color>({
|
||||
name: "linkColor",
|
||||
cssName: "link-color",
|
||||
equalityComparer: Color.equals,
|
||||
valueConverter: (value) => new Color(value),
|
||||
});
|
||||
linkColorProperty.register(Style);
|
||||
|
Reference in New Issue
Block a user