Coffeehouse Thread

17 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Google releases another cool toy: Google Closure Stylesheets

Back to Forum: Coffeehouse
  • User profile image
    fanbaby

    http://www.infoq.com/news/2011/11/Google-Closure-Stylesheets

    Have you ever wished CSS had variables, functions, minification? Well, here you go.

    Oh, they didn't mention, but every CSS file has a link to google analytics, so google can track your site and log which browsers are used to visit your site. Wink

  • User profile image
    ManipUni

    Oh god no! C style macros in CSS, the HORROR! Even C shouldn't have C macros. 

  • User profile image
    evildictait​or

    , ManipUni wrote

    Oh god no! C style macros in CSS, the HORROR! Even C shouldn't have C macros. 

    C macros are quite good for making fast code look readable, for example:

    #define FLAG_IS_SET(_val, _flag) (((_val) & (_flag)) != 0)

    ...
     

    if(FLAG_IS_SET(dwOptions, HEAP_SERIALIZE)) { EnterCriticalSection(&heap->lock));
    if(FLAG_IS_SET(dwOptions, HEAP_ZERO_MEMORY)) { zeroHeapMemory(ptr) } 
    ... 

    rather than the less obvious:
    if(dwOptions & HEAP_SERIALIZE) { ... }

  • User profile image
    fanbaby

    @evildictaitor:That case was supposed to addressed in c++ with inline functions. (And with google go, it is to be magically taken care of).

  • User profile image
    ManipUni

    @evildictaitor: While macros certainly allow you to write fast code, they're a maintenance nightmare. Ever tried reading code scattered with macros? You have absolutely no idea what it actually does at all, so unless the macros are very well named you're left switching back and forth between code and macros.   

  • User profile image
    magicalclick

    @ManipUni:

    Isn't that the same as using factories? Or content generation? I don't need it for CSS, but, I think there are uses for other people.

    Leaving WM on 5/2018 if no apps, no dedicated billboards where I drive, no Store name.
    Last modified
  • User profile image
    ZippyV

    There are other projects that already do this: http://lesscss.org/ or http://www.dotlesscss.org/ for .net users.

  • User profile image
    figuerres

    yet another hack / patch to the html / css / js crazyness ... yech  Expressionless

     

  • User profile image
    W3bbo

    , ZippyV wrote

    There are other projects that already do this: http://lesscss.org/ or http://www.dotlesscss.org/ for .net users.

    I don't know why they don't include 'variables' (or rather, constants) in CSS, it makes sense because CSS inheritance is totally orthogonal to the way inheritance should work (i.e. boxes inherit styles from parents in the document, as opposed to CSS rules inheriting properties from other rules).

  • User profile image
    fanbaby

    @W3bbo: It seems DRY is foreign to those who designed CSS and maybe HTML.

     

    Also one of the features I think is missing from HTML is the ability to build a page from components (without JS).  Think for example of wikipedia's main page. 95% of it are the same for all users. Almost everything save the "Hello john Doe/Login guest". The same is true for most sites, and yet this repetition can't be cached. Imagine that a page contains only the changed data and links to fragments that are more likely be cached. In addition this small page can be encrypted, and the fragmets can be in plain text. Of course in order to prevent tempering, hash codes for these links can be in the "calling" page.

  • User profile image
    AndyC

    , W3bbo wrote

    *snip*

    I don't know why they don't include 'variables' (or rather, constants) in CSS, it makes sense because CSS inheritance is totally orthogonal to the way inheritance should work (i.e. boxes inherit styles from parents in the document, as opposed to CSS rules inheriting properties from other rules).

    The entirety of HTML+CSS is * backwards to the sane way of doing things, introducing anything that might start to make sense is clearly a poor fit for the "design"

  • User profile image
    brian.​shapiro

    , ZippyV wrote

    There are other projects that already do this: http://lesscss.org/ or http://www.dotlesscss.org/ for .net users.

    You could always do it in php too.

  • User profile image
    ManipUni

    brian.​shapiro: This thread already has enough poorly designed junk in it without bringing up PHP Wink 

  • User profile image
    brian.​shapiro

    , ManipUni wrote

    brian.​shapiro: This thread already has enough poorly designed junk in it without bringing up PHP Wink 

    How can any standards-based non-proprietary or open source solution be poorly designed junk? It doesn't make sense.

  • User profile image
    Harlequin

    SCSS in the Ruby side of things is nice I think, got to work with it for a few days. Need to port that over to ASP.NET.

  • User profile image
    cheong

    @fanbaby:I would rather create my own customCSS.axd to generate CSS code based on page or so...

    Btw, I've already done that for javascript once already. 

    Recent Achievement unlocked: Code Avenger Tier 4/6: You see dead program. A lot!
    Last modified
  • User profile image
    exoteric

    @fanbaby: That's nothing new though:

    http://ncannasse.fr/projects/hss

    That said, I really like the Closure tools.

    On the other hand, at some point, one may want to switch to pure Js.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.