What is less?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    What is less?

    I just came across an article that takes about LESS, a dynamic stylesheet which makes the DRY (Don't Repeat Yourself) Principle possible compared to CSS where you have have to repeat your codes (Static Stylesheet).

    Does anyone have any idea about this, cos i don't really get it?

    #2
    LESS
    if you dont understand it, simply dont use it.
    Advertise your mobile site for FREE with AdTwirl

    Comment


      #3
      by the looks of things less is a javascript function that uses localStorage to enable quicker css
      i think you can store up to 2mb in local storage (per site) - handy for storing data on peoples computers rather than using Cookies ;)
      i use local storage a lot when creating addons for web browsers

      Added after 5 minutes:

      the reason why local storage is quicker than cookies is because the server has to read a cookie where as local storage is client side

      so there for storing css on client side means that a user doesnt have to download it from the server once it is set

      Added after 6 minutes:

      by the looks of things all these mobile sites use local storage: (im not sure if local storage is less mb for mobiles)
      Google Search
      Bing
      Facebook
      YouTube
      Yahoo! Front Page
      Twitter

      Twitter mobile also uses app cache which is new to me Appcache Facts
      Last edited by something else; 21.03.12, 10:15.

      Comment


        #4
        oops google mobile uses sessionStorage not localstorage

        This has got me thinking a lot about using javascript more in my scripts for storing data
        i was kind of put off by phones not supporting javascript (which is very few these days)
        but you can use things like:
        PHP Code:
        <script type="text/javascript>
        var css = localStorage.getItem('css');
        if(css==""||css=="undefined")
        {
        localStorage.setItem('css', '<? include_once("style.php"); ?>'); // might have to do a call for localstroage on style.php also to make sure its blank 
        css = localStorage.getItem('css');
        }
        document.write(css);
        </script>
        <noscript>
        <?
        include_once("style.php");
        ?>
        </noscript>
        Last edited by something else; 21.03.12, 14:12.

        Comment

        Working...
        X