Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow resolveVariable option to reference private variables #35

Open
adrien-gueret opened this issue Jan 8, 2018 · 0 comments
Open

Comments

@adrien-gueret
Copy link

adrien-gueret commented Jan 8, 2018

Hi everyone,

Here is my use case: I have some base colors and "semantic" colors. Base colors are all the colors my application will use:

/// @type Color
/// @access private
$color_blue_ocean: #2882c5;

/// @type Color
/// @access private
$color_red_blood: #992600;

/// @type Color
/// @access private
$color_green_forest: #005500;

// ...

Semantic colors are colors with some meanings. They are basically aliases to base colors:

/// @type Color
/// @access public
$article_links: $color_blue_ocean;

/// @type Color
/// @access public
$main_background: $color_blue_ocean;

/// @type Color
/// @access public
$success_background: $color_green_forest;

/// @type Color
/// @access public
$footer_links: $color_green_forest;

/// @type Color
/// @access public
$error_background: $color_red_blood;

/// @type Color
/// @access public
$horizontal_lines: $color_red_blood;

// ...

For each semantic colors, the option resolveVariables allows me to display a colored square with the corresponding color. It works well, but only if the resolved variable is public, probably because I configure sassdoc to hide private content.

If I set access of base colors to public, the square will be shown as expected... but the base colors will be also in the documentation. Since we want to use only semantic ones, it makes no sense to display base colors.

Is it possible to resolve a private variable with resolveVariables option?

Maybe we can take the problem upside down and think about a new annotation overloading the @access one, like this:

/// @type Color
/// @access public // Public so that 'resolveVariables' can work
/// @hidden // Hidden in documentation despite it's public
$article_links: $color_blue_ocean;

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant