1. #1
    Sencha Premium Member
    Join Date
    Jan 2014
    Location
    Cary, NC
    Posts
    35
    Answers
    1
    Vote Rating
    0
    kamerc is on a distinguished road

      0  

    Default Answered: Custom CSS for different devices/platforms

    Answered: Custom CSS for different devices/platforms


    I am taking advantage of ST theming so I am specifying whether the user should see mountainview or cupertino themes. In addition, I have added my own custom.css which is all working fine. The problem I am running into is when I try to import an additional custom css file "custom-android.css" which I would like to load on just the Android platform. Whenever I try to do this my app won't load. My app.json code:

    {
    "update": "delta",
    "platform": [
    "android"
    ],
    "theme": "Android",
    "path": "theme/mountainview-3434be36-e205-4f2c-b751-31338a698b9a.css"
    },
    {
    "update": "delta",
    "platform": [
    "ios"
    ],
    "theme": "iOS",
    "path": "theme/cupertino-4b8847b1-050a-459e-a556-83d8ddd33a06.css"
    },
    {
    "update": "delta",
    "path": "resources/css/custom.css"
    },
    {
    "update": "delta",
    "platform": [
    "android"
    ],
    "theme": "Android",
    "path": "resources/css/custom-android.css"
    },

    I have also tried using 1 android object and making path an array of files, but that was not valid:

    {
    "update": "delta",
    "platform": [
    "android"
    ],
    "theme": "Android",
    "path": [
    "theme/mountainview-3434be36-e205-4f2c-b751-31338a698b9a.css",
    "resources/css/custom-android.css"
    ]
    },

    So my question is how can I load more than 1 css file for a specific platform/theme? custom-android.css should always be loaded after custom.css because I override some of my custom styles to be android specific.

  2. You should compile your CSS files into a single CSS file. Using SASS you can import the android theme.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,217
    Answers
    3519
    Vote Rating
    859
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You should compile your CSS files into a single CSS file. Using SASS you can import the android theme.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha Premium Member
    Join Date
    Jan 2014
    Location
    Cary, NC
    Posts
    35
    Answers
    1
    Vote Rating
    0
    kamerc is on a distinguished road

      0  

    Default


    ah, ok thanks! Got it working.

Thread Participants: 1

Tags for this Thread