Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Sandbox a CSS library by prefixing its selectors
CoffeeScript
Branch: master
Failed to load latest commit information.
tasks Fixes #10
test Fixes #10
.gitignore now as a Grunt task
.nvmrc bump
Gruntfile.coffee now as a Grunt task
README.md now as a Grunt task
package.json typo in link; thanks @elisechant

README.md

grunt-sandbox-css Built with Grunt

Codeship Status for radekstepan/grunt-sandbox-css

Say you are loading a Foundation/Bootstrap library for a widet and don't want them affecting the rest of the page. This Grunt plugin will prefix all selectors in input CSS file with your custom one.

Quick start

Example Gruntfile.coffee:

module.exports = (grunt) ->
    grunt.initConfig
        pkg: grunt.file.readJSON "package.json"

        sandbox_css:
            foundation:
                files:
                  'build/foundation.sandboxed.css': 'src/foundation.css'
                options:
                    # E.g.: .row -> .foundation .row
                    prefix: '.foundation'
                    # Selectors where we do not prefix.
                    blacklist: [ 'html', 'body' ]

    grunt.loadNpmTasks('grunt-sandbox-css')

    grunt.registerTask('default', [ 'sandbox_css' ])
Something went wrong with that request. Please try again.