SassDoc / sassdoc-theme-default

Default theme for SassDoc.
MIT License
10 stars 30 forks source link

Colour variables references #78

Closed pascalduez closed 9 years ago

pascalduez commented 9 years ago

A colour variable referencing another colour variable is not getting the rendered preview.

/// Links color
/// @type Color
$link-color: $primary-color !default;

It's been already evoked in this comment.

@FWeinb suggestion:

This should in fact be possible. We might need to add some helper methods to SassDoc-extras to generate a variable-value map and than use that to get the color. This implies that the used variable is in fact documented using SassDoc.

KittyGiraudel commented 9 years ago

Yup.

pascalduez commented 9 years ago

I started working on this, will try to open the PR soon. It's a new filter in sassdoc-extras.

We might want to introduce a new key on the data items. Something like item.colorPreview. Otherwise if we replace the value (a variable) with the color, the code preview will display the replaced value and not the original one.

KittyGiraudel commented 9 years ago

Makes sense. Ping @valeriangalliat @FWeinb.

FWeinb commented 9 years ago

Let's be more generic with the name and call it resolvedVariables. That why we can extend it if we ever need the values of other variable types.

valeriangalliat commented 9 years ago

+1 for resolvedVariable! Or maybe resolvedValue?

pascalduez commented 9 years ago

resolvedValue sounds good.

Thanks for the feedback guys!

pascalduez commented 9 years ago

Available as of sassdoc-extras@2.4.0 and sassdoc-theme-default@2.4.0.