diff --git a/.gitignore b/.gitignore index eb79dd5f..d2ae2edc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules .idea +.sass-cache \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 31404e99..051ad053 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -6,7 +6,19 @@ module.exports = function (grunt) { html2js: { options: { // custom options, see below - base: 'templates' + base: 'templates', + quoteChar: '\'', + useStrict: true, + htmlmin: { + collapseBooleanAttributes: true, + collapseWhitespace: true, + removeAttributeQuotes: false, + removeComments: true, + removeEmptyAttributes: false, + removeRedundantAttributes: true, + removeScriptTypeAttributes: false, + removeStyleLinkTypeAttributes: false + } }, main: { src: ['templates/views/**/*.html'], @@ -14,11 +26,25 @@ module.exports = function (grunt) { } }, + sass: { + dist: { + files: [ + { + expand: true, + cwd: "sass", + src: ["**/app.scss"], + dest: "css", + ext: ".css" + } + ] + } + }, + //@TODO JSHint, comile sass watch: { scripts: { files: ['Gruntfile.js', 'views/*.html'], - tasks: ['html2js'], + tasks: ['html2js','sass'], options: { spawn: false, interrupt: true, @@ -38,6 +64,7 @@ module.exports = function (grunt) { }); // Load the plugin that provides the "uglify" task. + grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-html2js'); grunt.loadNpmTasks('grunt-contrib-watch'); diff --git a/css/style.css b/css/style.css deleted file mode 100644 index eca406f6..00000000 --- a/css/style.css +++ /dev/null @@ -1,3 +0,0 @@ -#hello { - color: red; -} \ No newline at end of file diff --git a/js/templates.js b/js/templates.js index 886c4c63..eb52c98b 100644 --- a/js/templates.js +++ b/js/templates.js @@ -1,6 +1,7 @@ angular.module('templates-main', ['views/main.html']); -angular.module("views/main.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("views/main.html", - "Hello world!"); +angular.module('views/main.html', []).run(['$templateCache', function($templateCache) { + 'use strict'; + $templateCache.put('views/main.html', + 'Hello world!'); }]); diff --git a/package.json b/package.json index 9777e171..afe85236 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,10 @@ "grunt": "~0.4.5", "grunt-contrib-jshint": "~0.10.0", "grunt-contrib-nodeunit": "~0.4.1", + "grunt-contrib-sass": "^1.0.0", "grunt-contrib-uglify": "~0.5.0", "grunt-contrib-watch": "^1.0.0", - "grunt-html2js": "^0.3.6" + "grunt-html2js": "^0.3.6", + "html-minifier": "^3.0.2" } } diff --git a/sass/app.scss b/sass/app.scss new file mode 100644 index 00000000..2fb8ba92 --- /dev/null +++ b/sass/app.scss @@ -0,0 +1,3 @@ + +@import 'container'; +@import 'menu'; \ No newline at end of file diff --git a/sass/config.scss b/sass/config.scss new file mode 100644 index 00000000..e7b71e10 --- /dev/null +++ b/sass/config.scss @@ -0,0 +1,3 @@ +body{ + +} \ No newline at end of file diff --git a/sass/container.scss b/sass/container.scss new file mode 100644 index 00000000..e69de29b diff --git a/sass/menu.scss b/sass/menu.scss new file mode 100644 index 00000000..e69de29b diff --git a/templates/main.php b/templates/main.php index c9fbf89a..d1f4da75 100644 --- a/templates/main.php +++ b/templates/main.php @@ -19,7 +19,7 @@ script('passman', 'app/controllers/main'); /* * Styles */ -style('passman', 'style'); +style('passman', 'app'); ?>