Building your own framework
Video: Building your own frameworkSo what happens if you decide that a framework is right for your workflow, but you never really find just the right one? Well, there is no rule against creating your own. Remember that most frameworks evolve out of the best practices and development standards of studios and individuals. If you're an experienced web designer that has a few projects already under your belt, I'm guessing that you already have a few starter files and code snippets that you reuse from one project to another. Let's talk about how those files can be molded into your own custom CSS framework.
- Additional resources
Viewers: in countries Watching now:
Have you wondered if using a CSS framework will speed up your site development? In this course, senior author James Williamson introduces the types of frameworks available—including the most popular choices among working web developers—and provides an honest assessment of the pros and cons to using a framework. He guides you through downloading a framework, setting up a directory structure, and building a framework-based site, such as structuring the HTML and working with forms. A separate chapter explores layout grids, often included with CSS frameworks, which provide a simple system for laying out page content.
- Understanding boilerplates, grids, and frameworks
- Choosing a framework
- Building your own framework
- Crafting a deployment strategy
- Modifying files
- Customizing typography and color
- Filling in framework gaps
- Exploring grid-based syntax
- Nesting grids
- Using mobile grids
Building your own framework
So what happens if you decide that a framework is right for your workflow, but you never really find just the right one? Well, there is no rule against creating your own. Remember that most frameworks evolve out of the best practices and development standards of studios and individuals. If you're an experienced web designer that has a few projects already under your belt, I'm guessing that you already have a few starter files and code snippets that you reuse from one project to another. Let's talk about how those files can be molded into your own custom CSS framework.
First, you need to take time to examine your own processes and determine exactly what is standard on each one of your projects. What do you find yourself repeating over and over again, reusing or even having to rewrite. Once you have identified those aspects, you'll have a good idea about what should form the foundation of your framework. For some this might be a single CSS file for controlling layout. For others it might be a collection of modular CSS files that you can pull together as needed for typography, layout, and browser normalization.
Again, this is totally dependent on how you like to work and how your projects are typically structured. Once you have identified the content that will make up your framework, you need to start thinking about how it's going to be structured. To do that, you need to take some time to document your coding philosophy. Are you a web standards nut, do you have a strategy that guides your naming conventions, do you condense all external resources into a single file, or do you separate your styles and scripts into individual documents based on functionality? All of this is going to guide how your framework resources will be constructed.
However, before you can start building them, you need to clearly articulate your approach and strategy as a web designer. Taking a good look into a mirror like that is good for multiple reasons. It will, for example, help you identify your own voice as a designer and developer, as well as forcing you to be supercritical about how you author your sites. During this process, I guarantee you that you will identify areas where you'd usually cut corners and need to improve. This is a perfect opportunity to make sure things are being done the right way and take the time to carefully author your code structure.
Since you plan on reusing it, you're only going to need to do this once, so you can really make sure that it's done right. Once you have done that, it's simply a matter of constructing the pages and resources that are going to make up your framework and identifying the workflow that's involved when using them. During this step I recommend thoroughly commenting your files and creating documentation for how to use them. This is especially important if you work in a team environment, and it's going to add an additional layer of scrutiny to how your framework is assembled and used. I often find when documenting something that it's not as well thought out as I'd initially assumed it was.
Once you have finished assembling your files and documenting your processes, it's time to start using your new framework. Try it out on a few sample projects and see if you get the development benefits that you anticipated. A few trial runs will help you sort through the possible bugs and help you refine your focus. At that point if you're happy with it, consider finding a suitable license for your framework and releasing it into the wild. Sure there are a multitude of frameworks available right now, but if yours fits the way that you like to work, chances are it might fit somebody else's as well.
Now, if you don't feel that your technical skills are quite where they need to be yet to create your own framework, consider creating a framework from multiple sources. If you experiment within frameworks you are likely to find that you really like the typographic approach of one framework, but the layout grid of another. You know, there is nothing out there that says you can't combine the parts of various frameworks into a super-framework that allows you to use just the parts you like from each of the sampled frameworks. If you choose this route, be aware that mixing frameworks can cause styling conflicts, so you'll need to be very careful when assembling the different parts.
There are currently no FAQs about CSS: Frameworks and Grids.