We could add in functionality to detect if a style input is .scss or .sass. Or have a type option for data.
redPerfume.atomize({
tasks: [
{
styles: {
in: [
'./styles/file.scss',
'./styles/style.css',
'./styles/stuff.sass'
],
out: './dist/styles/styles.css'
}
},
{
styles: {
data: '$cow: #F00; .moo { color: $cow; }',
type: 'scss',
out: './dist/styles/custom.css'
}
}
]
});
Implementation:
- Detect the input type by
str.endsWith('.sass') or str.endsWith('.scss').
- Run the file through a Sass processor to create CSS (likely
sass.js or a dart-sass binary since node-sass is no more)
- Atomize the CSS like normal
- If we allow strings of Sass to be passed in via
data, then there needs to be a type or language or syntax or something that defaults to css, but allows sass and scss to be passed in as options.
Questions:
- Should we allow users to pass in
sass.js/dart-sass specific options?
- What would that look like in the API?
- Some options will need to be handled by Red-Perfume anyway, like using
indentedSyntax setting for .sass
We could add in functionality to detect if a style input is
.scssor.sass. Or have atypeoption fordata.Implementation:
str.endsWith('.sass')orstr.endsWith('.scss').sass.jsor a dart-sass binary sincenode-sassis no more)data, then there needs to be atypeorlanguageorsyntaxor something that defaults tocss, but allowssassandscssto be passed in as options.Questions:
sass.js/dart-sassspecific options?indentedSyntaxsetting for.sass