Search code examples
htmlcssgoogle-closuregoogle-closure-library

google closure UI template for login page


im new to google closure...is there a simple template by Google for to design a simple user registration/login page? all i see are mainly tools for UI manipulation like creating a DOM and so on.


Solution

  • You can't render an entire login page with the closure library, however you can use the specific ui components to generate inputs, labels, forms, buttons etc and specify actions for each and every one of them. e

    The best way to go about it is to simply use those, however it's kind of inconvenient to define your own custom css for predefined goog.ui components. That's why I usually stick to using the common goog.dom.createDom function.

    On the down side, you have to write a bit more code to achieve the same visual result, but I am using a gss like js implementation that computes all the variables in a css style at runtime and automatically servers browser/version specific CSS style, without having to serve a different stylesheet to each and every browser. Faster, cleaner and only a bit more expensive in terms of processing time.

    There is plenty of cool stuff within the closure library, especially when it comes to user interface, just figure out what you need and what sort of user span you are planning on. If you want a full compatibility with almost all the browsers in usage, from IE 5+ onwards(I'm saying IE cuz this one is the shittiest and the hardest one to achieve compatibility for), Firefox, Chrome, Safari, Dolphin, mobile phone browsers etc, the modular design of the Closure Library enables you to compute browser specific CSS at runtime without it having to be an expensive process.