Garrick Cheung

Sharing what I know and learn about CSS, MooTools, Javascript, PHP and etc.

CSS Best Practice #2: Shorthand Properties

Posted on | December 5, 2008 | 1 Comment

Write your CSS rules with shorthand properties. It keeps things simple and clean.

1
2
3
4
5
6
7
8
9
10
.example {
    /* long */
    padding-top:1px;
    padding-right:2px;
    padding-bottom:3px;
    padding-left:4px;
 
    /* short */
    padding:1px 2px 3px 4px;
}

To help you with the shorthand, Dustin Diaz took the time to put together a CSS shorthand guide. Way to go Dustin! Check the guide for in-depth descriptions, examples, and Dustins “quirky facts” (such as shorthand defaults).

SitePoint CSS Reference is another source for shorthand properties, or any property in general, you should/could/would use.

Implement Other Selector Engines (e.g. Sizzle or Peppy) into MooTools?

Posted on | December 4, 2008 | 10 Comments

Not too long ago announcements of two new selector engines came on the scene, Peppy by James Donaghue and Sizzle by John Resig. At the time I had a fleeting thought of how cool it would be if MooTools was as fast or faster than Peppy and Sizzle.

Yesterday, Ajaxian tells us that the Dojo Community will vote on whether they implement the Sizzle selector engine instead of using their own.

Just after reading that I thought whether MooTools would benefit from implementing a selector engine instead of using their own. Apparently I was not alone in this thought as Aaron Newton has posted his thoughts and pros/cons. Here’s my two cents. Read more

Solution to Flash and Select Drop-downs Covering HTML Elements

Posted on | December 3, 2008 | 1 Comment

I’ve positioned elements absolutely and had to deal with a bug where the element appears below a flash object or select drop-downs, which usually occurs in IE. I’ve seen a few solutions, which work great, and I have one more to add. Read more

CSS Best Practice #1: Reset CSS

Posted on | November 30, 2008 | 4 Comments

I think resetting browser styles is important. You’ll never know what you’re dealing with. If all the browsers start on the same page it will make your life easier because you’ll know what to expect. I personally use Eric Meyer’s Reset CSS as a base and modify it as needed. Read more

CSS Best Practices: Index

Posted on | November 30, 2008 | No Comments

I’ve decided to create an index of all the CSS best practices in this post that will be updated when I add a new best practice. It should be easier for you to keep track of everything. Please bear with me while I get things together. Read more

Limitations of CSS Files in IE

Posted on | November 25, 2008 | No Comments

If you didn’t know already, IE puts a limit on stylesheet file sizes to cap off at 288Kb. Another limitation I learned from Martin Ivanov’s post is that IE limits the number of stylesheets loaded via link tag or @import to 32 files.

Make use of compression and minification if you’ve got large files and lots of ‘em. Besides, your styles should be reusable so you won’t have gigantic files.

Dustin Diaz on DocTypes

Posted on | November 25, 2008 | 1 Comment

I just had to share this one with you as soon as I read it. Dustin Diaz shows us a way of declaring a doctype, that puts the browser is standards mode. Thought it won’t validate, which he explains:

There is really, absolutely no reason you need the rest of the doctype in your declaration unless you’re validating code. Furthermore, it does not mean that your page is even invalid. In the end, it puts your webpages into standards mode, which is what really matters.

Read more

Clientcide: New Form Validators and Documented Beta Code

Posted on | November 15, 2008 | No Comments

Aaron Newton has released some new form validators (with help from contributor Chafik Barbar) and documentation for his beta code. Everyone has to deal with form validators one way or another. I’ve posted on one from MooTools.Floor, but this is a different way of doing things. Read more

JxLib, a MooTools Javascript UI Library

Posted on | November 12, 2008 | 2 Comments

From Paul Spencer and team comes a UI library built from MooTools. After taking a look at the examples, I have to say it is very impressive work.

JxLib Panels Example Read more

Run Javascript Functions Without using ‘domready’ Event

Posted on | November 8, 2008 | 2 Comments

I don’t really like using the ‘domready’ event. The idea of adding another event to the window object just bugs me. So here’s the alternative. In short, an array is created, functions you want to run are added to the array, and when the page reaches the bottom the functions in the array are run. Read more

« go backkeep looking »
taking viagra woman Cheap Viagra
cheap gerneric viagra?