google-code-export / camlistore

Automatically exported from code.google.com/p/camlistore
Apache License 2.0
0 stars 0 forks source link

Precompile CSS (using less) #517

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently css is being compiled on the browser client every page hit. We should 
be precompiling as part of the build process.

- - - - - - - - -
mario: I've noticed in the JS console that less seems to be compiling the css 
on the client every hit (ranging from 250 - 450 ms). Doing a quick read online 
seems to indicate the current configuration we're using is only intended for 
development and suggests pre-compilation for production use.

I was thinking about opening a bug for that, unless you already have it on your 
radar.

aaron: Yes, I've spoken with Lindsey about this. We definitely want to 
implement precompilation. This is something I think we'd have to do in Go as 
part of the build process, right?

lindsey: Yeah, precompilation would need to happen in the build and then 
template would need to know whether to load raw or built.

Original issue reported on code.google.com by mail...@gmail.com on 23 Sep 2014 at 9:00

GoogleCodeExporter commented 9 years ago
for reference, here is a screenshot taken from JS console:

Original comment by mail...@gmail.com on 23 Sep 2014 at 9:02

Attachments:

GoogleCodeExporter commented 9 years ago
Why does CSS even need to be compiled, one (I) might ask?

Original comment by bradfitz on 23 Sep 2014 at 9:47

GoogleCodeExporter commented 9 years ago
This is the first time I've used less, but at a glance it seems you're trading 
a little added complexity in the build process for cleaner, more readable / 
easily maintainable css source.

We're using a prefix free css plugin for less, which means you don't need to 
provide vendor-specific prefixed properties. You develop to the standard CSS 
properties and the compilation process adds all the browser compatibility junk.

You can also approach css development more programmatically - with constants, 
functions, etc. You can define styles hierarchically rather than just 
cascading. You can define common properties as constants in one place 
(background / font color, etc). The compiler takes all this and outputs the 
standard css.

All in all, it seems to provide for smaller more readable/maintainable (at 
least for programmers?) css.

Original comment by mail...@gmail.com on 24 Sep 2014 at 11:25

GoogleCodeExporter commented 9 years ago
This issue has moved to https://camlistore.org/issue/517

Original comment by bradfitz on 14 Dec 2014 at 11:37