Permalink
Browse files

Use LESS

  • Loading branch information...
vojtajina committed Jun 4, 2012
1 parent 236d8da commit d7aecc567ac4cbcc970e0f06594135da538697ba
Showing with 82 additions and 51 deletions.
  1. +1 −0 .gitignore
  2. +6 −2 README.md
  3. +42 −42 app/{css/app.css → less/app.less}
  4. +5 −5 app/{css/tabs.css → less/tabs.less}
  5. +28 −2 grunt.js
View
@@ -1,2 +1,3 @@
build
+app/css
test/unit/*/*.js
View
@@ -6,16 +6,20 @@ Just a text editor.
### Install required packages
- npm install -g testacular grunt coffee-script
+ npm install -g testacular grunt coffee-script less
-### Watch + recompile unit tests
+### Watch unit tests (coffe script) and styles (less)
grunt watch
### Recompile all unit tests (coffee script)
grunt coffee:unit
+### Recompile all less styles
+
+ grunt less:app
+
## Built With
@@ -53,50 +53,50 @@ input {
position: absolute;
top: 30px;
bottom: 20px;
- /*left: 230px;*/
+/*left: 230px;*/
left: 0;
right: 240px;
}
/* logging window */
/*#log {*/
- /*position: absolute;*/
- /*top: 0;*/
- /*right: 0;*/
- /*width: 300px;*/
- /*height: 400px;*/
- /*z-index: 200000;*/
- /*background: white;*/
- /*overflow: scroll;*/
- /*padding: 5px;*/
- /*font-family: courier;*/
+/*position: absolute;*/
+/*top: 0;*/
+/*right: 0;*/
+/*width: 300px;*/
+/*height: 400px;*/
+/*z-index: 200000;*/
+/*background: white;*/
+/*overflow: scroll;*/
+/*padding: 5px;*/
+/*font-family: courier;*/
/*}*/
/*#log header {*/
- /*position: fixed;*/
- /*width: 300px;*/
- /*background: #d0d0d0;*/
- /*padding: 5px;*/
- /*margin: -5px;*/
+/*position: fixed;*/
+/*width: 300px;*/
+/*background: #d0d0d0;*/
+/*padding: 5px;*/
+/*margin: -5px;*/
/*}*/
/*#log header a {*/
- /*margin-right: 5px;*/
- /*float: right;*/
- /*text-decoration: underline;*/
+/*margin-right: 5px;*/
+/*float: right;*/
+/*text-decoration: underline;*/
/*}*/
/*#log ul {*/
- /*margin-top: 30px;*/
+/*margin-top: 30px;*/
/*}*/
/*#log li.digest {*/
- /*color: gray;*/
+/*color: gray;*/
/*}*/
/*#log li.error {*/
- /*color: red;*/
+/*color: red;*/
/*}*/
@@ -117,7 +117,7 @@ input {
#status-bar a.icon-cog {
color: inherit;
- /*color: #555;*/
+/*color: #555;*/
font-size: 1.4em;
padding: 2px;
margin-top: -4px;
@@ -147,33 +147,33 @@ input {
}
/*a.config-btn {*/
- /*font-size: 3em;*/
- /*z-index: 1;*/
- /*position: absolute;*/
- /*bottom: 10px;*/
- /*right: 10px;*/
- /*color: #D1D1D1;*/
- /*width: 30px;*/
- /*height: 30px;*/
+/*font-size: 3em;*/
+/*z-index: 1;*/
+/*position: absolute;*/
+/*bottom: 10px;*/
+/*right: 10px;*/
+/*color: #D1D1D1;*/
+/*width: 30px;*/
+/*height: 30px;*/
/*}*/
/*a.config-btn:hover {*/
- /*text-decoration: none;*/
- /*color: #F6F6F6;*/
+/*text-decoration: none;*/
+/*color: #F6F6F6;*/
/*}*/
/*#config {*/
- /*position: absolute;*/
- /*right: 0;*/
- /*top: 30px;*/
- /*bottom: 0;*/
- /*width: 300px;*/
- /*background-color: #191916;*/
- /*z-index: 2;*/
- /*border-left: 1px solid #D1D1D1;*/
+/*position: absolute;*/
+/*right: 0;*/
+/*top: 30px;*/
+/*bottom: 0;*/
+/*width: 300px;*/
+/*background-color: #191916;*/
+/*z-index: 2;*/
+/*border-left: 1px solid #D1D1D1;*/
/*}*/
/*#config a.config-btn {*/
- /*left: 10px;*/
+/*left: 10px;*/
/*}*/
@@ -1,12 +1,12 @@
.tabs {
- /*text-align: center;*/
+/*text-align: center;*/
list-style: none;
margin: 0;
- /*margin: 200px 0 20px;*/
+/*margin: 200px 0 20px;*/
padding: 0 0 0 15px;
- /*line-height: 24px;*/
- /*height: 30px;*/
+/*line-height: 24px;*/
+/*height: 30px;*/
overflow: hidden;
font-size: 12px;
font-family: arial, verdana;
@@ -27,7 +27,7 @@
border-top-right-radius: 6px;
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 #FFF;
text-shadow: 0 1px #FFF;
- /*margin: 0 -5px;*/
+/*margin: 0 -5px;*/
margin: 0 -2px;
padding: 5px 22px 2px 10px;
line-height: 15px;
View
@@ -53,9 +53,18 @@ module.exports = function(grunt) {
coffee: {
unit: ['test/unit/*/*.coffee']
},
+ less: {
+ app: ['app/less/*.less']
+ },
watch: {
- files: 'test/unit/*/*.coffee',
- tasks: 'coffee:unit'
+ unit: {
+ files: 'test/unit/*/*.coffee',
+ tasks: 'coffee:unit'
+ },
+ css: {
+ files: 'app/less/*.less',
+ tasks: 'less:app'
+ }
}
});
@@ -75,6 +84,23 @@ module.exports = function(grunt) {
});
});
+
+ grunt.registerMultiTask('less', 'Concat and compile less styles', function() {
+ var less = require('less');
+
+ grunt.file.expand(this.data).forEach(function(filepath) {
+ less.render(grunt.file.read(filepath), function(e, css) {
+ if (e) {
+ grunt.log.error(e.message);
+ } else {
+ var cssPath = filepath.replace(/less/g, 'css');
+ grunt.file.write(cssPath, css);
+ grunt.log.writeln('Generated ' + cssPath);
+ }
+ });
+ });
+ });
+
// TODO(vojta): refactor this hardcoded mess
// TODO(vojta): bump version
grunt.registerTask('pack', 'Create zip package of the app.', function() {

0 comments on commit d7aecc5

Please sign in to comment.