Documenting Sass variables, mixins and functions
See original GitHub issueI want to try and document our Sass variables/mixins/functions and wondered if anyone had any suggestions of how to do this? I’ve tried:
- Documenting them as components, but a component requires a
.hbs
file. I could create an empty file but then the documentation has a blank component in the preview. Perhaps myconfig.json
file could have a value ofpreview: false
which I could use in the theme to remove the preview - but nobody likes empty files sitting around. - Documenting them in the Docs section using
.md
files. The problem with this is Fractal only allows 1 path to be set for the docs location which means either splitting the documentation from the Sass or creating a task to bundle all documentation into one folder before running Fractal.
I thought about using SassDoc and getting Fractal to <iframe> in the SassDoc export but that seems a little messy.
So, I’m curious to know if anyone has done something similar or could suggest how best to document Sass?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
mixin and @include - Sass
Mixins allow you to define styles that can be re-used throughout your stylesheet. They make it easy to avoid using non-semantic classes like...
Read more >Documentation - Sass
Sass is a stylesheet language that's compiled to CSS. It allows you to use variables, nested rules, mixins, functions, and more, all with...
Read more >Sass: @function
Functions allow you to define complex operations on SassScript values that you can re-use throughout your stylesheet. They make it easy to abstract...
Read more >Sass: @use
The @use rule loads mixins, functions, and variables from other Sass stylesheets, and combines CSS from multiple stylesheets together.
Read more >Sass Basics
Sass has features that don't exist in CSS yet like nesting, mixins, inheritance, ... Think of variables as a way to store information...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi! I’ve managed to gather the variables in a specific scss file using a Handlebars helper which uses sass-extract, sass-extract-loader and sass-extract-js to gather and return the variables.
Helper:
_index.hbs (my documentation file located in components/docs):
I hope it can help you. 😃
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.