I hope they still maintain the ruby gem version of LESS. LESS is beautiful as it is. But processing LESS code in the browser would mean that I can't use LESS.js for mobile web apps. Although there are mobile devices with 1ghz processors already out in the market, there is still a lag in rendering mediocre-weight pages that contain js on mobile devices. P.S: Congrats on keeping LESS simpler.
Less.js will obsolete CSS
121–130 of 131 posts
Re: Less.js will obsolete CSS
#122Running a compiler in the browser in production will never be a good idea. If you care about the speed that your website displays -- and you should -- the slowdown caused by parsing, processing, and concatenating large amounts of CSS will dwarf over-the-wire time. People who seriously care about the usability of their sites have been spending a lot of effort recently figuring out how to get load times as fast as poss…
"Running a compiler in the browser in production will never be a good idea." Well, it's way too late for that. You need to send that statement back to mid-1990s. Or does your processor natively execute Javascript text? That dogmatic declaration is nonsense. Compilers are just code. Certain programming language compilers are very slow due to the immense complexity of their task but there's nothing intrinsically slow a…
Even better: Or does your processor natively execute HTML text?
Re: Less.js will obsolete CSS
#123Earlier quoted context omitted.
Not sure if this is what you're referring to, but you can have a box model that includes padding and border in the width using CSS3: box-sizing: border-box with -ms- (IE8), -moz- and -webkit- prefixes. http://www.quirksmode.org/css/box.html
http://www.w3.org/TR/css3-box/
The CSS3 UI module is a candidate recommendation. Setting:
box-sizing: border-box;
essentially puts the CSS box model render mode to where it was in IE5 (which is, frankly, the only sensible way to do it). Right now, it is available with Mozilla, Webkit and Microsoft prefixes (as are most of the UI module properties).
Re: Less.js will obsolete CSS
#124Earlier quoted context omitted.
"As for serving it up as JSON: no one wants to write stylesheets in JSON." You don't have to. You can use a compiler to generate JSON to feed to the system, retaining the flexibility of having the compiler running but skipping the parsing step. Why not compile straight to CSS? Well, why not? For simple sites that may be just fine. For more complicated sites it might be desirable to screw with the CSS before compiling…
When people talk about how Javascript is going to approach C-speeds, I have to wonder how much cross-browser development they have actually done. Recently at work, we found that while Chrome handled using the jQuery UI 'buttons()' to style all of the buttons one of our pages, it was taking IE8 a full 8 seconds . After removing it to improve page rendering times in IE8 even Chrome felt snappier.
However, I would submit that string bashing also ought to be amenable to JIT optimization. What will kill you in the browsers is interacting with the DOM/browser itself, and that's not going to go away as that code is increasingly already as optimized as it's going to get. However, CSS already has that problem, so if you can dynamically snap some CSS together on the client side and then feed it to the usual CSS processes, it doesn't have to be a large loss.
I also expect the browers to continue to work towards support more of this stuff being done dynamically; if you can better hook into the page generation process, you can help the browser avoid extra stupid work, like starting to layout the page with the entirely wrong CSS. We're still a ways from this entire process being optimized; I feel we've finally left the stupid ages in the browser world, but we're still working.
Re: Less.js will obsolete CSS
#125One thing puzzles me: If LESS is essentially a template language specialized for CSS, why not reuse the template engine that you use in your application anyway? That way, you'd also have the benefit of defining often-used attribute values (e.g. colors) in a variable, and you could also group often-used combinations of attributes together in a variable or sub template.
I wonder why there is no general "template" language that you can use on any text/source file. For example, I'm writing a lot of AutoHotKey code lately, and I find myself wishing I had some of the expressive power of Python so I wouldn't have to repeat things. I'm seriously considering writing a Python-based "Preprocessor" language which lets me drop in Python code on any file, and deals with transforming it into the…
http://nedbatchelder.com/code/cog/
I used it several years ago with great success.
Re: Less.js will obsolete CSS
#126Earlier quoted context omitted.
> You can't specify the width of an inline element, for one. display: inline-block; width: ... ?
Unfortunately, bad browser support :/ http://www.quirksmode.org/css/display.html
Besides if you don't care about antiquated browsers (eg IE6), the inline-block is a viable option. In IE it will require some massaging, but it can be made to work quite easily.
Re: Less.js will obsolete CSS
#127Earlier quoted context omitted.
This is real CSS handwritten by real people. It's not compressed, it's just not in a fully-expanded style. If your parser is slow for reasonably formatted CSS, then your parser is slow. The best case can be as fast as you want, but real-world use is what matters. For what it's worth, -O2 brings the compile time for github.css down to about 1.5s.
The github CSS is compressed. It's fine to test worse-case scenario, but doesn't mean much.
Re: Less.js will obsolete CSS
#128Please, no . This is terrifying. Let us browse without JavaScript and in peace. Please.
You can still browse without Javascript. This won't hide any content — you just won't have Javascript gussying up the presentation for you. Which is already the case on a lot of sites that don't use it as a CSS replacement. That is basically your choice if you choose to roll without Javascript.
Re: Less.js will obsolete CSS
#129Earlier quoted context omitted.
Interesting. I tried both and now use LESS with the More plugin in my rails app. I'm a huge fan of HAML, but I haven't fallen in love with SASS yet. The big upside to LESS is it still looks like CSS. Compass is interesting though, from the SASS side. http://github.com/chriseppstein/compass
The latest version of Sass (3.0) has CSS syntax: The compiler supports both variants - the file extension (.scss vs .sass) denotes which you want to use. See the examples on their front page: http://sass-lang.com They have a command line tool "sass-convert", which can convert between the syntaxes (and from Less)
Re: Less.js will obsolete CSS
#130Earlier quoted context omitted.
Users running noscript are typically prepared for any site to look broken or not work as expected. They also comprise a tiny majority of visitors, so for all practical intents and purposes accommodating their case is not really a development priority.
Don't forget the accessibility considerations: screenreaders typically don't run Javascript either.