There's an example here in which there is a stylesheet of type text/less
that is interpreted by google chrome, but appears to have nothing but less syntax in it.
<link rel="stylesheet" href="responsive.less" type="text/less" media="screen" />
The browser parses the HTML and creates a DOM from it. Next, it parses the CSS. Since the only rule available in the CSS has a span selector, the browser sorts the CSS very quickly! It applies that rule to each one of the three <span> s, then paints the final visual representation to the screen.
Less (sometimes stylized as LESS) is one of the dynamic style sheet languages that can be compiled into Cascading Style Sheets (CSS), or can run on the server-side and client-side.
css is a style specification defined by w3c consorcium. This style code is interpreted by browsers.So this is not a compiler nor interpreter it is standard.
The code we humans write cannot be read by computers – it must be translated into machine code. Compilers and interpreters do that, and the browser is an interpreter!
No, no browsers interprets LESS directly. The page must have contained less.js, which is a JavaScript implementation of a LESS compiler.
LESS is a dynamic stylesheet compiled by less.js
(or in the example given, less-1.1.3.min.js), producing normal CSS once complete. The browser doesn't understand the LESS file itself.
LESS can also be used server-side, as described on the LESS website.
$ npm install -g less
The example also calls <script src="../../js/less-1.1.3.min.js" type="text/javascript"></script>
Here less-1.1.3.min.js
compiles the less from responsive.less to css and return it back to the browser. Also see: http://lesscss.org/#usage
See below you will find the client side compiled CSS between <style id="less:examples-responsive-responsive" type="text/css" media="screen">
:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With