({
take: [
{ key: "code", type: "code", label: "SASS/SCSS" },
{
key: "style",
type: "dropdown",
label: "Output Style",
value: 1,
options: ["Nested", "Expanded", "Compact", "Compressed"],
},
{
key: "syntax",
type: "dropdown",
label: "Syntax",
options: ["SASS", "SCSS"],
},
{
type: "import",
value:
"https://cdn.jsdelivr.net/npm/sass.js@0.11.1/dist/sass.sync.min.js",
},
],
make: ({ code, syntax, style }) =>
new Promise((res) => {
const options = {
indentedSyntax: syntax === "SASS",
style: Sass.style[style.toLowerCase()],
}
Sass.compile(code, options, (value) =>
res([
{ label: "CSS", type: "code", value: value.text || value.formatted },
])
)
}),
})