kalamuna / kstat-kss-builder

Twig KSS Template
MIT License
0 stars 2 forks source link

Can't create color swatch sections #35

Open mikemccaffrey opened 6 years ago

mikemccaffrey commented 6 years ago

Right now, it seems impossible to create several sections of color swatches on a styleguide page, at least without creating a bunch of extra sub sections.

It looks like the color_grid molecule is called only under two conditions:

  1. The section itself is called color-swatches and the colors are included in the section definition (which precludes subsections)
  2. The final part of the section is color-swatches, which means in order to have sections, you'd need to name them something like 'colors.primary.color-swatches'.

If you follow the second method the styleguide looks like:

image

Ideally, the color swatches would be able to be displayed under the 'primary' subsection, rather than having to tack on an additional 'color-swatches' sub-sub-section.

One possible solution would be to have the color grid called if any part of the section definition contains color-swatches. Then you can have the main section defined as 'color-swatches', and add addition sections by defining them as 'color-swatches.primary'.

It would end up looking like this:

image

thiagodemellobueno commented 6 years ago

@mikemccaffrey should be pretty easy to implement your second recommendation.

ryuran commented 6 years ago

Yes, KSS allows currently only one colors collection by KSS section. But you could use subsection for each colors collections. On Colette for example: http://developers.20minutes.fr/colette/section-design.html#kssref-design-colors