Giter Club home page Giter Club logo

nativescript-platform-css's Introduction

NativeScript-Platform-CSS

A NativeScript plugin to deal with Declarative UI and Platform specific CSS

What is it?

This plugin automatically add some platform related css variable to the current Page.

It allows you to customize your UI for android or ios only:

.ios .example {
  color: blue;
}

.android .example {
  color: red;
}

This also adds classes related to the DPI of the screen. We have this range of DPI 1280, 1024, 800, 600, 540, 480, 400, 360, 320

You will be able to select that like that:

.ios800 .example {
  font-size: 25;
}

.ios480 .example {
  font-size: 18;
}

.android800 .example {
  font-size: 25;
}

.android480 .example {
  font-size: 18;
}

or also like that:

.screen800 .example {
  font-size: 25;
}

.screen480 .example {
  font-size: 18;
}

You have also access to class with the device name:

.samsunggalaxys6 .example {
  color: red;
}

.iphone6s .example {
  color: blue;
}

Installation

This plugin runs only on Nativescript 7.0 and later.

ns plugin add @vulksoft/nativescript-platform-css@latest

Usage

You only need to require() the plugin in your app.js or main.ts (if angular or vue). This will automatically add the css classes on the current loaded page.

Demo

You can try the demo app that will show you the css classes that are added on the page.

Contributors

  • Nathanael Anderson
  • Steve McNiven-Scott
  • Dave Coffin
  • Jonathan Salomon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.