This is a migrated thread and some comments may be shown as answers.

css files for different multiple screen sizes?

1 Answer 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tim
Top achievements
Rank 1
Tim asked on 10 Jul 2016, 09:28 AM

I have been reading the nativescript documentation on supporting multiple screen sizes.

I have been able to define all my views without specifying the width & height values. However there are a few elements that are used on several screens that I have set the height for in the app.css.

So is it possible to specify app.minWH600.css ?

 

The documentation alludes to it, but provides the view XML files as example, and then uses the css as an example of a platform specifier. 

 

 

1 Answer, 1 is accepted

Sort by
0
Nick Iliev
Telerik team
answered on 11 Jul 2016, 11:28 AM
Hello Tim,

Currently, it is not possible to specify differently CSS files for multiple screen sizes.
However, CSS itself is providing an easier way to create different UX for your screen size qualifiers files.
Consider the following scenario:

You have
main-page.minWH720.xml 
main-page.minWH480.xml
And you need to provide different styles for both pages.
What you can do is the following:
.my-button-for-wh720page {
   background-color: red
}
 
.my-button-for-wh480page {
   background-color: blue
}

And use them accordingly where needed
For example: 
the button in .minWH720, will have cssClass="my-button-for-wh720page"
the button in main-page.minWH480,xml will have cssClass="my-button-for-wh480page"


Regards,
Nikolay Iliev
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Tim
Top achievements
Rank 1
Answers by
Nick Iliev
Telerik team
Share this question
or