Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to specify sass implementation to use. #274

Merged
merged 5 commits into from
Feb 23, 2024
Merged

Conversation

jgerigmeyer
Copy link
Member

CHANGELOG.md Show resolved Hide resolved
@@ -69,7 +69,7 @@ export type Parser = (rule: Rule, ctx: Context) => Parser;
export const runSass = function (
trueOptions: TrueOptions,
src: string,
sassOptions?: Options<'sync'> | StringOptions<'sync'>,
sassOptions?: any,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unfortunate, but unavoidable if we really want to support any Sass implementation.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tried it, but could you do something like Options<'sync'> | StringOptions<'sync'> | any? Not sure if that just removes any benefit anyways, though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these weren't TypeScript types, that would work. But the problem is until runtime we don't know whether sass or sass-embedded (or some other future implementation?) is available, so we don't have a place we can safely import the Options and StringOptions types from.

Copy link
Member Author

@jgerigmeyer jgerigmeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mirisuzanne @jamesnw Okay, I think this is ready for review now.

README.md Outdated Show resolved Hide resolved
Copy link
Member

@mirisuzanne mirisuzanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't test locally, but this makes sense to me.

Copy link

@jamesnw jamesnw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some ideas, nothing blocking.

@@ -69,7 +69,7 @@ export type Parser = (rule: Rule, ctx: Context) => Parser;
export const runSass = function (
trueOptions: TrueOptions,
src: string,
sassOptions?: Options<'sync'> | StringOptions<'sync'>,
sassOptions?: any,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tried it, but could you do something like Options<'sync'> | StringOptions<'sync'> | any? Not sure if that just removes any benefit anyways, though.

README.md Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
@jgerigmeyer jgerigmeyer merged commit 410ff72 into main Feb 23, 2024
3 checks passed
@jgerigmeyer jgerigmeyer deleted the add-sass-option branch February 23, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants