mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-13 21:33:32 -06:00
Initial commit
This commit is contained in:
100
node_modules/css-tokenize/test/base.js
generated
vendored
Normal file
100
node_modules/css-tokenize/test/base.js
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
var fs = require('fs'),
|
||||
test = require('tape'),
|
||||
through = require('through2'),
|
||||
tokenize = require('../')
|
||||
|
||||
|
||||
test('basic', function(t) {
|
||||
var tok = tokenize();
|
||||
|
||||
var input = "html { font-size: 10px; }"
|
||||
var expected = [
|
||||
['rule_start', 'html {'],
|
||||
['rule', ' font-size: 10px; '],
|
||||
['rule_end', '}']
|
||||
]
|
||||
|
||||
t.plan(expected.length);
|
||||
tok.pipe(through.obj(function(token, enc, next) {
|
||||
token[1] = token[1].toString();
|
||||
if (expected.length > 0) t.same(token, expected.shift())
|
||||
next();
|
||||
}))
|
||||
|
||||
tok.end(input);
|
||||
})
|
||||
|
||||
test('at-rule nesting', function(t) {
|
||||
var tok = tokenize();
|
||||
var expected = [
|
||||
[ 'atrule_start', '@media screen and (min-width: 1000px) {' ],
|
||||
[ 'atrule', '\n ' ],
|
||||
[ 'rule_start', 'a {' ],
|
||||
[ 'rule', '\n text-decoration: underline;\n ' ],
|
||||
[ 'rule_end', '}' ],
|
||||
[ 'atrule', '\n' ],
|
||||
[ 'atrule_end', '}' ],
|
||||
[ 'root', '\n' ]
|
||||
]
|
||||
|
||||
t.plan(expected.length);
|
||||
tok.pipe(through.obj(function(token, enc, next) {
|
||||
token[1] = token[1].toString();
|
||||
if (expected.length > 0) t.same(token, expected.shift())
|
||||
next();
|
||||
}))
|
||||
|
||||
fs.createReadStream(__dirname + '/nested.css').pipe(tok);
|
||||
})
|
||||
|
||||
test('gauntlet', function(t) {
|
||||
var tok = tokenize();
|
||||
|
||||
var expected = [
|
||||
['root', '\n'],
|
||||
['rule_start', 'div {'],
|
||||
['rule', '\n background: red;\n'],
|
||||
['rule_end', '}'],
|
||||
['root', '\n\n'],
|
||||
['rule_start', '.cls {'],
|
||||
['rule', '\n color: green;\n'],
|
||||
['rule_end', '}'],
|
||||
['root', '\n\n'],
|
||||
['rule_start', '#id {'],
|
||||
['rule', '\n font-size: 10px;\n'],
|
||||
['rule_end', '}'],
|
||||
['comment', '\n\n/* comment */'],
|
||||
['space', '\n\n'],
|
||||
['atrule_start', '@media screen and (min-width: 1000px) {'],
|
||||
['atrule', '\n '],
|
||||
['rule_start', 'a {'],
|
||||
['rule', '\n text-decoration: underline;\n '],
|
||||
['rule_end', '}'],
|
||||
['atrule', '\n'],
|
||||
['atrule_end', '}'],
|
||||
['root', '\n\n'],
|
||||
['rule_start', 'a:hover {'],
|
||||
['rule', '\n font-weight: bold; \n'],
|
||||
['rule_end', '}'],
|
||||
['root', '\n\n'],
|
||||
['rule_start', 'section \n\n\n{'],
|
||||
['rule', '\n margin: 0;\n '],
|
||||
['comment', '/* comment wthin a rule */'],
|
||||
['rule', '\n padding: 5px;\n'],
|
||||
['rule_end', '}'],
|
||||
['root', '\n\n\n'],
|
||||
['rule_start', 'body > * {'],
|
||||
['rule', '\n \n'],
|
||||
['rule_end', '}'],
|
||||
['root', '\n']
|
||||
]
|
||||
|
||||
t.plan(expected.length);
|
||||
tok.pipe(through.obj(function(token, enc, next) {
|
||||
token[1] = token[1].toString();
|
||||
if (expected.length > 0) t.same(token, expected.shift())
|
||||
next();
|
||||
}));
|
||||
|
||||
fs.createReadStream(__dirname + '/gauntlet.css').pipe(tok);
|
||||
})
|
7
node_modules/css-tokenize/test/brackets.css
generated
vendored
Normal file
7
node_modules/css-tokenize/test/brackets.css
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
.hello {
|
||||
background: url(http://blahlbahlbah.com);
|
||||
}
|
||||
|
||||
|
||||
.explore-mail-tease{padding-top:20px;overflow:hidden;background:#202021 url(/assets/modules/home/octicons-bg-f51579234572c7286b1ead7a6408f2d43c7a0520dbb09f9d2b8b6b59024a01a0.png) center repeat;border-bottom:1px solid #ddd}.explore-mail-tease h3{color:#fff;text-align:center}.explore-mail-tease img{margin-bottom:-5px}
|
38
node_modules/css-tokenize/test/gauntlet.css
generated
vendored
Normal file
38
node_modules/css-tokenize/test/gauntlet.css
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
div {
|
||||
background: red;
|
||||
}
|
||||
|
||||
.cls {
|
||||
color: green;
|
||||
}
|
||||
|
||||
#id {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
/* comment */
|
||||
|
||||
@media screen and (min-width: 1000px) {
|
||||
a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
a:hover {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
section
|
||||
|
||||
|
||||
{
|
||||
margin: 0;
|
||||
/* comment wthin a rule */
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
|
||||
body > * {
|
||||
|
||||
}
|
5
node_modules/css-tokenize/test/nested.css
generated
vendored
Normal file
5
node_modules/css-tokenize/test/nested.css
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
@media screen and (min-width: 1000px) {
|
||||
a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user