i have been playing arround with nativescript and i see that it offers us to style elements using css.
However in the docs http://docs.nativescript.org/ui/styling.html i see nothing mentioned about the unit of measurement for css.
This works
.title {
font-size: 30;
horizontal-align: center;
margin: 20;
}
And this does not work
.title {
font-size: 30;
horizontal-align: center;
margin: 20px;
}
Notice that margin is 20px in the second example.
So my question is when it comes to css what unit does nativescript use?
If someone came across this question in 2019 and beyond, the documentation specifies the units of measurements in Nativescript.
"NativeScript supports DIPs (Device Independent Pixels), pixels (via postfix px) and percentages (partial support for width, height and margin) as measurement units.
NativeScript's recommended measurement unit is DIP. All measurable properties like width, height, margin, paddings, border-width, etc.) support device independent pixels. The font sizes are always measured in DIPs."
Link: https://docs.nativescript.org/ui/styling#supported-measurement-units
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With