Skip to content

Add support for platform specific css rules for multiple platforms in the same file #5180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
erkanarslan opened this issue Dec 17, 2017 · 5 comments
Labels

Comments

@erkanarslan
Copy link

This is a feature request.

In current situation, we need to create a css file for common rules and 2 files for android and iOS specific rules even if it is just a few lines. Also if you create a platform specific css file you have to create another file for other platform even if you put nothing in it, otherwise angular or file import codes will complain about the missing file.

To solve this problem, allow us to define platform specific css rules in the same file. Maybe we can use media queries for this. For example, when developing for web, you can define different css rules based on screen resolution and whether it is for screen or print. For Nativescript, we can check the platform in media queries.

@erkanarslan erkanarslan changed the title Add support for different platform specific css rules in the same file Add support for platform specific css rules for multiple platforms in the same file Dec 17, 2017
@tsonevn
Copy link
Contributor

tsonevn commented Dec 18, 2017

Hi @erkanarslan,
Thank you for contacting us.

If I understand you correctly you would like NativeScript to support for CSS media queries in the CSS.
If this is correct, we have already similar issue logged here. Regarding that, you could vote for this feature on the other issue and we could close this one.

Let me know if the case is different and I will reopen this issue.

@erkanarslan
Copy link
Author

@tsonevn If you are talking about issue #64, that is not what I am requesting. In that issue, media queries are requested for different device resolutions. Here I want it for applying different styles to android and ios devices. Example:

@media (platform : android) {
    Label { text-align : left; } 
}

@tsonevn
Copy link
Contributor

tsonevn commented Dec 18, 2017

Hi @erkanarslan,
Excuse me I missed to attached the issue in my previous comment.
Indeed I was talking about issue #64. The issue describes the support of the @media rule in its general use case, however, you could add your case as a comment in the old issue, while providing the same example.
It would be better to keep the this feature request in one issue.

@NathanaelA

This comment was marked as abuse.

@lock
Copy link

lock bot commented Aug 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants