Introducing Brick: Minimal-markup Web Components for Faster App Development

Those of you on the cutting HTML5 edge may have already heard of the exciting Web Components specification. If you haven’t, you’ll probably want to read up on what makes this so exciting, but long story short, Web Components promise to open up a new realm of development by letting web developers write custom, reusable HTML tags. Think of them as JavaScript plugins without the need for additional code initialization or boilerplate markup/styling.

Unfortunately, it will be a while before we see native browser support for the spec, but that doesn’t mean developers can’t start taking advantage of the component concept now, thanks to Google’s Polymer framework and Mozilla’s x-tags polyfill library (both X-Tag and Polymer share the same low-level, Web Component polyfills).

We’re proud to announce the beta release of Brick, a cross-browser library that provides new custom HTML tags to abstract away common user interface patterns into easy-to-use, flexible, and semantic Web Components. Built on Mozilla’s x-tags library, Brick allows you to plug simple HTML tags into your markup to implement widgets like sliders or datepickers, speeding up development by saving you from having to initially think about the under-the-hood HTML/CSS/JavaScript.

Putting Brick into Action

Say that you wanted to implement a cross-browser, mobile-friendly calendar widget in your application. With current JavaScript plug-ins, such as jQuery UI, this would require putting boilerplate, non-semantic markup into your HTML, as well as explicitly initializing and managing it through JavaScript. However, with Brick, you can implement such a component simply by adding a custom HTML tag that you can treat as a normal native tag.

For our calendar example, this means just including the library’s CSS and Javascript file in your application, then adding the following tag to your markup:


which creates a DOM element that looks like this:

Want to edit how the component behaves, such as by adding navigational controls or pre-selecting a date? Like any other native tag, you can change how a component behaves just by changing the attributes of the tag!

<x-calendar controls chosen='2012-05-17'></x-calendar>

Available Bricks

At the time of writing, Brick consists of thirteen different tags, most of which are completely independent of one another, and can even be downloaded separately instead of a single bundle.

Some tags abstract away complex widgets into simple HTML tags, such as:

Others are cross-browser polyfill implementations of existing native not-yet-globally-supported elements, such as:

which polyfill <input type="range"> and <input type="date">, respectively. Still others are structural components simplifying the styling and markup of certain components, such as <x-layout>, which ensures that content, headers, and footers can fill a container element without explicit styling markup.

Each tag comes with a flexible attribute/JavaScript API and can be fully styled to match your application.

Start Building with Bricks

Want to start using components in your own applications? Head to to download a release bundles, view demos, and read the documentation for the available tags. Alternatively, visit the Brick Github page to view the source code and contribute to the effort!

The library is still in a beta release, so we appreciate all user feedback! Brick is already starting to crop up in the wild, so we’d love to hear about how you’re using it!

View full post on Mozilla Hacks – the Web developer blog

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

New Firefox Command Line helps you develop faster

Firefox 16, now on the Beta channel, has a fantastic feature that was mentioned briefly in the Aurora 16 blog post and first introduced in a separate post by Joe Walker, the feature’s creator. We’ve devoted a sizable portion of the new Developer Toolbar to the “command line”, which you may sometimes see us call GCLI (short for Graphical Command Line Interface). The command line gives you quick keyboard control over your tools and access to features that don’t have any other user interface.

I have made a video version of this blog post so you can see the command line in action:

To get to the Developer Toolbar and the command line, you can use the shift-F2 keyboard shortcut, or select Developer Toolbar from the Web Developer menu. If you want a quicker keyboard shortcut (this is a keyboard-heavy feature, after all!), you can use the Customize Shortcuts add-on to override a shortcut that you don’t use.

This command line is designed to be quick-to-type and discoverable. It will complete commands and parameters for you, to save you typing. There’s also a lot of help built in for the commands and their options. Here’s a look at the list of commands shipped with the initial command line release:

Control Your Tools

Personally, I hate having to reach for my trackpad. Removing my hands from the keyboard just slows me down. The problem is that it’s not easy to remember all of the keyboard shortcuts and traditional keyboard navigation is sometimes not as quick as reaching for the trackpad. Let’s look at how the new command line helps with this.

Let’s say that I forgot the keyboard shortcut for the Web Console. I could reach for my trackpad and hit the Web Console button that is conveniently located on the new Developer Toolbar. Or, I can just remember the keyboard shortcut for the command line and run the command console open. Voila! The console opens. What I actually type to run that command is “con<tab>o<tab><enter>”, which is quick to type indeed.

Want to see what else you can do with the Web Console? Type help console.I’m not even sure if there’s a keyboard shortcut for the Clear button in the Web Console. It’s easier to just run the console clear command than try to remember a seldom used shortcut.

Here are the current commands that control the developer tools:

  • console – open, clear and close the Web Console
  • dbg and break – many controls for the Debugger and breakpoints
  • edit – open the Style Editor on any of the CSS files loaded in the page
  • inspect – open the Page Inspector for a part of the page
  • resize – control the Responsive Design View
  • tilt – control the 3D page view

Let’s look at a more interesting example. The current design of is a responsive design. I want to see how the headings will show up on a smaller screen. If I’ve been working on the page, I would likely know some of the IDs and structure used in the page, so I could enter a command like:

inspect "#home-news h3"

The “inspect” command takes as a parameter a CSS selector that is used to select a node on the page. An easy way to jump into page inspection on any page is to type inspect body, because every page will have only one. After typing inspect "#home-news h3", I’ll see something like this:

In the style panel, I can see that the font size is set to 28px on this heading. How would it look on a phone-sized screen? Many phones report their size as 320×480. Let’s give that a try by typing the following command:

resize to 320 480

That turns on the Responsive Design View and sets the size at the same time. Here’s what the result looks like:

In the Style panel, we can now see that a media query with a max-width has taken effect and the font-size on the heading has dropped to 24px. We can also scroll down and see that the three columns that were side-by-side are now stacked. You could use the resize off command to turn off the Responsive Design View, or you could just hit <esc> a couple of times to get back to normal browsing mode.

Entirely New Developer Features

We’ve also added a handful of commands giving you some new and useful powers. Let’s take a look at a few of them.

Put your hands in the cookie jar

The “cookie” command highlights why this command line is a “graphical” command line and not your old ’70s-style command line. Running cookie list on, I see:

The output shows me all of the cookies that I have right now for this site. If I want to remove that cookie, all I have to do is type cookie remove WT_FPC or, if I think it’s easier, I can click on the “Remove” action listed next to the cookie and that command will be entered on the command line for me. I can also give myself new cookies using the “cookie set” command.

Screenshots for fun and profit

The “screenshot” command is really handy. At, I ran this command:

screenshot heading.png 0 false h1

This said to make a file called “heading.png”, wait 0 seconds before taking the shot, don’t include anything outside the visible browser window and finally grab just the element selected by the “h1″ CSS selector. The result, saved conveniently in my Downloads directory, looks like this:

The command line provides hints inline for each parameter. Pressing F1 gives me even more help about the current parameter.

Stop the blinking!

The “pagemod” command lets you quickly make some bulk changes to the page. If you’re looking at a page and there’s something flashing at you, you can nuke it using the “pagemod remove element” command. See how everything on the page looks without classes by typing:

pagemod remove attribute class *

Or, take a look at how a different headline looks:

pagemod replace "Out of Date News" "The New Hotness"

Here’s a fun one that’s interesting to try out on popular sites:

pagemod remove element iframe

See if you can spot the bits that go away.

More goodies: grab the HTML, reconfigure Firefox

The “export html” command opens a new tab with an HTML snapshot of the current state of the page.

The “addon” command lets you quickly enable and disable addons. This is useful for isolating an add-on that might be causing you trouble, or for keeping some add-ons that you don’t use often turned off.

The “pref” command lets you easily change one of the many configuration options that Firefox has. For example, if you’d like to do some Firefox add-on development, you may find this command handy:

pref set true

After that, use the “restart” command to restart the browser, and you’ll find that tools like Scratchpad have gained some extra powers for hacking on your browser. While many add-ons these days are restartless, you’ll find that there are still some popular ones that require a restart when enabling or disabling them, and the restart command is handy for that as well.

Add Your Own

One of the best features of command lines in general is that they are a very scalable form of user interface. Adding more commands does not add visual clutter in the UI you look at all day. Expect to see more commands in future Firefox releases, plus new commands that appear in add-ons.

In a future command line article, we’ll show you how to create your own commands. It’s easier than you might expect!

View full post on Mozilla Hacks – the Web developer blog

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

CloudFlare Makes The Web Faster, Safer

If you have a web site two of your biggest problems are that it’s too slow and it’s too vulnerable to attacks from computer geeks with ill intent. Attacks against web sites including PBS, CIA, Sony and Nintendo, have made web site owners cringe at the thought of knowing they’re never safe. Wouldn’t it be nice if there was an inexpensive way to solve those twin problems?If you use CloudFlare then …

View full post on web development – Yahoo! News Search Results

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Toronto Web Firm, Soft Gravity Uses Its Own Software Development To Launch Its Site Faster

Nearly 1½ years after opening, Toronto website and software development specialists, Soft Gravity use their timesaving new technology to build their own site. (PRWeb May 13, 2011) Read the full story at

View full post on web development – Yahoo! News Search Results

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Mozilla Plans Faster Firefox Development Model

Firefox 4, the latest incarnation of Mozilla’s popular web browser, will arrive in final form on Tuesday, March 22. While the final release is good news for Firefox fans, it comes over three months after the initial Firefox 4 release date. Firefox 4 isn’t the first release to miss its shipping goal, in fact the previous […]

View full post on web development – Yahoo! News Search Results

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)