Results 1 to 3 of 3

Thread: Custom CSS for different devices/platforms

  1. #1
    Sencha Premium Member
    Join Date
    Jan 2014
    Location
    Cary, NC
    Posts
    35
    Answers
    1
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    You should compile your CSS files into a single CSS file. Using SASS you can import the android theme.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha Premium Member
    Join Date
    Jan 2014
    Location
    Cary, NC
    Posts
    35
    Answers
    1
    Vote Rating
    0
      0  

    Default

    ah, ok thanks! Got it working.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •