Featured Posts

Notes from An Event Apart Boston 2012 I had a great time at An Event Apart Boston, 2012. Ill post some photos soon. The conference avoided deep dives into code in favor of showing WHY you would do reactive design. As Eric Meyer said "My...

Read more

Judging the CT Student Innovation Exposition (E-Commerce)... Want to know what the next 10 years will look like? Ask a high school student. Their creativity isnt limited by their knowledge of what we currently call technological limitations. They have a vision of...

Read more

The Value of Feeling Appreciated as an Employee in... Whether you’re a new employee or the vice president of the company, everyone wants to feel valued, even appreciated, in the workplace. Not only does it improve morale and make the workplace a more pleasant...

Read more

The difference between classic and motion tweens in... Here it is: If you're used to doing things "the cs3 way" then you can continue to do so with the classic tween tool. It works the same way as you remember, using key frames as normal, but you cannot...

Read more

PHP: If (equal to AND not equal) - eliminate form spam... Just learned a great function of PHP thats already made my forms a lot better. A while back I wrote an article about eliminating form spam without captchas by using css to hide a text input box for bots...

Read more

twitter

Breaking News

  •  

Examples of Responsive Design and a plea for Device Agnostic Design

Category : Art & Design, Cool Websites, CSS, Slick Code, Technology, What I Read

Below are a few of my favorite examples of Responsive Web Design, the practice of setting media types allowing the design to scale to adapt to whatever the size of the screen that the user is using.

http://robot-or-not.com/
http://bostonglobe.com/
http://clearairchallenge.com/
http://www.smashingmagazine.com/

Device Agnostic Design
An article from Smashing Magazine talks about Device Agnostic Design which is a great future proofing advancement from responsive design. Being device agnostic means that you use your content to set break points, not the device you want the content to display on. This is important because if we spend time developing content for specific devices we are creating the next developer nightmare. There is no way to predict the size or aspect ratio of screens in the future. What happens if you design your site to perfectly fit your favorite tablet only to discover that the next generation of that same device has a slightly different sized screen.

For now, it seems as though developers are at the mercy of hardware makers. All we can do is hope they create some sort of a standard, and quick. In the meanwhile, we’ll have to make design decisions based on the content we want to show. After all, content is King.

5 Ways to Reduce the Number of CSS Classes you use

Category : CSS, Slick Code, Technology

You can greatly reduce the number of css classes you use in a project by some best practices while writing or reviewing CSS code.

Use a CSS style Reset:
Browsers come with a default styling for most elements but unfortunately these definitions are not the same across all browsers. Even something as simple as a

tag can be interpreted differently across different browsers. (Bottom vs top margins in older versions of IE 6/7 vs FF and Chrome). Using a CSS reset makes all the default inherited definitions the same and will simplify your debugging while reducing the number of styles needed to account for different default element styling.

There are a number of resets you can find with a quick search. The most extensive is Eric Meyer’s reset, and this maybe a bit overkill as you will have to redefine all properties of every element. Experiment and see what works best for you and how you code. The CSS clear I use is attached below.

If you want to look into this further or if you want t help deciding which reset is right for you, a great article can be found from SixRevisions.

Create a Common CSS library:
Put all your generic one definition selectors in one place (generally the top as this will cascade better–more on this below.) If they only have one definition then you can very likely reuse the class elsewhere in the document. Keeping a generic name will allow you or someone else to easily understand the classes being used. Think float-left, float-right, clear-float, em, caption, highlight, center-text, center-auto, etc… I’ll list this out in another tutorial in the future.

I also declare all the colors used in a project as stand alone classes so I can quickly add them to a class without having to recreate a whole new class just to account for a change in text color.

I may not use the whole library in every project, but I use at least 75-80% and I know my commonly used code is there, and keeping all the colors in one placer makes it easier to copy and paste for other styles.

Cascade your CSS:
I start general and the work my way to being more specific. Using more specific selectors will allow you to drill down in setting properties. If you do this correctly you can greatly reduce the number of !important tags you use in your stylesheet.

CSS hierarchy: Element >> ID >> Classes >> !important >> DOM

Use Bug Killing CSS:
There will probably always be quirks among the many browsers creating the need for browser specific style sheets, but these style sheets should be as simple as possible. They should only list the properties for definitions that need to be overwritten to work in the given browser. Do not copy the entire rule. (I know this seems obvious-Its OK to laugh- but I’ve seen this on major websites).

Validate your CSS:
Don’t forget to use the w3c validation tools. This is the best way to spell check your style sheet in addition to checking syntax of all your elements. Plus, you’ll have the piece of mind knowing that your code is standards compliant.

7 Principles Of Clean And Optimized CSS Code

Category : CSS, Great Tutorials, Slick Code

http://www.smashingmagazine.com/2008/08/18/7-principles-of-clean-and-optimized-css-code/
This is another post from SmachingMagazine. The principles are a pretty good standard ruleset.

#1 (shorthand CSS) is key. I opt for the least amount of whitespace as I can as some of the CSS files I write for larger sites still have a few hundred lines. This is without the IE 6 hacks, which are in a separate CSS file, which they recommend in #2. This allows your code to validate and also be condensed. Both good things.

Thank you Tony White.
Enjoy!