main mozilla tech

Mozilla Community Theme v1.0beta

Happy Holidays!

I will use this moment to introduce you the first release of my latest project. Over two months ago I presented the revision version of Mozilla Community Theme.

MCT is an element of a wider project – Mozilla Community Sites (MCS) that will help start a new community and maintain a website without much effort.

The Theme and its implementation are major part of the project and for last two months I have been working on creating a powerful, generic implementation of the theme, several small tools for making the theme easier to use and many tiny updates that should result in the higher quality of the theme.

On Monday we finalized the draft of the licensing guidelines which was the final step to release the theme to public.

Today, I’m proud to present you all the first revision of Mozilla Community Theme (click to test a mockup live):


From today I’m starting a serie of blog posts about various aspects of Mozilla Community Theme, but for those of you who want to dig on your own you can just start reading documentation.


mctlogoThe very first element of the new theme is a Mozilla Community logo. The logo is a new element that we hope will become a unifying element of all community building efforts. We spent a lot of time thinking about how to license it and I believe the result is a very relaxed policy that allows you to do whatever you want with the logo, while leaving us ability to block malicious use.

The logo may be used by any community that wants to express its relationship with Mozilla project. We do not try to create a new brand out of it, we try to give you ability to show what you stand for. In result the logo can even be modified (!) to adjust it to your website, but please, try not to overuse this power. The logo means something and I believe its extremely cute, but can be easily devaluated by misuse.


Mozilla Community Theme is an open source theme (the sources will be provided soon) that provides polished and high quality solution for anyone willing to start a new community website but lacking designer skills.

We provide highly customizable theme that can be used in different color palettes, with different backgrounds, layouts and widgets. The theme was created basing on dozen of current community websites with an intention to match all major components of those websites. It is possible to take the theme as it stands and use it for your website without changing a single line, but if you want you can modify everything. Its up to you and the further you go from the original design, the more you’re on your own in terms of quality ­čśë

Example implementation

The theme itself is a huge step forward, but the real benefit only starts there. As a part of MCT we provide ready to use implementations of the Theme in several forms.

The very first form is a clean XHTML/CSS/JS mockup which presents the semantic structure of the website and its style documents.

Another is a PHP version, which may look similar but provides an example of how to use several tools and deploy the theme into PHP application.

The third is a small cutomization tool – PHP Builder, which is a proof of concept of what you can modify in the theme with simple CSS file (generated out of GUI). You can customize the theme, download custom.css file and replace it in HTML version to get your custom theme!


At the moment Builder is pretty rough, but it already allows to create tens of versions of the theme. Ability to generate custom color palette (select custom and type any HEX RGB color) makes the amount of possible result infinite. In the future Builder should be able to provide more features and layout options.

App implementations

In a few days I will release first Theme implementations – wordpress and mediawiki, and drupal should follow shortly. The app implementations will not only contain the theme itself but also set of extensions that will provide unified set of features across multiple applications (think: OpenID, Single Sign On). We will also work on adding unique Mozilla related extensions that will allow your website to present the data directly from websites like QMO, SUMO or MDC.

MCS Admin Panel

The last step will be to provide single admin panel for installing/updating Mozilla Community Theme powered applications to run a complete website. The panel should allow someone with no prior experience in running a website to painlessly install and maintain his website, learning with no rush how the whole thing works.

Now it is YOUR time!

Working on such project inside Mozilla has, among others, one more benefit. I’m surrounded by web experts. Every single person who is reading this blog post has some unique knowledge and experience with coding HTML/CSS/JS or usability or accessibility or cross-culture design. Everyone can take a look at the sources provided with the whole implementation and find all the bugs I made and all those stupid mistakes. You can help make this project better.

My dream is to have this theme be a pure example of excellence in HTML/CSS/JS website development. Clean, modern code, flexible beyond recognition. During those two months I probably missed many opportunities to get nearer to my goal. Many elements may be not polished or may require some patience and love. If you think you found something like this, you probably did. So please, take a moment to share the feedback.
If you find the project interesting, and have some experience with web development, themes/extensions for WordPress/Drupal/phpBB/punBB/MediaWiki and want to help, email me (zbraniecki _a_t_ mozilla dot com) please. I could use some help ­čÖé


I would like to thank people who have helped me with this project. Especially Seth for an incredible patience and support in removing road-blockers, and The Royal Order of Design for a great design they prepared ­čÖé

Also, Szymon Piłkowski contributed first round of reviews, Wojciech Szczęsny provided initial insight into IE6 compatibility (not ready yet) and Szymon Błaszczyk contributed first usability review.


After getting the first round of feedback, I will remove “beta” from the release status, tag it and call it official. You can take it today and start using right away, but there may be some changes in the CSS basing on the volume of bugs discovered by peers.

During next days (after some christmas rest with my family)  I will be working on finalizing wordpress implementation (you can take a look at the current status) and mediawiki. I will also shed some light on the PHP code I wrote for this project and present you CSSLib and Style class.

Finally, I hope to spend some time discussing with you your feedback and implementing fixes to the code and helping first brave souls implement it for their new community websites!

So… how do you like it? ­čÖé

p.s. if you have ideas you would like to see, or you would like to work on, contact me or list them on the MCS:Brainstorm page.

main mozilla tech

PHP pixel mapper story

While working on Mozilla Community Sites project, I encountered an interesting challenge.


This Poll Box may look nice, but there’s a hidden trap for anyone trying to use this on his website. How to make the cute bars look nice and present real value in it? The intuitive response is to create a small PHP script that will be drawing the bar depending on the input value.

It would be easy to do if only the bar itself is a simple green/red dual color rectangle but in this case, it’s something more sophisticated. Because the bar can be used on different backgrounds, I had to extract it from the source and create a translucent PNG file with representation of blends, shadows and smooth edges. The file looks like this:


Great. Now we have the bar, and we can present it on any customized background, but it’s somehow static and cannot be used to present real values, right?
So the next step is to take it into PHP world and here were the trap is hidden. How to take a complex PNG image into PHP file? Unfortunately Google failed to help me here, so I started playing around with GD library (after an hour of searching for how to take alpha value from pixel in Gimp – it’s impossible) and crafted a plan.
I could create two dimension array of pixels (rgba) representing left edge, right edge, green line and red line and bundle it into a bar like this.
Alternative approach would be to cut PNG file and load elements into PHP script on each load, but it will have to cost much more (load file, decode, operations, encode, write) so I sticked to the pixel array map idea.
I was also initially considering trying to create such bar algorithmically (take green, red rectangles, then do the math for shadows, rounded corners, opacity etc.) but even ignoring how much time it would take to write it, the performance of such script would be definitely not satisfying.

So I needed two scripts. First, to take PNG file and build a PHP Array map of pixels. Second, to take such array and paint it on PNG file.

The script with those two functions is my svn repo.

At the top of the script file is an example Array map that will paint the example bar. drawpixelmap() is a function that can take such map as an argument and create PNG image from it.

getpixelmap() is a function that takes PNG image and creates string with PHP Array map.

In result you can take PNG image, save it in PHP, operate on it and draw the final result.

In case of my quest I had to cut the Array map into pieces (left edge, right edge etc.) and do a little bit of math.

The result looks like this:

Of course, any other value from 0-100 range for $v is possible.

So, if you will ever need to dynamically modify PNG file by pixels, those scripts may be useful for you ­čÖé

btw. I’m writing it from Victoria, where it is snowing for the third day in a row. Not sure how to explain it, but the snow in Canada is different from the one in Europe. Is it possible that its a kind of eggnog influence? ­čÖé

main mozilla tech

Mozilla Manifesto [pl]

Pewien czas temu popełniłem tłumaczenie Manifestu Mozilli. pomog┼éo mi poprawi─ç jako┼Ť─ç t┼éumaczenia, poczekali┼Ťmy troch─Ö, a┼╝ nadszed┼é czas na wydanie.

Zapraszam: polska wersja Manifestu Mozilli.

Oczywi┼Ťcie ca┼éy czas mam ┼Ťwiadomo┼Ť─ç, ┼╝e dokument nie brzmi jeszcze idealnie – t┼éumaczenie tak krytycznie wa┼╝nego i delikatnego dokumentu o tak fundamentalnym znaczeniu nie jest ┼éatwe (zw┼éaszcza, ┼╝e j─Özyk orygina┼éu te┼╝ najl┼╝ejszy nie jest), zatem je┼Ťli kto┼Ť ma uwagi, to zapraszam do wersji na, gdzie mo┼╝na popracowa─ç nad j─Özykiem. ­čÖé

Czym jest Manifest Mozilli? To dokument, kt├│ry powstaje od 10 lat… to odpowied┼║ na pytanie, kt├│re wszyscy stawiamy sobie. Czym jest Mozilla? Nie jako jednostka prawna – Mozilla Foundation czy Mozilla Corporation. Czym jest Mozilla jako projekt, jako byt, spo┼éeczno┼Ť─ç, idea. Gdzie jest granica? Kto jest “w” Mozilli? Z ca┼é─ů pewno┼Ťci─ů Mozilla istnia┼éa na d┼éugo przed za┼éo┼╝eniem osobowo┼Ťci prawnej i nikt z nas nie ma w─ůtpliwo┼Ťci, ┼╝e projekt istnia┼éby niezale┼╝nie od sukcesu Mozilli Corporation/Messaging/Mobile czy Foundation.

Dwa lata temu kilka os├│b, za┼éo┼╝ycieli projektu jak Chris Hoffman czy Mitchell Baker zaczeli g┼éo┼Ťno zadawa─ç pytanie – kim jeste┼Ťmy, dok─ůd idziemy, co to znaczy Mozilla, co nas ┼é─ůczy?

Co ┼é─ůczy ludzi pracuj─ůcych nad Firefoksem, Seamonkey, Camino, Thunderbirdem, tysi─ůcami rozszerze┼ä, lud┼║mi pracuj─ůcymi nad dost─Öpno┼Ťci─ů dla niepe┼énosprawnych (jak Aaron Leventhal), Bugzill─ů (jak Frederic Buclin), lokalizator├│w, ludzi z Fundacji jak Mitchell czy Gerv i tysi─Öcy innych os├│b pracuj─ůcych nad swoimi projektami – czasem komercyjnie, czasem nie.

Wnioski zosta┼éy spisane w formie manifestu. Deklaracji, kt├│ra opisuje co nas ┼é─ůczy. W co wszyscy razem wierzymy i co chcemy robi─ç. Ka┼╝dy z nas jest inny, pracujemy nad r├│┼╝nymi rzeczami, jeste┼Ťmy w r├│┼╝nych momentach ┼╝ycia i Mozilla jest dla jednych z nas ogromn─ů cz─Ö┼Ťci─ů ┼╝ycia, dla innych wspania┼éym hobby a jeszcze dla innych malutk─ů form─ů podzi─Ökowania. Wszyscy jednak dzielimy te podstawowe przekonania i wszyscy wierzymy w te podstawowe warto┼Ťci.

Ka┼╝dy mo┼╝e “podpisa─ç si─Ö” pod tym manifestem. Firma, osoba prywatna, ka┼╝dy mo┼╝e skorzysta─ç z tekstu manifestu aby pokaza─ç swoje przekonania i zadeklarowa─ç pewn─ů wizj─Ö Internetu, je┼Ťli zgadza si─Ö z nami. Manifest jednoczy nas wszystkich i wyra┼╝a w zwi─Öz┼éej formie ┼Ťwiatopogl─ůd i idee kt├│re wyznaj─ů uczestnicy projektu.

Mi┼éej lektury i zapraszam do komentowania ­čÖé