1. #1
    Sencha User silveralecs's Avatar
    Join Date
    Apr 2012
    Posts
    32
    Vote Rating
    1
    silveralecs is on a distinguished road

      0  

    Default Unanswered: Adding new CSS to app.json file

    Unanswered: Adding new CSS to app.json file


    Hi,

    I am trying to add some custom css to my application, and from what i've read , the best way si to add the css to my app.json file.
    After doing this, the Chrome Debugger returns the following error:
    Code:
    Uncaught SyntaxError: Unexpected token ILLEGAL
    My app.json css array looks like this:
    Code:
    {
        /**
         * List of all CSS assets in the right inclusion order.
         * Each item is an object with the following format:
         *      {
         *          "path": "path/to/item.css" // Path to file, if local file it must be relative to this app.json file
         *          "remote": true             // (Optional)
         *                                     // - Defaults to undefined (falsey) to signal a local file which will be copied
         *                                     // - Specify true if this file is a remote file which will not to be copied
         *          "update": "delta"          // (Optional)
         *                                     //  - If not specified, this file will only be loaded once, and
         *                                     //    cached inside localStorage until this value is changed to either one below
         *                                     //  - "delta" to enable over-the-air delta update for this file
         *                                     //  - "full" means full update will be made when this file changes
         *
         *      }
         */
        "css": [
            {
                "path": "resources/css/app.css",
                "update": "delta"
            },
            {
                "path": "resources/css/myCssStyle.css",
                "update": "delta"
            }
        ]
    
       ....
    }
    Do I have to recompile or something using sencha cmd, after modifying the css array ?
    After removing my css from the array everything works fine.

    Thank you for your help.

  2. #2
    Sencha User silveralecs's Avatar
    Join Date
    Apr 2012
    Posts
    32
    Vote Rating
    1
    silveralecs is on a distinguished road

      0  

    Default


    Anyone pls ?

  3. #3
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Posts
    1,394
    Answers
    148
    Vote Rating
    22
    AndreaCammarata has a spectacular aura about AndreaCammarata has a spectacular aura about

      0  

    Default


    I'm pretty sure the problem is due to the incorrect json file format.
    You probably forgot to open / close quotes somewhere.
    Try to look deeper, and if you will not find anything wrong, I suggest you to remove all the comments from the file, and validate it using jsonlint, it will find the error for you.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    CEO at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    http://www.tux-components.com/


  4. #4
    Sencha User silveralecs's Avatar
    Join Date
    Apr 2012
    Posts
    32
    Vote Rating
    1
    silveralecs is on a distinguished road

      0  

    Default


    The app.js file has been generated using the Sencha Cmd, so there couldn't be any errors.
    The problem appears only after I insert my css statement into the array. If I remove it, everything works fine.
    As you can see in the above example, there are no typos in the CSS array.

    Thank you,
    Alex

  5. #5
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Posts
    1,394
    Answers
    148
    Vote Rating
    22
    AndreaCammarata has a spectacular aura about AndreaCammarata has a spectacular aura about

      0  

    Default


    Quote Originally Posted by silveralecs View Post
    The app.js file has been generated using the Sencha Cmd, so there couldn't be any errors.
    The problem appears only after I insert my css statement into the array. If I remove it, everything works fine.
    As you can see in the above example, there are no typos in the CSS array.

    Thank you,
    Alex
    Even if that was generated using Sencha Cmd, you have edited it manually so there could be some errors / invisible chars which invalidate the json structure.
    I'm not able to see if there are errors from what you posted because that is only a part of the json file, not the whole.
    Did you tried to validate it using jsonlint?

    I have no errors adding a new css file to the mentioned array.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    CEO at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    http://www.tux-components.com/


  6. #6
    Sencha User
    Join Date
    Mar 2011
    Location
    Philippines
    Posts
    1
    Vote Rating
    0
    GoldenEye007 is on a distinguished road

      0  

    Default add

    add


    it doesn't issue any error message with me