The adoption of CSS Regions is definitely moving along swiftly. They are now supported in Mobile Safari on iOS7, Opera, Chrome Canary, Chrome Stable & WebKit nightly. Browser support continues to evolve and can be tracked here.
CSS Regions allow you to define content that can “flow” through a series of defined regions on the page, so you can create magazine-type layouts and responsive websites through simple CSS. I wrote about how you can use CSS Regions for creating responsive content in an earlier article. I’d definitely recommend reading that before continuing here if you haven’t already done so. It should give you a good basic understanding of how CSS Regions work.
Defining one piece of HTML markup as the source for another piece of markup is an extremely powerful, but very different way of thinking about Web page layout. You’re very likely going to want good authoring tools, and the ability to debug in-browser to figure what’s going on when your site behaves unexpectedly.
What we’ll describe here are some options for authoring and debugging Web layouts that use CSS Regions.
I explained a bit about compositing and blending in a previous post, how Canvas blending lets you achieve in a Canvas the same kinds of blending effects you’d find in Photoshop.
Updated – September 24, 2013:
Canvas Blending is also supported on Firefox and iOS7 Safari
Programmatically working with the blend mode is pretty straightforward. You just take your Canvas context and set the variable globalCompositeOperation:
var ctx = canvas.getContext('2d');
ctx.globalCompositeOperation = 'multiply';
If you’re viewing this post with Chrome and have turned on experimental Webkit features, or you’re running the latest stable version of Firefox or iOS7 Safari, you’ll be able to actually play with this feature below. Try experimenting with the blend mode and/or color and then drawing on the image.
Check out this Pen!
If the blending is not working for you above, check out this video:
Did you know that on Chrome you can specify complex clip paths for your content very easily using the clip-path CSS property?
With the standard clip property, you can specify a rectangular clipping area for absolutely positioned elements, as in:
clip: rect(5px, 100px, 100px, 5px);
If you ask me, that’s of pretty limited use.
With the clip-path property (-webkit-clip-path on Chrome) however, you can specify any of the following 4 basic shapes for clipping:
- rectangle(<top>, <left>, <width>, <height>, <rx>, <ry>) – rectangle with a top, left, width, height and optional rounded corner radii
- circle(<cx>, <cy>, <r>) – circle with a center and radius
- ellipse(<cx>, <cy>, <rx>, <ry>) – ellipse with a center and x and y radii
- polygon(<x1> <y1>, <x2> <y2>, …, <xn> <yn>) – polygon with a list of points
Say you have a black & white image and want to display it in many different 2-color schemes.
Or you could use the new duotone CSS custom filter I’ve built. You can find the source for the new filter on Github here. Continue reading
My last post talked about how you can create a Photoshop-like soft blur effect with built-in filters. As I started reading more about how you would actually create that soft blur effect in Photoshop though, I realized that often you don’t want the soft blur to apply to people’s faces. You want to apply a layer mask which essentially punches through the soft blur around the central subject’s face to reveal the crisp underlying photo on the bottom layer. Continue reading
I recently went over to the cnet.com site and was confronted with an ad that really surprised me. The whole home page itself became a set of curtains that parted to reveal an ad from IBM. The texture of the curtains themselves was the home page. Of course, this was faked out with Flash. If you look carefully the curtain texture isn’t exactly what was on the page, but it’s close enough that you don’t really notice. But then I thought, I bet I could do that easily with CSS Shaders, and with the actual content as texture to boot. Continue reading
I’ve created a video below as a detailed walkthrough of the Adobe CSS FilterLab, from installation, to configuring & developing custom shaders, to collaborating with others on filter development. Before FilterLab, I used to describe custom shader development as essentially ‘programming in the dark’. No debug statements, no tracing, no nothing. Now you can visually interact with your shader and see realtime errors. That’s a huge leap forward.
If you have any interest in CSS Custom Filters, using or developing them, I couldn’t recommend FilterLab more. Continue reading
I’ve been giving several talks lately, talking about the different CSS standards Adobe is involved with, and the contributions we’re making to WebKit. In order to make things easy, I had created a single web page with links to various demonstrations. But I wanted something subtle on the link page itself that used CSS shaders in a way that would raise an eyebrow or two, to make people realize something different was going on here. Continue reading
Anyone playing around with CSS Shaders has probably discovered very quickly how difficult it is to debug your shader. There are no debuggers, no breakpoints, not even a simple console.log. Fortunately, I’ve found a few simple things you can do to prevent you from ripping your hair out. Continue reading
CSS Shaders are a new and relatively easy way to bring cinematic effects to the web. You can find out all about them on the ADC, on the Adobe & HTML site or you can read the actual W3 draft proposal. While there are many articles out there showing how to use shaders, actually building your own custom shader is another story. That’s what we’re going to do here. Continue reading