You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. Usually I build Sass using the CLI in watch mode, which has the nice characteristic that it compiles Sass, even when it's broken, and uses toCssString (internal Dart method) to serialize the Sass Exception as CSS using ::before so it's viewable in the browser.
I am triyng to compile Sass using the JavaScript API and I'm not seeing any way to get the error/exception formatted in this way, either through the Sass compile options or the SassException. I don't see anything here https://sass-lang.com/documentation/js-api/classes/exception/.
I think it's reasonable to expose a sass.Exception.toCssString() in the JS API. Since this is an API design feature, it should go in the Sass language repository.
nex3
changed the title
How to get the serialized CSS ::before error when using the JS API?
Expose Exception.toCssString() in the JS API
Dec 5, 2023
Hi. Usually I build Sass using the CLI in watch mode, which has the nice characteristic that it compiles Sass, even when it's broken, and uses toCssString (internal Dart method) to serialize the Sass Exception as CSS using ::before so it's viewable in the browser.
I am triyng to compile Sass using the JavaScript API and I'm not seeing any way to get the error/exception formatted in this way, either through the Sass compile options or the SassException. I don't see anything here https://sass-lang.com/documentation/js-api/classes/exception/.
Is there a way developers whom use the JavaScript API can still compile Sass -- with errors -- and get the CSS string generated by this function? https://github.com/sass/dart-sass/blob/cd3b0cc1626f31a909d21fc87112d614cbb013e2/lib/src/exception.dart#L101
The text was updated successfully, but these errors were encountered: