Dear Colleagues:
I would like to factor out some scss into a file which defines globals (e.g. colors), then to be @use(d) by other scss files. Scss requires that such “partial” file must start with an underscore “_”. However, this is also the sign for Jekyll to ignore said file.
I know I could place some code into _config.yml and then use these site variables in my scss files, but that doesn’t seem right :).
Suggestions?
By default Jekyll does exclude files and folders that begin with an underscore, but you can use the include
configuration in _config.yml force inclusion of directories and/or files in the conversion.
Thank you very much, Michael. However that somewhow did not work for me. After lots of experimenting and reading, I found the below to work (the repo referred to in the Jekyll documentation helped me in this):
Any partial scss file needs to reside in Jekyll’s sass library, which defaults to /_sass
. In this library the scss partial with the leading underscore is processed, and imported into the using scss files via @import "FILENAME";
(here the filename w/o leading underscore).
For additional corroboration of the accepted solution, Minima the default theme with jekyll new
shows this.
Thank you! May this help more of us. A typical case of RTFM :). Best, M.