Responsive Design

I\'ve updated my theme here to make the layout more responsive depending on the device you view it in.  For both smart phones and iPads/tables, the layout linearizes. That is a fancy way of saying the right sidebar should scoot below the main content area, and everything will become 100% wide to fill the screen. 

I did this using CSS3 media queries, this technique only works in newer browsers, including Chrome, Firefox. and Mobile Safari.

First, the viewport tag will help different devices render the page correctly. After reading, Choosing a viewport for iPad sites, and A tale of two viewports --- part two, I added this to my page template

{syntaxhighlighter HTML}

I then added three blocks of media queries to adapt the layout depending on the device, the first block linearizes the page content if the device screen is less than 1024px wide. The second and third blocks fix some font sizes so that text renders legible on different devices.

{syntaxhighlighter CSS} /* LINEARIZE CONTENT */ \@media only screen and (max-device-width: 1024px) { #wrapper { width:auto; padding:10px 10px 0; } #container, #page { width:auto; margin:0; padding:0; }

rgCenter, #rgRight { float:none; clear:both; } #rgRight {

background-color: #e3e3e3; padding:20px; margin:0 -20px -20px; } div.span-10, div.span-6 { float: none; width: auto; margin-right:0px; } } /* ipad / tablets */ \@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { body { font-size:1.3em; }

wrapper { width:1024px; padding:20px 20px 0; } .dsq-comment-text {

font-size:1.8em; line-height:1.5; } } /* ipod/iphone3 */ /* Smartphones (portrait and landscape) ----------- */ \@media only screen and (max-device-width : 480px) { /* Styles */ body { font-size:1.3em; } #wrapper { padding:10px 10px 0; } #logo-floater h1 { font-size:1.5em; } #page h1 { font-size:1.3em; } #page h2 { font-size:1.2em; } #page h3 { font-size:1.1em; } }

Tags: Mobile, Web Design

Web Design is Evolving

I may be a bit late to the party with this observation, but web design is finally evolving. Mobile phones and tablets have freed us from having to use a laptop or desktop to use the web. Using HTML and CSS, designers can now use media queries to control how a site appears on different devices.  If done right, and done from the beginning to save costs, your website can be useable and look nice on multiple devices, without the need to setup a different mobile site or theme.

We may also be seeing the end of the tiny font fad that has made sites illegible for the last decade. It\'s about time.

You see, in most cases, if you're building websites with the font size set between 10 and 15 pixels, you are costing your clients money. And I aim to prove it.

16 Pixels.

Tags: Drupal, Mobile, Usability

Importing to BitBucket

When bitbucket added git to their code hosting service, I signed up to try out the service. Primarily since they offer unlimited free private repositories, which is perfect for one-coder projects like this blog. Each repository also gets a wiki and an issue tracker.

Creating an account was straight forward, I then had to import my self-hosted git repository to bitbucket. This wasn\'t too difficult, after opening port 9418, which is used by the git protocol, I did the following.

1. Let git know that I wanted to export my repository

cd /var/local/git/foo.git touch git-daemon-export-ok

2. Run the git daemon, temporarily.

git daemon --base-path=/var/local/git --export-all

You could run it idefinitely, but I\'d rather it run when I need it to.

git daemon --base-path=/var/local/git --detach --syslog --export-all

3. Import the repository into bitbucket with this repository URL.

git://oscarm.org/foo.git

Once the import was successful, I stopped the git daemon. The final thing to do, is update any repositories that used my local bare repository as the origin to use bitbucket as the origin. In each repository, I had to edit the .git/config file and update the origin url to something like:

url = git@bitbucket.org:omerida/foo.git

Tags: git, Oscarm.org