TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Knyle Style Sheets

267 点作者 fbuilesv超过 13 年前

11 条评论

jeremymcanally超过 13 年前
I love this; I've needed this on nearly every project I've ever worked on for various reasons. Either someone doesn't remember what a class looks like or doesn't apply it properly or the designer named things ambiguously on accident. You end up with some styles applied properly and others ignorantly thrown around because no one really understands how the CSS is laid out besides the designer.<p>Adding it to a project will put some more work on designers, but it's nothing they probably shouldn't be doing already.
akdetrick超过 13 年前
Duplication is probably the easiest mistake to make with CSS, and using authoring languages like LESS and SASS won't necessarily help. Duplication not only causes bloat, but it can lead to specificity wars and poorly performing selectors. Worse yet, it becomes more difficult to trust the code already in place, and easier to write your own styles to perform tasks that some other code already handles.<p>This is the death spiral of CSS, and it's refreshing to see someone take on this problem directly (aside from teaching a methodology for writing CSS).<p>Automated documentation for CSS is a fantastic idea, and this looks well executed.
评论 #3317108 未加载
FuzzyDunlop超过 13 年前
CSS is almost too flexible to be able to stick to some sort of convention. I find myself trying to code in one style, and then doing it differently or disliking it on a different project.<p>I try to make some of it self-documenting, so will only class out a particular element then, through CSS, enforce a strict order of child elements by using the direct descendant/sibling selectors, etc. I'll usually include the element hierarchy in the definition where necessary. But then I don't like it because there's so much repetition.<p><pre><code> body &#62; header { ... } body &#62; header &#62; h1 { ... } body &#62; header &#62; h1 + small { ... } </code></pre> Or<p><pre><code> div#sidebar &#62; form#login-form input, div#sidebar &#62; form#login-form select { ... } </code></pre> Why is there nothing (without Less/Sass/some other package) like<p><pre><code> div#sidebar &#62; form#login-form ( input, select { ... } label { ... } ) </code></pre> That KSS attempts to better document CSS is great, and I'll certainly look into that more. But in some ways I think the difficulty comes from CSS itself being pretty flat when a DOM tree is anything but. And for the sake of easy re-use and documentation, sometimes you'd rather not just have a huge list of styled classes and IDs to wade through when you really don't need that many.
评论 #3317292 未加载
评论 #3317564 未加载
评论 #3317543 未加载
Meai超过 13 年前
This seems complicated, it would be cool to have something like this for non-ruby guys. If I understand correctly, I need to write a ruby parser myself in order to use this. Much easier would be a binary which just takes all files in a directory by default, and creates an html with a default template. If I want to customize it, let me customize it by comment syntax, not ruby code.
评论 #3316569 未加载
评论 #3316546 未加载
jharding超过 13 年前
Great idea. My one issue with it is that it seems kind of difficult to use. Ideally, using this would consist of passing the files I wanted a style guide generated for to KSS and it would take care of the rest.<p>I'm definitely going to keep my eye on this project over the next few weeks. Something like this is badly needed and I can't wait to see where KSS goes.
评论 #3317073 未加载
评论 #3318815 未加载
superk超过 13 年前
I had a similar idea - a living styleguide derived from the css. I envisioned it in 3 parts:<p>* A way to transform css into html (<a href="https://github.com/aglemann/css2html" rel="nofollow">https://github.com/aglemann/css2html</a>)<p>* A simple webserver that would detect a stylesheet, run it through the transformer and serve up the html styleguide (<a href="https://github.com/aglemann/instant-styleguide" rel="nofollow">https://github.com/aglemann/instant-styleguide</a>)<p>* A methodology for architecting your css for use with the two technologies (coming soon?)<p>All the pieces work, I need to do a blog post about it ;)
dfischer超过 13 年前
Yay, I'm glad it's happening.<p>I've been saying this for a while now (yes, I should be doing more than saying)... CSS needs a modern agreed-upon community standard for implementation.<p>This is really important at the front-end development layer when you're doing CSS inside of an application. There's too much variance in style between projects and frameworks. We need to commit to a general guideline, especially one that incentivizes good standards.<p>This is a step in the right direction.<p>I was supposed to do a presentation on this very topic but then a hurricane got in the way (magma rails).
jostmey超过 13 年前
I'm upvoting this simply because of the author's statement that "few people truly comprehend" CCS and that "CSS is complicated". So true.
agscala超过 13 年前
What makes this any better than SASS or LESS?
评论 #3316232 未加载
评论 #3316691 未加载
thedaniel超过 13 年前
10 points to Griffindor for the Knylefile.
bjornsteffanson超过 13 年前
Who names shit after themselves anymore?