kneath / kss

A methodology for documenting CSS and generating styleguides.
warpspire.com/kss
MIT License
4.04k stars 275 forks source link

Please add the ability to import .HTML files #74

Closed dotherightthing closed 11 years ago

dotherightthing commented 11 years ago

Hi,

Thanks for your work with KSS, I'm a big fan of the system.

I'd like the ability to import one or more .HTML files into the stylesheet. This would allow us to maintain our HTML snippets separately, keep them DRY (cutting down on possible errors where a snippet is updated but the CSS is not) and allow them to be used (or generated) by a templating system..

So instead of this:

/*
Manually authoring HTML snippets

Markup:
<p class="foo">Lorem ipsum</p>

Styleguide xxx.x
*/

I would like something like this:

/*
Importing HTML snippets

@markup "../html/foo.html"

Styleguide xxx.x
*/

Thanks, Dan

benschwarz commented 11 years ago

Perhaps a better implementation could be the addition of a 'metadata' directive that could be pulled through...  ​ You could then implement whatever you liked. 

Any thoughts @kneath?

dotherightthing commented 11 years ago

FWIW I'm getting into Grunt ATM and have this running as a step between the Sass compiling and the KSS Styleguide rebuild.

benschwarz commented 11 years ago

Are you able to share your grunt file @dotherightthing ?

dotherightthing commented 11 years ago

Gruntfile is here: https://www.dropbox.com/s/32m61qfuzcowy27/Gruntfile.js

It's definitely a work in progress! ;-)

Cheers.