wjh18 / hugo-liftoff

Minimal blog/portfolio theme with a focus on content creation and SEO best practices. An ideal choice for technical users jump-starting a personal brand.
https://hugo-liftoff.netlify.app
MIT License
93 stars 27 forks source link

Enable SCSS Sourcemap #12

Closed RoneoOrg closed 1 year ago

RoneoOrg commented 2 years ago

Is your feature request related to a problem? Please describe.

Debugging the CSS generated by Hugo could be easier with a sourcemap pointing to the corresponding SCSS file

Here is a short note about implementing such a feature:

Before:

{{ $normalizeSass := resources.Get "normalize.scss" }}
{{ $normalizeStyle := $normalizeSass | resources.ToCSS  | resources.Fingerprint }}

After:

{{ $options := (dict "enableSourceMap" true ) }}

{{ $normalizeSass := resources.Get "normalize.scss" }}
{{ $normalizeStyle := $normalizeSass | resources.ToCSS $options | resources.Fingerprint }}

What do you think?

(Thanks for this lovely theme BTW!)

wjh18 commented 2 years ago

Thanks - I agree this would be good to have. I'll look into getting it added on the next update.

wjh18 commented 2 years ago

Update: I'm not sure if this is even possible if using PostCSS processing. See https://github.com/gohugoio/hugo/issues/6189

I'm trying to find a workaround but in my tests the sourcemap is not being applied.