1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    11
    Vote Rating
    0
    josser is on a distinguished road

      0  

    Default Unanswered: Mastering SASS/CSS, how to set backgrond image?

    Unanswered: Mastering SASS/CSS, how to set backgrond image?


    Hi, I'm trying to add custom css to my project.
    app.json:

    Code:
    "css": [{
                "path": "resources/css/app.css",
                "update": "delta"
              }, {
              "path": "resources/css/styles.css",
              "update": "delta"
              }
        ],
    resources/sass/styles.saas
    Code:
    .c-post-marker {
        position: relative;
        background-image: image-url('resources/images/post_marker.png');
        height: 61px;
        width: 50px;
    }
    sencha app build package:
    Code:
    [shellscript] WARNING: '''post_marker.png''' was not found (or cannot be read) in /Users/josser/Projects/project_name/resources/sass/Users/josser/Projects/project_name/resources/sass/../images/resources/images
    So, for some reason path is realy wrong because it doubled.
    I tried to set absolute path:
    Code:
    background-image: image-url('/resources/images/post_marker.png');
    but no luck, image just didn't load. I checked what it tries to load in weinre and found this:
    Code:
    file:///resources/images/post_marker.png
    So, what is correct way to set path for images?
    Thanks!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,640
    Vote Rating
    434
    Answers
    3106
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    a proper SASS file doesn't have extension .sass and the build process for Sencha Command shouldn't be compiling your SASS (the new Cmd does) so are you including post_marker.png somewhere else in app.json?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

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

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    11
    Vote Rating
    0
    josser is on a distinguished road

      0  

    Default


    Oh, I'm very sorry, the correct filename is styles.scss instead of styles.saas

Tags for this Thread