From cb3375bb1e49874080cea3e9700dc256e7b5d7f6 Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Mon, 11 Jan 2016 13:55:42 -0800 Subject: [PATCH] feat(tabs): add CSS to css file - Add tab specific CSS to separate CSS file --- Gruntfile.js | 6 +++--- src/tabs/docs/demo.html | 48 ----------------------------------------- src/tabs/tabs.css | 47 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 51 deletions(-) create mode 100644 src/tabs/tabs.css diff --git a/Gruntfile.js b/Gruntfile.js index b1e70cfd1e..919ff1a9e0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -251,7 +251,7 @@ module.exports = function(grunt) { css: [], js: [] }; - module.cssFiles.forEach(processCSS.bind(null, styles, true)); + module.cssFiles.forEach(processCSS.bind(null, module.name, styles, true)); if (styles.css.length) { module.css = styles.css.join('\n'); module.cssJs = styles.js.join('\n'); @@ -413,7 +413,7 @@ module.exports = function(grunt) { * Logic from AngularJS * https://github.com/angular/angular.js/blob/36831eccd1da37c089f2141a2c073a6db69f3e1d/lib/grunt/utils.js#L121-L145 */ - function processCSS(state, minify, file) { + function processCSS(moduleName, state, minify, file) { var css = fs.readFileSync(file).toString(), js; state.css.push(css); @@ -433,7 +433,7 @@ module.exports = function(grunt) { .replace(/\\/g, '\\\\') .replace(/'/g, "\\'") .replace(/\r?\n/g, '\\n'); - js = `angular.module('ui.bootstrap.carousel').run(function() {!angular.$$csp() && angular.element(document).find('head').prepend(''); });`; + js = `angular.module('ui.bootstrap.${moduleName}').run(function() {!angular.$$csp() && angular.element(document).find('head').prepend(''); });`; state.js.push(js); return state; diff --git a/src/tabs/docs/demo.html b/src/tabs/docs/demo.html index ff3f99da45..62f66138c5 100644 --- a/src/tabs/docs/demo.html +++ b/src/tabs/docs/demo.html @@ -1,52 +1,4 @@