Skip to content

Commit

Permalink
feat: support dart sass
Browse files Browse the repository at this point in the history
  • Loading branch information
hevele-moda committed Jan 4, 2023
1 parent 1695691 commit 03174d7
Show file tree
Hide file tree
Showing 4 changed files with 3,350 additions and 8 deletions.
25 changes: 25 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 2
defaults: &defaults
docker:
- image: 'cimg/node:18.12.1'
jobs:
release:
<<: *defaults
steps:
- checkout
- run:
name: install
command: yarn install
- run:
name: release
command: yarn semantic-release || true
workflows:
version: 2
master:
jobs:
- release:
context: devops-dev
filters:
branches:
only:
- master
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@
let output;
switch (value.constructor.name) {
case 'SassList':
case 'sass.types.List':
output = [];
for (let i = 0; i < value.getLength(); i++) {
output.push(get_value(value.getValue(i), options));
}
break;
case 'SassMap':
case 'sass.types.Map':
output = {};
for (let i = 0; i < value.getLength(); i++) {
output[value.getKey(i).getValue()] = get_value(value.getValue(i), options);
}
break;
case 'SassColor':
case 'sass.types.Color':
if (1 === value.getA()) {
if (options.hex_color) {
output = '#' + toHex(value.getR()) + toHex(value.getG()) + toHex(value.getB());
Expand All @@ -42,6 +45,7 @@
}
break;
case 'SassNumber':
case 'sass.types.Number':
output = value.getValue();
if (value.getUnit()) {
output += value.getUnit();
Expand Down
21 changes: 13 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "node-sass-export",
"name": "@moda/node-sass-export",
"version": "0.0.7",
"description": "lightweight extension that allows you to export an encoded Sass variables (map, list, etc) into an external JSON file",
"main": "index.js",
Expand All @@ -11,19 +11,24 @@
"json",
"export"
],
"author": "punkundead",
"license": "BSD-2-Clause",
"author": "ModaOperandi",
"license": "MIT",
"dependencies": {},
"devDependencies": {},
"devDependencies": {
"semantic-release": "^19.0.5"
},
"engines": {
"node": ">= 12.0.0"
"node": ">= 18.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Punk-UnDeaD/node-sass-export.git"
"url": "git+https://github.com/ModaOperandi/node-sass-export.git"
},
"bugs": {
"url": "https://github.com/Punk-UnDeaD/node-sass-export/issues"
"url": "https://github.com/ModaOperandi/node-sass-export/issues"
},
"homepage": "https://github.com/Punk-UnDeaD/node-sass-export#readme"
"homepage": "https://github.com/ModaOperandi/node-sass-export#readme",
"publishConfig": {
"access": "public"
}
}
Loading

0 comments on commit 03174d7

Please sign in to comment.