Last active
December 22, 2016 16:00
-
-
Save tomhodgins/8618d70850ea0e2d6dbc47581aa939b4 to your computer and use it in GitHub Desktop.
EQCSS + Webpack 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 + Webpack 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": "webpack-test", | |
"version": "1.0.0", | |
"description": "Basic use of EQCSS with Webpack", | |
"main": "test.js", | |
"scripts": { | |
"build": "webpack ./test.js ./bundle.js", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [], | |
"author": "Tommy Hodgins", | |
"license": "MIT", | |
"dependencies": { | |
"eqcss": "^1.4.0", | |
"webpack": "^1.14.0" | |
} | |
} |
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('Webpack can access EQCSS.apply()') | |
} | |
// Check access to EQCSS.throttle() | |
if (typeof EQCSS.throttle()) { | |
console.log('Webpack can access EQCSS.throttle()') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment