This repository has been archived by the owner on Jul 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from sobolevn/master
Eyeglass support
- Loading branch information
Showing
10 changed files
with
153 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
*.gem | ||
.sass-cache | ||
Gemfile.lock | ||
|
||
# npm files: | ||
node_modules/ | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# This file pretty much copies `.gitignore`, | ||
# but has stricter rules, which are defined in the end. | ||
*.gem | ||
.sass-cache | ||
Gemfile.lock | ||
|
||
# npm files: | ||
node_modules/ | ||
*.log | ||
|
||
# These files are `.npmignore` specific, | ||
# these rules remove unwanted files from `npm` package. | ||
lib/ | ||
tests/ | ||
Rakefile | ||
Gemfile | ||
bower.json | ||
*.yml | ||
*.json | ||
*.gemspec | ||
|
||
# package.json is required: | ||
!package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# Changelog | ||
|
||
## 3.0.6 | ||
* Support for Eyeglass. | ||
|
||
## 3.0.5 | ||
* Support for LibSass 3.2 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var path = require('path'); | ||
|
||
module.exports = function(eyeglass, sass) { | ||
return { | ||
sassDir: path.join(__dirname, 'stylesheets') | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "modernizr-mixin", | ||
"version": "3.0.6", | ||
"description": "A simple way for DRYier, faster and cleaner Modernizr tests in Sass.", | ||
"license": "MIT", | ||
"main": "eyeglass-exports.js", | ||
"eyeglass": { | ||
"exports": "eyeglass-exports.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/danielguillan/modernizr-mixin" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/danielguillan/modernizr-mixin/issues" | ||
}, | ||
"author": "Daniel Guillan", | ||
"files": [ | ||
"stylesheets/_modernizr.scss", | ||
"eyeglass-exports.js" | ||
], | ||
"keywords": [ | ||
"modernizr", | ||
"mixin", | ||
"compass", | ||
"eyeglass-module", | ||
"sass", | ||
"scss" | ||
], | ||
"scripts": { | ||
"test": "mocha tests" | ||
}, | ||
"dependencies": { | ||
"eyeglass": "^0.2.0", | ||
"node-sass": "^3.1.2" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.2.5" | ||
}, | ||
"private": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.my-selector .translate3d.opacity .my-selector { | ||
transform: translate3d(0, 100px, 0); | ||
opacity: 0; | ||
} | ||
|
||
.my-selector .no-js .my-selector, .my-selector .no-translate3d .my-selector, .my-selector .no-opacity .my-selector { | ||
top: 100px; | ||
display: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@import "modernizr-mixin/_modernizr"; | ||
|
||
.my-selector { | ||
@include yep(translate3d, opacity) { | ||
transform: translate3d(0, 100px, 0); | ||
opacity: 0; | ||
} | ||
@include nope(translate3d, opacity) { | ||
top: 100px; | ||
display: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"use strict"; | ||
|
||
var Eyeglass = require("eyeglass"); | ||
var sass = require("node-sass"); | ||
var path = require("path"); | ||
var assert = require("assert"); | ||
var fs = require("fs"); // reads static files | ||
|
||
var Tester = function() { | ||
this.compile = function(options, cb) { | ||
// Eyeglass creates a wrapper around basic options, | ||
// use ['options'] hack to make it work: | ||
sass.render(new Eyeglass(options)['options'], cb); | ||
}; | ||
|
||
this.assertCompiles = function(options, expectedOutput, done) { | ||
this.compile(options, function(err, result) { | ||
assert(!err, err && err.message); // done without errors. | ||
assert.equal(expectedOutput, result.css.toString()); | ||
done(); | ||
}); | ||
}; | ||
}; | ||
|
||
describe("Eyeglass module testing", function() { | ||
|
||
var rawScss; | ||
var controlCss; | ||
before(function() { | ||
var dir = path.join(__dirname, "eyeglass"); | ||
rawScss = fs.readFileSync(path.join(dir, "test.scss"), 'utf8'); | ||
controlCss = fs.readFileSync(path.join(dir, "control.css"), 'utf8'); | ||
}); | ||
|
||
it("should compile a sass file", function(done) { | ||
var tester = new Tester(); | ||
// `outputStyle` could be: nested, expanded, compact, compressed | ||
// controlCss has "expanded" style. | ||
var options = { data: rawScss, outputStyle: "expanded" }; | ||
tester.assertCompiles(options, controlCss, done); | ||
}); | ||
}); |