pykss icon indicating copy to clipboard operation
pykss copied to clipboard

Add support for naming sections

Open benknight opened this issue 11 years ago • 8 comments

It'd be sweet to be able to do the following:

/**
 * Styleguide 4.1 Buttons
 */

And when this gets parsed, "4.1" is still at Section.section, while "Buttons" is at Section.name

benknight avatar Jun 11 '13 05:06 benknight

This isn't in the KSS syntax documentation, but neither is the code examples feature.

benknight avatar Jun 11 '13 05:06 benknight

This seems like a reasonable addition.

seanbrant avatar Jun 11 '13 12:06 seanbrant

Looks like https://github.com/kneath/kss/pull/56 as merged, maybe it's just not documented yet.

seanbrant avatar Jun 11 '13 14:06 seanbrant

This is implemented via #65, but hasn't been tested yet. Hopefully @bemurphy has time time to add some specs soon.

(I'll add it to the spec thereafter.)

benschwarz avatar Jun 17 '13 05:06 benschwarz

I noticed your reference to kneath/kss#56, @seanbrant - I haven't merged anything into the main KSS repo. I merged that pull request into my own fork of KSS, for use in my own projects.

GitHub should make that a bit more understandable :(

arielkirkwood avatar Jun 17 '13 15:06 arielkirkwood

Just to bump this one, it looks like they've merged kneath/kss#65

I'm a bit unsure how I feel about this feature, but I think I might warm up to it. My preference would have been Styleguide <index> <name>. However I do see how maintaining numerical sections can be a pain in the ass. For example, if you add a pattern to your styleguide that's important, you may not want to simply increment the index, but rather place it "higher up".

On the other hand, trying to name everything appropriately could go to crazy town pretty fast.

Ultimately, I think what might work best would be having top-level sections as "word" keys, with associated children as numerical keys. For example, Buttons 1.0. But now this seems like "Buttons, version 1.0"

I'm interested in hearing others' thoughts.

benknight avatar Jul 14 '13 23:07 benknight

@benknight — Doesn't this change mean that you can do whatever you want? I think that sane patterns will fall out from building some larger stylesheets — I know my current project team were keen to use this feature (and drop the numerical notation)

benschwarz avatar Jul 15 '13 13:07 benschwarz

Update: Yeah I'm pretty warmed up to this idea. I'd +1 maintaining parity with the Ruby implementation here. I'm not dying to have it though so I probably won't submit a pull request for anything here. Thanks for the spirited discussion dudes!

benknight avatar Jan 28 '14 00:01 benknight