Last active
December 22, 2016 16:00
-
-
Save tomhodgins/f862a50fa1b6fe35f16b808e8eb889bd to your computer and use it in GitHub Desktop.
EQCSS + Browserify example
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
<title>EQCSS + Browserify Example</title> | |
<!-- Test EQCSS --> | |
<style> | |
html { | |
background: red; | |
} | |
@element 'html' { | |
$this { | |
background: lime; | |
} | |
} | |
</style> | |
<p>If the background is green, EQCSS is running.</p> | |
<script src=bundle.js></script> |
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
{ | |
"name": "browserify-test", | |
"version": "1.0.0", | |
"description": "Basic use of EQCSS with Webpack", | |
"main": "test.js", | |
"scripts": { | |
"build": "browserify ./test.js -o ./bundle.js", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [], | |
"author": "Tommy Hodgins", | |
"license": "MIT", | |
"dependencies": { | |
"eqcss": "^1.4.0", | |
"browserify": "^13.1.1" | |
} | |
} |
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
// Include EQCSS | |
var eqcss = require('eqcss') | |
// Check access to EQCSS.apply() | |
if (typeof EQCSS.apply()) { | |
console.log('Browserify can access EQCSS.apply()') | |
} | |
// Check access to EQCSS.throttle() | |
if (typeof EQCSS.throttle()) { | |
console.log('Browserify can access EQCSS.throttle()') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment