skip to Main Content

I know that nativescript used to support a subset of CSS standard. Does twitter bootstrap work on the latest Nativescript version? If not, is there any plan to make it work?

2

Answers


  1. Although it’s theoretically possible, I doubt it would work “out of the box”.
    You can take a look here for which CSS attributes are supported.

    https://github.com/NativeScript/docs/blob/master/styling.md

    Login or Signup to reply.
  2. In short: No.

    Longer version: Bootstrap is a CSS framework intended for html. NativeScript is not utilizing HTML. NativeScript has its own set of UI element.

    1. There’s a lot of properties in Bootstrap which isn’t supported by NativeScript. Actually NativeScript only supports a very small subset of the CSS properties. This means that stuff like font-size: ..., border-radius: ..., font-weight: ..., display: ... etc wouldn’t work.

    2. There’s a lot of values in Bootstrap which isn’t supported by NativeScript. E.g. width: 100%; wouldn’t work as there’s no such thing as width in percentage in NativeScript. Or width: 1170px; as there’s no pixels in NativeScript.

    3. There’s a lot of selectors in Bootstrap which selects HTML fields. Please remember that there are no such things as HTML fields in NativeScript. This means that all HTML selectors such as a, input, table, p etc wouldn’t work. The elements simply does not exist.

    There’s no way of getting Bootstrap (or any other made-for-browser-framework) to work with NativeScript. Your best bet, if you like the Bootstrap look and feel is to start fresh and create your own “framework” especially for NativeScript and mimic Bootstrap as much as possible (even though you currently will not be able to get a 1 to 1 match).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search