从Color Map中输出SassDoc中的样本

时间:2015-02-26 11:51:24

标签: sass documentation

我试图通过SassDoc在我的Sass文档中生成色样。

这适用于单一颜色:

/// Orange
/// @type Color
$orange: #e13400;

是否还有一种方法可以在SassDoc中为彩色地图输出色板?

/// Orange tints
/// @type Map
$orange: (
  lightest: #ffe5ca,
  lighter: #f5b180,
  light: #e77636,
  base: #e13400,
  dark: #711f03,
  darker: #581902,
  darkest: #391102,
); 

1 个答案:

答案 0 :(得分:4)

请参阅https://github.com/SassDoc/sassdoc-theme-default/issues/28#issuecomment-76356923

如果在@prop definitions中重复颜色值,则可以。

/// Orange tints
/// @group Colors
/// @type Map
/// @prop {Color} lightest [#ffe5ca]
/// @prop {Color} lighter [#f5b180]
/// @prop {Color} light [#e77636]
/// @prop {Color} default [#e13400]
/// @prop {Color} dark [#711f03]
/// @prop {Color} darker [#581902]
/// @prop {Color} darkest [#391102]
$orange: (
  lightest: #ffe5ca,
  lighter: #f5b180,
  light: #e77636,
  default: #e13400,
  dark: #711f03,
  darker: #581902,
  darkest: #391102,
);