Reputation: 795
I'm using Svelte and Parcel along with Sass but can't get any scss within the <style>
tags to render correctly. Below is an example of what I'm using.
<style lang="scss">
$base-color: #c6538c;
$border-dark: rgba($base-color, 0.88);
.alert {
border: 1px solid $border-dark;
}
</style>
Upvotes: 1
Views: 443
Reputation: 795
Ok! For those looking for the solution, it's actually very easy, just took me a while to find it!
svelte.config.js
file at the root of your projectsvelte-preprocess
using npm or yarnsvelte.config.js
fileconst sveltePreprocess = require('svelte-preprocess');
module.exports = {
preprocess: sveltePreprocess(),
};
<style lang="scss">
$base-color: #c6538c;
$border-dark: rgba($base-color, 0.88);
.container {
border: 1px solid $border-dark;
}
</style>
Upvotes: 5