I'm not sure how this would work with the current web2py framework (which 
uses static css), but a css pre-processing system like LESS makes the 
application of framework classes to your custom html trivial. Twitter 
Bootstrap (like many of the other css frameworks out there) provides its 
styles in a .less file. So any of its classes can be "mixed in" in my own 
.less stylesheet. If my sidebar area has the .sidebar-left class, and the 
Bootstrap style I want to apply is .sidebar then I just write this:

.sidebar-left {
    .sidebar();
}

That's it! Now my class has all of the styles in the Bootstrap class, and I 
haven't had to change anything in my html. I can also override the 
Bootstrap class if necessary right in the same LESS file. This seems to me 
like the best way of using frameworks without committing ourselves to 
re-writing our html classes every time we want to switch frameworks. It 
also means that web2py users can use other frameworks without having to 
deal with Bootstrap classes in the template html.

I realize that for many a css preprocessor seems like a huge headache, but 
I have found LESS to be a huge time-saver and to allow great flexibility 
with cases like this. It also allows all of my stylesheets to be 
concatenated together automatically, so that I can work with modular styles 
in .less files
without worrying about the overhead later on of importing mulltiple 
stylesheets. For all these reasons, I think there's an argument to be made 
for integrating a LESS preprocessor into web2py and using LESS for the 
out-of-the-box template styles. These could come both in .less form (for 
those who want to use LESS themselves) and in pre-compiled css form (for 
those who want traditional css). We could also easily add LESS processing 
to the "compile" function built into web2py, so that once an app was 
compiled for production use there would be no overhead from dynamic 
compiling. Something to think about, perhaps.

Ian
 
On Wednesday, October 3, 2012 6:20:44 PM UTC-4, Richard wrote:
>
> Hello,
>
> I am not exactly sure how this is relevant about how web2py approach to 
> bootstrap, but it seems to be a logical evolution of the decoupling content 
> and container with HTML/CSS/PHP,Python, etc., as exposed in the post.
>
>
> http://ruby.bvision.com/blog/please-stop-embedding-bootstrap-classes-in-your-html
>
> Happy reading.
>
> Richard
>

-- 



Reply via email to