Recently, "framework" is a very fashionable word in web development. For example, the JavaScript framework YUI, jquery and prototype have aroused widespread concern, Web application framework rails and Dojo is more eye-catching, as if everyone uses some kind of framework to develop their own web site. But what is the framework? is the framework only useful to programmers, and can designers benefit from it?
What is a framework?
To facilitate communication, we unify a definition of "framework" (at least in this article): A set of tools, libraries, conventions, and a common module to try to abstract from common tasks, the goal is to make designers and developers focus on the specific aspects of the task project to avoid duplication of development. Generally speaking, the framework is the JavaScript framework and Web application framework mentioned above.
It should be emphasized that we do not have to discuss construction, packaging and publishing, instead, a framework is only for you or your team to use.
CSS Framework
Sometimes you may taste the sweetness of abstract, similar CSS code, which is most evident in designers who design several similar sites at the same time. In addition, the team of designers have a lot of benefits from the framework approach. For example, I work in a newspaper, and all of the more than 20 sites keep a lot in common, and based on the characteristics of news sites, they tend to be more similar rather than different. But even a single designer, designing a project that looks different from the surface, can also abstract some common pieces for the CSS framework.
Lawrence Ilbo (Lawrence Journal-world), where I worked, we recently built a CSS framework and found it to be a huge efficiency multiplier. Of course, we spent several days creating a CSS framework for ourselves, but once the framework was completed, the speed of developing high-quality Web pages was very fast. What's more, since every designer in the team now uses this framework, when a designer modifies another team member's web page, they no longer need to spend 20 minutes understanding other people's construction ideas and get started.
Are there those that can be ignored?
When putting into a very strong CSS framework, what you want to look for is that every project has done over and over again to repeat generic code, the goal is to consolidate the core status of these codes and follow the "Do not repeat yourself (Don t Repeat yourself)" encoding method. This makes maintenance a lot easier and can also help visitors save bandwidth overhead.
In almost every project I'm involved in, I have to declare a few CSS questions:
The "mass reset" browser default style, for example, sets the margin and padding of all elements to 0, removes the border of frames (framesets) and pictures (images), and so on.
Align with the baseline. This includes the same margins (or multiple) datum row heights, such as paragraph (paragraph), headers (headers), and lists (list), such as setting block-level elements.
Create a basic style for the form.
Create several common CSS classes, such as. Hide (Put the display to none, that is, hidden elements),. Mute (set to a smaller font and lighter color).
There are more interesting things, many web designers find themselves repeatedly using the same basic structure, why not move it to organize their own, to some extent, can be very flexible for multiple sites? Yahoo has done this, this is Yui. When we built the CSS framework for the Lawrence Daily website (the Journal-world), I first looked at how Yahoo did it. We're pretty sure that's not what we want, but as a good example, it gives us a lot of thought and how to build our own framework. We solved the problem of 16 cells, and it was flexible enough to make each of our sites available, even if each site looked a little different from the next version. In addition, most Web sites share widgets, such as pull-down menus, navigation menus, buttons, and so on, which are also the main objects that need abstract abstraction. In addition, you may have a common content name, such as a thumbnail of the picture list, and you can spec the CSS name, such as "thumbnail-list", so that all the display thumbnails are using this CSS class.
Another possibility is to extract hack (such as those that are compatible with those old browsers) and join their extended style modules. I tried it myself, but found that hack was too proprietary to be extracted into the general framework.
What are the real benefits?
The real benefit of the framework is the ability to quickly start work, you can create a new (X) HMTL file, introduce your frame, you don't have to deal with resetting padding and margins things, beautiful typography, clean forms, neat layouts, effective widgets, and so on. Obviously, obviously, though, you must come to customize the look and feel for each site. To achieve this goal, all you need to do is to copy and add to the default style is necessary.
Obviously, even though you have to customize the appearance for each site, all you have to do to do this is add a few lines of code to the default style. For example, if you set the basic horizontal navigation style for all the UL tags in the class attribute for "tabs" in your frame, and you have a gray border, you can set up a few lines of CSS code to make your site conform to the appearance style.
ul.tabs li {
border: none;
background-image: url(’/images/tabs/ ?site-specific-tab-look.jpg’);
}
ul.tabs li {
border: none;
background-image: url(’/images/tabs/ ?site-specific-tab-look.jpg’);
}
The list floats to the left, and the link is placed in a block form in the list, the link is also left floating, the font centered, like annoying ads like these work, the framework to help you complete, in your website design work, just focus on special, interesting details of the site, rather than write the million-written CSS code.