Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Grunt and Compass

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #44837
    iamlukem
    Member

    Hey Chris,

    We were having some issues with the compass image-url() helper putting in those annoying ‘/’ before all the image links and found that setting ‘relativeAssets: true’ solves it.

    When using ‘relativeAssets: true’ all the paths become relative to the Gruntfile.js and removes the ‘/’ when compiling.

    Here is our compass task within Grunt.

    compass:
    {
    development:
    {
    options:
    {
    httpPath: ”,
    relativeAssets: true,
    sassDir: ‘<%= pkg.path.src.compass %>‘,
    cssDir: ‘<%= pkg.path.development %>/<%= pkg.path.lib.styles %>‘,
    imagesDir: ‘<%= pkg.path.development %>/<%= pkg.path.lib.images %>‘,
    outputStyle: ‘expanded’
    }
    },
    deploy:
    {
    options:
    {
    httpPath: ”,
    relativeAssets: true,
    sassDir: ‘<%= pkg.path.src.compass %>‘,
    cssDir: ‘<%= pkg.path.development %>/<%= pkg.path.lib.styles %>‘,
    imagesDir: ‘<%= pkg.path.development %>/<%= pkg.path.lib.images %>‘,
      outputStyle: “compressed”
    }
    }
    },

    the ‘pkg.path…’ links are just the paths we termed within the ‘package.json’ file.

    You can also use this within your config.rb file for all those using the compass without grunt. just change ‘relativeAssets: true’ to ‘relative_assets: true’

    Hope this helps anyone else with the same issue.

    Luke.

Viewing 1 post (of 1 total)
  • The forum ‘CSS’ is closed to new topics and replies.