Skip to content

Commit

Permalink
Merge pull request #1539 from UCLALibrary/jquery-ui-css-scope
Browse files Browse the repository at this point in the history
scope Mirador's jQuery UI CSS rules to '.mirador-container'
  • Loading branch information
mejackreed authored Jan 10, 2019
2 parents 0406537 + e99377e commit 32e6bd5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ _SpecRunner.html
bkp
css/discovery.css
css/mirador.css
css/jquery-ui-scoped.css
dev.html
discovery.html
js/discovery
Expand Down
25 changes: 22 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-githooks');
grunt.loadNpmTasks('grunt-css-selectors');

// ----------
var distribution = 'build/mirador/mirador.js',
Expand Down Expand Up @@ -94,7 +95,7 @@ module.exports = function(grunt) {
'css/bootstrap.modals.css',
'css/normalize.css',
'node_modules/font-awesome/css/font-awesome.min.css',
'css/jquery-ui.min.css',
'css/jquery-ui-scoped.css',
'node_modules/jstree/dist/themes/default/style.min.css',
'css/collection-tree-mod.css',
'node_modules/qtip2/dist/jquery.qtip.min.css',
Expand Down Expand Up @@ -249,6 +250,19 @@ module.exports = function(grunt) {
ci: {
src: 'reports/coverage/PhantomJS*/lcov.info'
}
},

css_selectors: {
options: {
mutations: [{
prefix: '.mirador-container'
}]
},
your_target: {
files: {
'css/jquery-ui-scoped.css': ['css/jquery-ui.min.css']
}
}
}
});

Expand All @@ -268,15 +282,20 @@ module.exports = function(grunt) {
// Lint task
grunt.registerTask('lint', ['jshint', 'eslint']);

// ----------
// jQueryUI CSS task.
// Scopes all jQueryUI CSS selectors with '.mirador-container'.
grunt.registerTask('jqueryui_css', ['css_selectors']);

// ----------
// Build task.
// Cleans out the build folder and builds the code and images into it, checking lint.
grunt.registerTask('build', [ 'clean:build', 'git-describe', 'lint', 'less', 'concat', 'uglify', 'cssmin', 'copy']);
grunt.registerTask('build', [ 'clean:build', 'git-describe', 'lint', 'less', 'jqueryui_css', 'concat', 'uglify', 'cssmin', 'copy']);

// ----------
// Dev Build task.
// Build, but skip the time-consuming and obscurantist minification and uglification.
grunt.registerTask('dev_build', [ 'clean:build', 'git-describe', 'lint', 'less', 'concat', 'copy']);
grunt.registerTask('dev_build', [ 'clean:build', 'git-describe', 'lint', 'less', 'jqueryui_css', 'concat', 'copy']);

// ----------
// Default task.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"grunt-contrib-less": "^1.4.0",
"grunt-contrib-uglify": "*",
"grunt-contrib-watch": "*",
"grunt-css-selectors": "^1.3.0",
"grunt-git-describe": "*",
"grunt-githooks": "^0.3.1",
"grunt-template-jasmine-istanbul": "^0.3.3",
Expand Down

0 comments on commit 32e6bd5

Please sign in to comment.