I think, CSS syntax and base principles can be very useful, and not only for style. Is there any PARSE engines which can operate with CSS-like rules, like the ones for XML?
For example, we can create something like framework (yes, another one), in which we define pages in xml style (JUST EXAMPLE, maybe very stupid or two complicated):
<page id="index" url="/" controller="staticpage" />
<page id="about" url="/" controller="staticpage" action="about" />
<page id="post" url="/post/(\d+)" type="regex" controller="post" class="">
<param id="1" name="post_id" />
</page>
<page id="post_comment" url="/comment/(\d+)" type="regex" controller="post" action="comment" class="authneeded">
<param id="1" name="post_id" />
</page>
<page id="post_write" url="/write" type="regex" controller="staticpage" action="write" class="authneeded" />
and then write a "CSS" for it:
* {
layout: "layout.html"; // default layout
}
*[action=''] {
action: "index"; // default action
}
#post_write {
layout: "adminlayout.html";
}
.authneeded {
redirect: "/";
}
.authneeded:loggedin { // pseudoclass which is set only if the user logged in.
// (maybe POSTS:loggedin .authneeded to apply only one
// pseudoclass)
redirect: false; // no, we don't need to redirect then the user logged in
}
Isn't it an interesting way to configurate? Even better, we can create an admin script (inspired by jquery ;)
./admin #about addClass authneeded
./admin "#post PARAM" attr id param_post
So, Is there any engines which can operate with CSS-like rules?