After struggling for two days and finding numerous online tutorials, I still require assistance. My goal is to add a namespace to Bootstrap so that I can use it in Salesforce without conflicting with Salesforce's stylesheet. I plan on wrapping the bootstrap.less with .bs{} to make it a resource on my page, but unfortunately, the bootstrap.css isn't compiling.
Bootstrap Test v2
├───bootstrap-3.3.7
├───Gruntfile.js
|───dist
| |───css
| |───bootstrap.css
|───less
|───bootstrap.less
Steps to follow:
1) Modify bootstrap.less (wrap content with .bs{})
2) Go to Bootstrap Test V2 directory
3) Run command 'grunt dist'
Output:
C:\Users\json\Desktop\Bootstrap\Bootstrap Test v2>grunt dist
(node:8444) ExperimentalWarning: The http2 module is an experimental API.
Running "clean:dist" (clean) task
>> 1 path cleaned.
...
...
Done.
Execution Time (2018-05-23 23:58:31 UTC+3)
(clean:dist 77ms)
(less:compileCore 994ms)
(less:compileTheme 146ms)
(autoprefixer:core 538ms)
(autoprefixer:theme 90ms)
(csscomb:dist 1.1s)
(cssmin:minifyCore 421ms)
(cssmin:minifyTheme 53ms)
(copy:fonts 48ms)
(uglify:core 427ms)
(Total 3.9s)
gruntfile:
module.exports = function(grunt) {
require('jit-grunt')(grunt);
grunt.initConfig({
less: {
development: {
options: {
compress: true,
yuicompress: true,
optimization: 2
},
files: {
"dist/css/bootstraptest.css": "less/bootstrap.less"
}
},
production: {
options: {
paths: ["assets/css"],
cleancss: true
},
files: {"dist/css/bootstrap.css": "less/bootstrap.less"}
}
},
watch: {
styles: {
files: ['less/**/*.less'],
tasks: ['less'],
options: {
nospawn: true
}
}
}
});
grunt.registerTask('default', ['less', 'watch']);
};
module.exports = function(grunt) {
grunt.initConfig({
less: {
development: {
options: {
paths: ["assets/css"]
},
files: {"dist/css/bootstrap.css": "less/bootstrap.less"}
},
production: {
options: {
paths: ["assets/css"],
cleancss: true
},
files: {"dist/css/bootstrap.css": "less/bootstrap.less"}
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.registerTask('default', ['less']);
};
Notes: 1) When using the 'grunt' command, I'm encountering an error related to 'jekyll:docs' task and it suggests downloading Jekyll, which I already have installed. I've searched online and found that 'grunt dist' should work - am I missing something?