normalize-scss with hugo
All notes in this series:
- Automating hugo development with npm scripts
- normalize-scss with hugo
- Automatic image thumbnails in Hugo from static directory
- Escaping Hugo shortcodes within Hugo markdown
- Hugo tag and category pages
- Bind hugo to localhost for development
- Hugo 0.37 does not support h6 markdown heading
- Install Hugo testing distribution on Debian
- Hugo anchors next to headers
- Hugo: Migrating from Pygments to Chroma
- Hugo: Global resources
- Hugo: How to create a post series
Before beginning to develop the CSS for this website, I wanted to ensure I had a consistent base style across all browsers. Originally I was going to use reset.css but upon further research decided to use normalize.css because it normalizes everything to sensible defaults rather than zeroing everything out, among other benefits.
When trying to hook up normalize.css into this hugo powered website I ran into trouble because I am using SASS. To resolve this, I switched to using normalize-scss instead to make it easier to include.
By using the --include-path
option in my SASS build script to include the directory node_modules/normalize-scss/sass/
(as described in Approach 2 of the normalize-scss README), I can then use @import "normalize/import-now";
in my SCSS to include the normalized styles.
For reference my package.json
(with the irrelevant parts removed) is as follows:
And my assets/scss/main.scss
is (work-in-progress!):