UNPKG
color-cleaner
Version:
latest (1.0.0)
1.0.0
A CLI tool to clean and consolidate colors in your project files.
color-cleaner
/
lib
/
createPallet.js
10 lines
(8 loc)
•
324 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
import
{ writeFileSync }
from
'fs'
;
const
createPallet
= (
colorMap, outputPath =
'colors.scss'
) => {
const
scssContent =
Object
.
entries
(colorMap) .
map
(
(
[name, value]
) =>
`$
${name}
:
${value}
;`
) .
join
(
'\n'
);
writeFileSync
(outputPath, scssContent,
'utf-8'
); };
module
.
exports
= createPallet;