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
// Define SCSS variables with default values | |
$header-color: purple; | |
$font-size: 16px; | |
// Create CSS custom properties with the same names and default values | |
:root { | |
--header-color: #{$header-color}; | |
--font-size: #{$font-size}; | |
} |
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
// v.0.1.0 | |
// This is a somewhat of a naive mod and can be improved. | |
module.exports = (file, api) => { | |
const j = api.jscodeshift; // alias the jscodeshift API | |
let root = j(file.source); // parse JS code into an AST | |
// Can we find an import path | |
const findImport = root.find(j.ImportDeclaration, { | |
specifiers: [ |
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
var temporaryHistory = useRoutes(createHistory)({ | |
routes: createRoutes(routes) | |
}); | |
let unlisten = temporaryHistory.listen(function(error, state) { | |
if (error){ | |
} else { | |
// Have to set the routes here somehow | |
console.log(state); |