initial commit

This commit is contained in:
tmshv committed 2014-02-12 12:36:59 +04:00
commit d3fcd7f10c
3159 files changed
+349702

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
.error, .badError {
border: #f00;
background: #fdd; }
.error.intrusion {
font-size: 1.3em;
font-weight: bold; }
.badError {
border-width: 3px; }
+8
View File
@@ -0,0 +1,8 @@
#data {
float: left;
margin-left: 10px; }
#data th {
text-align: center;
font-weight: bold; }
#data td, #data th {
padding: 2px; }
+9
View File
@@ -0,0 +1,9 @@
table.hl {
margin: 2em 0; }
table.hl td.ln {
text-align: right; }
li {
font-family: serif;
font-weight: bold;
font-size: 1.2em; }
+8
View File
@@ -0,0 +1,8 @@
.content-navigation {
border-color: #3bbfce;
color: #2ca2af; }
.border {
padding: 8px;
margin: 8px;
border-color: #3bbfce; }
+2
View File
@@ -0,0 +1,2 @@
$blue: #3bbfce;
$margin: 16px;
+16
View File
@@ -0,0 +1,16 @@
@import "includes/cats";
.error {
border: #f00;
background: #fdd;
}
.error.intrusion {
font-size: 1.3em;
font-weight: bold;
}
.badError {
@extend .error;
border-width: 3px;
}
+17
View File
@@ -0,0 +1,17 @@
@mixin table-base {
th {
text-align: center;
font-weight: bold;
}
td, th {padding: 2px}
}
@mixin left($dist) {
float: left;
margin-left: $dist;
}
#data {
@include left(10px);
@include table-base;
}
+14
View File
@@ -0,0 +1,14 @@
table.hl {
margin: 2em 0;
td.ln {
text-align: right;
}
}
li {
font: {
family: serif;
weight: bold;
size: 1.2em;
}
}
+14
View File
@@ -0,0 +1,14 @@
$blue: #3bbfce;
$margin: 16px;
.content-navigation {
border-color: $blue;
color:
darken($blue, 9%);
}
.border {
padding: $margin / 2;
margin: $margin / 2;
border-color: $blue;
}
+109
View File
@@ -0,0 +1,109 @@
var assert = require('assert');
var gsass = require('../');
var gutil = require('gulp-util');
var fs = require('fs');
var path = require('path');
var test = require('tape');
function createVinyl(sassFileName, contents) {
var base = path.join(__dirname, 'scss');
var filePath = path.join(base, sassFileName);
return new gutil.File({
cwd: __dirname,
base: base,
path: filePath,
contents: contents || fs.readFileSync(filePath)
});
}
test('pass file when isNull()', function (t) {
var stream = gsass();
var emptyFile = {
isNull: function () { return true; }
};
stream.on('data', function (data) {
t.equal(data, emptyFile);
t.end();
});
stream.write(emptyFile);
});
// test('emit error when file isStream()', function (t) {
// var stream = gsass();
// var streamFile = {
// isNull: function () { return false; },
// isStream: function () { return true; }
// };
// stream.on()
// });
test('compile a single sass file', function (t) {
var sassFile = createVinyl('mixins.scss');
var stream = gsass();
stream.on('data', function (cssFile) {
t.ok(cssFile, 'cssFile should exist');
t.ok(cssFile.path, 'cssFile.path should exist');
t.ok(cssFile.relative, 'cssFile.relative should exist');
t.ok(cssFile.contents, 'cssFile.contents should exist');
t.equal(cssFile.path, path.join(__dirname, 'scss', 'mixins.css'));
t.equal(
fs.readFileSync(path.join(__dirname, 'ref/mixins.css'), 'utf8'),
cssFile.contents.toString(),
'file compiles correctly to css'
);
t.end();
})
stream.write(sassFile);
});
test('compile multiple sass files', function (t) {
var files = [
createVinyl('inheritance.scss'),
createVinyl('mixins.scss'),
createVinyl('nesting.scss'),
createVinyl('variables.scss')
];
t.plan(files.length * 4);
var stream = gsass();
stream.on('data', function (cssFile) {
t.ok(cssFile, 'cssFile exists');
t.ok(cssFile.path, 'cssFile.path exists');
t.ok(cssFile.relative, 'cssFile.relative exists');
t.ok(cssFile.contents, 'cssFile.contents exists');
});
files.forEach(function (file) {
stream.write(file);
});
});
test('emit error on sass errors', function (t) {
var stream = gsass();
var errorFile = createVinyl('somefile.sass',
new Buffer('body { font \'Comic Sans\'; }'));
stream.on('error', function (err) {
t.equal(err.message,
'source string:1: error: property "font" must be followed by a \':\'\n'
);
t.end();
});
stream.write(errorFile);
});
test('call custom error callback when opts.onError is given', function (t) {
var stream = gsass({ onError: function (err) {
t.equal(err,
'source string:1: error: property "font" must be followed by a \':\'\n'
);
t.end();
}});
var errorFile = createVinyl('somefile.sass',
new Buffer('body { font \'Comic Sans\'; }'));
stream.write(errorFile);
});