<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>shoogle designs&#039; blog &#187; Tag: kss-node</title>
	<atom:link href="/blog/blog/tag/kss-node/feed/" rel="self" type="application/rss+xml" />
	<link>https://shoogledesigns.com/blog</link>
	<description></description>
	<lastBuildDate>Sun, 24 Aug 2014 17:33:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.6.1</generator>
		<item>
		<title>Automate the generation of your style guides with KSS-node</title>
		<link>https://shoogledesigns.com/blog/blog/2013/07/18/automate-the-generation-of-your-style-guides-with-kss-node/</link>
		<comments>https://shoogledesigns.com/blog/blog/2013/07/18/automate-the-generation-of-your-style-guides-with-kss-node/#comments</comments>
		<pubDate>Thu, 18 Jul 2013 20:55:59 +0000</pubDate>
		<dc:creator>shoogledesigns</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[kss-node]]></category>
		<category><![CDATA[styleguide]]></category>

		<guid isPermaLink="false">https://shoogledesigns.com/blog/?p=1445</guid>
		<description><![CDATA[<p>Style guides are design deliverables providing details such as fonts, colors, white space, and interface elements that communicate the essence of a visual brand for the web, as well as how and when to use them. Boom. Bomb is dropped. You&#8217;ve got to love the concept of style guides (or tiles or whatever you want [&#8230;]</p><p>The post <a href="/blog/blog/2013/07/18/automate-the-generation-of-your-style-guides-with-kss-node/">Automate the generation of your style guides with KSS-node</a> appeared first on <a href="/blog">shoogle designs&#039; blog</a>.</p>]]></description>
				<content:encoded><![CDATA[
<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> 
<p>Style guides are design deliverables providing details such as fonts, colors, white space, and interface elements that communicate the essence of a visual brand for the web, as well as how and when to use them.<br />
<span id="more-1445"></span><br />
Boom. Bomb is dropped. You&#8217;ve got to love the concept of style guides (or tiles or whatever you want to name it), especially as you deal with large scale responsive design missions. What a great idea, whether used while rolling out the project in order to present the visual components of the desired website to your fellow designers, various team members, clients, or even past project end when reviewing components to be dismissed or slightly altered.</p>
<p>Yet, because we are working alone on a project, do not have enough time and want/need to focus on other types of documentation (such as CMS functional doc), we intentionally decide not to go through the style guide process and pass on an excellent opportunity to keep {such a detailed} track of all the nifty features we have included on our websites.</p>
<h3>Automation</h3>
<p>You may know of tools such as <a href="http://stylifyme.com/" title="Stylify Me" target="_blank">Stylify Me</a> that help designers quickly gain access to an automatically generated style guide, but let&#8217;s admit it: although such overviews might be helpful in some cases, especially on the typographic front, nothing will replace a hand made and carefully-planned style guide.</p>
<h3>KSS</h3>
<p>This is where KSS comes in. <a href="http://warpspire.com/kss/styleguides/" title="KSS" target="_blank">KSS</a> is intended to help automate the creation of a living styleguide. It can be used with CSS, SCSS, LESS and more. I&#8217;m going to show you how to use KSS-node, the NodeJS implementation of KSS. For this you&#8217;ll need to have <a href="http://nodejs.org/" title="Node" target="_blank">node</a> and its package manager <a href="https://npmjs.org/" title="Node Package Manager" target="_blank">npm</a> installed on your system.</p>
<h3>Let&#8217;s get started</h3>
<p>You can follow the documention as much as I can but here&#8217;s a quick summary:</p>
<p>Install kss-node globally by running on your terminal:</p>
<pre class="brush: bash; title: ;">
npm install -g kss
</pre>
<p>Once installed, check out the various kss-node commands by running:</p>
<pre class="brush: bash; title: ;">
kss-node
</pre>
<p>You should get the following:</p>
<pre class="brush: bash; title: ;">
Usage:
 kss-node sourcedir [destdir] --init [directory] --{style,less,sass,stylus} [file]

Options:
  -t, --template  Use a custom template to build your styleguide [string]
  -s, --style     Compile and include a stylesheet               [string]
  -l, --less      Compile and include a LESS stylesheet          [string]
  -y, --stylus    Compile and include a Stylus stylesheet        [string]
  -S, --sass      Compile and include a SASS stylesheet          [string]
  -c, --css       Compile and include a CSS stylesheet           [string]
  -m, --mask      Use a custom mask for detecting stylesheets    [string]
  -i, --init      Create a new styleguide template to work from
</pre>
<h3>My way or the highway&#8230; unless</h3>
<p>Having succesfully tested kss-node with an end file made of plain vanilla css, and since I&#8217;m happy with the process I currently have in place, I would be happy to have the feedback of the people who know how to take full advantage of the tool with Sass files. I have seen it working with grunt modules, json files, and you name it which I am far from confident with, therefore I am just gonna show you how I use it personnally. My way.</p>
<p>For your info, I use Sass, Compass and Codekit on a daily basis, therefore my way of generating style guides is defo compatible with the use of a pre-processor like Sass. Just bare in mind you will need an uncompressed css version of the stylesheet whenever generating the style guide.</p>
<h3>Markup</h3>
<p>So this is how it works&#8230; And if you follow my lead (which is the ignorant one, see section above, it will work whether yo use css or scss (reminder for Sassy fans &#8211; output_style = :expanded in your config.rb).</p>
<p>First thing first, let&#8217;s create a markdown file to describe the styleguide. This styleguide.md will need to be added in your css folder. And in the file you will enter something along the lines of:</p>
<pre class="brush: css; title: ;">
#Living Styleguide for my loving customer

a detailed description about the project

and some more words on the web design project
made by @shoogledesigns

https://shoogledesigns.com

</pre>
<p>Then, in your CSS or SCSS file (in my case), include the following commented-out section before any feature you need to include in your styleguide:</p>
<pre class="brush: css; title: ;">
/* Top level description of the feature

A description.

Markup: &lt;some markup with a specific {$modifier} like class or a pseudo class &gt;

.class 		- description of the class state
:pseudo 	- description of the pseudo state

Styleguide X (digit number to increment eg chapter)
*/
</pre>
<h3>Example</h3>
<pre class="brush: css; title: ;">
/* Buttons

Buttons can and should be clicked.

Markup: &lt;button class=&quot;button {$modifiers}&quot;&gt;

:hover - Highlight the button when hovered.
.vip - Displays a very important button 

Styleguide 1
*/

.button {
	background-color: blue;
	text-decoration: none;
	font-size: 20px;
	&amp;:hover {
		background-color: lighten(blue,20%);
	}
	&amp;.vip {
		font-size: 40px;
	}
}
</pre>
<p>I&#8217;m sure that by now, you know what I&#8217;m gonna say next. Repeat this as many times as you need sections to be added in the style guide.<br />
I&#8217;m going to create a second set just for the sake of example.</p>
<pre class="brush: css; title: ;">
/* Colors

Colors should be pretty and seen from far away.

Markup: &lt;div class=&quot;{$modifiers}&quot;&gt;Some text, preferrably anything but Lorem ipsum in there&lt;/div&gt;

.lightblue 	- LightBlue text box.
.red 		- Red text box. 
.orange 	- Orange text box. 
.green 		- Green text box. 

Styleguide 2
*/

.lightblue,.red,.orange,.green {
	padding: 10px;
}
.lightblue {
	background-color: lightblue;
}
.red {
	background-color: red;
}
.orange {
	background-color: orange;
}
.green {
	background-color: green;
}
</pre>
<p>Obviously, this is far from optimal coding, but you catch my drift.<br />
This is what your project should look like in Sublime Text2. A markdown file in your css folder and a bunch of partials to be imported in your global scss file (here style.scss).</p>
<p><img src="/blog/wp-content/uploads/2013/07/kss-node_sass-files.jpg" alt="KSS-node the scss way" title="kss-node_sass-files" width="1590" height="428" class="alignnone size-full wp-image-1443" /></p>
<h3>Generate your living styleguide</h3>
<p>Right, so you&#8217;ve worked your way through the CSS files and annotated every part of your stylesheet with descriptive and detailed KSS markups. In the terminal, go to the root of your project folder, and type the following:</p>
<pre class="brush: bash; title: ;">
kss-node css styleguide --css css/style.css
</pre>
<p>If you&#8217;ve already taken a look at the kss-node commands, this won&#8217;t look like rocket science to you. css is the source directory, styleguide is the end directory, &#8211; -css refers to the file type to be inspected, and css/style.css is its exact location.</p>
<p>You will get a beautiful and carefully sectioned styleguide you&#8217;ll be happy to show to your fellow team mates and customers (for this, open the newly cretaed styleguide folder, and check out index.html).</p>
<p><img src="/blog/wp-content/uploads/2013/07/kss-node_styleguide-basic.jpg" alt="KSS Node Basic Styleguide" title="kss-node_styleguide-basic" width="1590" height="428" class="alignnone size-full wp-image-1469" /></p>
<h3>Customization</h3>
<p>Not happy with the default look and feel of the style guide, and want to add a bit of your own branding before presenting it? Let&#8217;s customize the beast by creating a styleguide template and amend it.</p>
<p>Simply run:</p>
<pre class="brush: bash; title: ;">
kss-node --init
</pre>
<p>This will create a styleguide template you&#8217;ll be able to modify to your liking. Add your own branding to styleguide-template/index.html, and play with the file color, fonts (and more) by altering styleguide-template/public/kss.less.<br />
I personnaly added my name in the left side panel, and changed its original color from lightblue to lightgreen, but I&#8217;m sure you can prove to be more imaginative.</p>
<p>Once happy, re-generate your living styleguide by telling kss-node what template to use:</p>
<pre class="brush: bash; title: ;">
kss-node css styleguide --css css/style.css  --template styleguide-template
</pre>
<p><img src="/blog/wp-content/uploads/2013/07/kss-node_styleguide-overview.jpg" alt="KSS-node styleguide overview" title="kss-node_styleguide-overview" width="1590" height="428" class="alignnone size-full wp-image-1447" /></p>
<p><img src="/blog/wp-content/uploads/2013/07/kss-node_styleguide-colors.jpg" alt="KSS-node generated style guide" title="kss-node_styleguide-colors" width="1590" height="428" class="alignnone size-full wp-image-1446" /></p>
<h3>Verdict</h3>
<p>Really impressed by the easiness of the whole process. It takes nothing but a bit of discipline and some carefully placed css comments to get this styleguide going&#8230; without any additional effort. Have a go and let me know what you think of KSS-node.</p>
<p>The post <a href="/blog/blog/2013/07/18/automate-the-generation-of-your-style-guides-with-kss-node/">Automate the generation of your style guides with KSS-node</a> appeared first on <a href="/blog">shoogle designs&#039; blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>https://shoogledesigns.com/blog/blog/2013/07/18/automate-the-generation-of-your-style-guides-with-kss-node/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: shoogledesigns.com @ 2014-08-29 06:47:50 -->