kneath/kss

Please add the ability to import .HTML files

Closed this issue · 4 comments

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

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?

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

Are you able to share your grunt file @dotherightthing ?

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

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

Cheers.