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
While sass.render allows us to access the compile context with this.options. Especially this.options.file is useful for modifying the value of url() to be relative from the output css file. However, sass.compile invokes custom functions with null context, and I cannot tell the context being processed. This prevents me to migrate from the legacy render APIs. Related issue: #1233.
The text was updated successfully, but these errors were encountered:
This is intentional. Providing unconditional access to the base file's URL makes it easy for an importer to violate canonicity requirements, so it's specifically only provided in canonicalizeContext and only for importers that meet certain restrictions. If you're looking to do URL rewriting, I recommend following along with sass/sass#2535.
Yes, I'm looking for a way to rewrite URL, so I read through sass/sass#2535. The proposal sass.url.relativeToCss seems fit to my use case. I'll wait for the feature to be implemented (watching sass/sass#2927). Thanks.
While
sass.render
allows us to access the compile context withthis.options
. Especiallythis.options.file
is useful for modifying the value ofurl()
to be relative from the output css file. However,sass.compile
invokes custom functions with null context, and I cannot tell the context being processed. This prevents me to migrate from the legacy render APIs. Related issue: #1233.The text was updated successfully, but these errors were encountered: