diff --git a/src/build.js b/src/build.js index f3bca1bc..addab24e 100644 --- a/src/build.js +++ b/src/build.js @@ -117,6 +117,7 @@ fs.writeFile("../404.html", htmlOutput, function(err) { var sass = "// Brand colours from simpleicons.org\n"; var less = "// Brand colours from simpleicons.org\n"; +var css = "/* Brand colours from simpleicons.org */\n\n:root {"; var maxNameLength = 0; for (var i = 0; i < source.icons.length; i++) { @@ -153,8 +154,11 @@ for (var i = 0; i < source.icons.length; i++) { sass += "\n$color-brand-" + fileName.toLowerCase() + ": " + spacing + "#" + source.icons[i].hex.toUpperCase() + ";"; less += "\n@color-brand-" + fileName.toLowerCase() + ": " + spacing + "#" + source.icons[i].hex.toUpperCase() + ";"; + css += "\n --color-brand-" + fileName.toLowerCase() + ": " + spacing + "#" + source.icons[i].hex.toUpperCase() + ";"; } +css += "\n}"; + // Generate Sass file with colour variables fs.writeFile("../colour-variables.scss", sass, function(err) { if(err) { @@ -170,3 +174,11 @@ fs.writeFile("../colour-variables.less", less, function(err) { } console.log(" - brand-colours.less built successfully."); }); + +// Generate CSS file with colour variables +fs.writeFile("../colour-variables.css", css, function(err) { + if(err) { + return console.log(err); + } + console.log(" - brand-colours.css build successfully."); +});