News for hackers. Stuff that matters.
Re:A Maintainable Style Guide by kneath on Wednesday May 21, 2014 @08:09PM (#7781472)
(Maintainer of KSS here)

A point of clarification, the inclusion of HTML in KSS blocks is actually a pattern I actively recommend against. It's something I've chosen not to include in KSS core a number of times for exactly this reason (even when my own co-workers submit the PR: https://github.com/kneath/kss/pull/97)

If you're using KSS, I highly recommend tying it as close to your actual markup generation as possible. For me, that means rendering partials directly from rails with dummy objects. That way if the partial changes, the styleguide changes.

Re:A Maintainable Style Guide by diegoloop on Wednesday May 21, 2014 @06:10PM (#7781061)
I came up with this idea: http://codingstyleguide.com

Wouldn't it be nice to have a repository of many Style Guides, where the users can vote on each to decide which one is better - some kind of mixture of Quora, StackExchange, HN... I've been using it since launched and it's definitely helping me out, especially in my side projects with different programming languages. This is just an alternative instead of using a Style Guide generator.

Re:A Maintainable Style Guide by binofbread on Wednesday May 21, 2014 @06:38PM (#7781168)
Just FYI, the image at the top doesn't look that great on my retina display!
Re:A Maintainable Style Guide by diegoloop on Thursday May 22, 2014 @03:07AM (#7782517)
Thank you for the info @binofbread, I didn't know that. Could you please send me a screenshot to [email protected]? That would be great! Thank you!
Re:A Maintainable Style Guide by ianfeather on Wednesday May 21, 2014 @06:52PM (#7781223)
Should be better now. thanks :)
Re:A Maintainable Style Guide by Cub3 on Wednesday May 21, 2014 @07:03PM (#7781262)
Very interesting, i've been playing with KSS and boy the learning curve is pretty high on implementation.

The best way i've found to generate a styleguide (so far) is during the build process, there is a grunt plugin called grunt-kss (has SASS support) that i'm using to generate and deploy the "living style guide" to an internal server when ever a build is generated for production.

Really helps with the design dept. so they know what basic components on [x] website look like and can check them against designs.

Re:A Maintainable Style Guide by ollysb on Thursday May 22, 2014 @01:50AM (#7782318)
Something I've been wondering about is whether it would be possible to generate a page illustrating all the rules in an scss document(or less). Because scss documents use nesting it should be possible to construct the necessary divs (or other elements if specified in the CSS rules) to illustrate any style components. Is there anything stopping us from building a grunt task or whatever to generate the styleguide?
Re:A Maintainable Style Guide by double051 on Wednesday May 21, 2014 @04:49PM (#7780687)
For simple images with text and flat colors, maybe use PNGs instead of JPEGs. The inline images have some painful artifacting going on.
Re:A Maintainable Style Guide by darylfritz on Wednesday May 21, 2014 @11:03PM (#7781907)
Ian, I'm trying to save your content to Instapaper so I can refer to the article offline on my mobile device, but your canonical URL meta tag is incorrect.

    <link rel="canonical" href="http://Ianfeather.github.com/ianfeatherV3/a-maintainable-style-guide/">
Re:A Maintainable Style Guide by evolve2k on Wednesday May 21, 2014 @06:41PM (#7781173)
Curious if people think this sort of components driven development approach scales down to very small teams (2-5 ppl) or is this approach just for the big guys?
Re:A Maintainable Style Guide by timme on Wednesday May 21, 2014 @06:49PM (#7781210)
The upsides remain the same, but in small teams there is less pressure to go for a component architecture, so you have to come up with the discipline to go through the extra effort initially.
Re:A Maintainable Style Guide by theOnliest on Wednesday May 21, 2014 @06:22PM (#7781112)
FYI, the Github link to KSS in the article is broken (href just reads "KSS").
Re:A Maintainable Style Guide by skybrian on Wednesday May 21, 2014 @07:04PM (#7781267)
The ui_component() call looks a bit like creating a React component, if you squint.
Re:A Maintainable Style Guide by wereHamster on Wednesday May 21, 2014 @11:40PM (#7781983)
Yep. And if you make special test pages which render individual components and integrate those with huxley, you have tests for visual regressions basically for free.

https://caurea.org/2014/02/23/testing-react-components-with-...

Re:A Maintainable Style Guide by vjeux on Wednesday May 21, 2014 @11:41PM (#7781985)
We have a component explorer of React components which can be seen as an implementation of their "Style Guide"
Re:A Maintainable Style Guide by EGreg on Thursday May 22, 2014 @01:20AM (#7782242)
Wait, how is this different from just having reusable components?
Re:A Maintainable Style Guide by markba on Wednesday May 21, 2014 @08:33PM (#7781534)
Nice one Ian. Hope you're well :) - Mark