sassdoc icon indicating copy to clipboard operation
sassdoc copied to clipboard

Document variables

Open idpaterson opened this issue 11 years ago • 6 comments

We're not crazy enough to document every variable in our SASS, but it would be very useful to be able to document what we consider to be the most important variables that other stylesheets can override. We're working on swappable themes, so a few important variables are used heavily.

Not sure on the syntax. I'm generally not a fan of having to provide information that could be derived from the code being documented, but it seems necessary based on the current implementation. I don't think that I would personally use the @default tag since it's very likely to get out of sync with the actual code, so that might not be necessary until the project is able to parse the code associated with each comment to derive that type of info.

// Most colors in the stylesheet are derived from this color.
// @var {Color} $the-color
// @default maroon
$the-color: maroon !default;

// The red value that all colors should use, because that's a useful thing to track...
// @var {Number} $red-value
// @default $the-color
$red-value: red($the-color) !default;

// Specifies whether or not the page can advertise peanut butter.
// @var {Bool} $wants-peanut-butter
// @default true
$wants-peanut-butter: true !default;

// @category ClientATheme

// This client has an allergy.
// @var {Bool} $wants-peanut-butter
$wants-peanut-butter: false;

idpaterson avatar Oct 27 '12 20:10 idpaterson