Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

Web designers rejoice! Adobe releases HTML5 pack for Illustrator CS5

If you use Illustrator for web design, and if you consider yourself on the cutting edge of web design, life just got a whole lot more interesting. Adobe has just released an HTML5 Pack for Illustrator CS5 that introduces some advanced SVG support, support for the HTML Canvas tag, and support for export to CSS3.

Adobe released the Adobe Illustrator CS5 HTML5 Pack as a technology preview on Adobe Labs (you can get it here) so it isn't a full-blown solution -- it actually takes a bit of grunt work to get it installed. Then again, HTML5 and CSS3 aren't anywhere near complete or fully supported across all browsers, either. Consider this a peek into the future, and a GREAT way to experiment on your own, and live on the blistering edge of web design and development.

So what exactly does the Illustrator CS5 HTML5 Pack bring to the table? Here's a quick overview:

Parameterized SVG
You can designate certain attributes (i.e., fill, stroke, opacity) as variables right from the Appearance panel in Illustrator. When saved as SVG, developers can easily change the variable definition to "reskin" or modify the art. You can even create global variables.

Multi-screen SVG
You can create multiple artboards in Illustrator at various sizes, for example to design art for different screen sizes. You might do this to create different designs for mobile, tablet, and desktop versions of a design for example. You can then save your file as SVG and include all the different artboards. Illustrator creates an HTML file and a CSS file, along with separate SVG files for each artboard. The CSS uses media queries to detect the screen size and automatically serves up the correct SVG image. 

Mark objects as canvas in SVG
You can select an object on the Illustrator artboard and then choose Object > HTML5 Canvas > Make. These elements are rasterized and included as canvas elements when saved as SVG, giving developers the ability to control the elements via JavaScript.

Export named character styles as CSS
You can define character styles in your Illustrator document, and then export those character styles as a valid CSS file. You can do this directly from the Character Styles panel.

Export artwork appearances as CSS
You can select an object in Illustrator and export valid CSS directly from the Appearance panel. Of course, if you mockup an entire page in Illustrator, you can simply select all of it and export it to a single CSS file. IDs are picked up from the Layers panel (so you want to name artwork carefully), and Illustrator can export Fill, Stroke, Opacity, and Absolute Position and Dimensions.

Include selected Graphic Styles as CSS in SVG
You can select styles from the Graphic Styles panel and choose to have them exported when you save your file as SVG. What's really cool is that you can include styles even if they aren't applied to your artwork. This would allow you to deliver multiple styles to a developer within a single SVG, and even programmatically swap styles.

Where can I learn more?
So according to the double rainbow guy, what does all of this mean? At the very least, it's a peek into the future. With our continued feedback to Adobe, we're sure to see more robust tools coming to Illustrator and other great applications. Adobe released a similar HTML5 Pack for Dreamweaver a while back, and recently, Adobe actually rolled those features into Dreamweaver CS5 proper with a recent update. One can assume that something similar will follow here as well.

You can get all of the details on the Adobe Illustrator CS5 HTML5 Pack on the Adobe Labs webpage, and you can find a press release from Adobe here. You can also participate in the dedicated discussion forum here.

Of course, if you're a web designer who needs to brush up on some Illustrator skills, my Illustrator CS5 Essential Training course at Lynda.com or my Real World Illustrator CS5 book should cover the basis. To add to all of this excitement, my latest Lynda.com title, Illustrator CS5 for Web and Interactive Design is going live later this month (9/27).

If you'd like more information on HTML5, check out James Williamson's excellent HTML5 First Look title at Lynda.com as well.

Got questions? Let's talk! Leave a comment or send me an email.

Simulating the CSS Box Model in Illustrator

Illustrator is a great tool for mocking up websites. In Illustrator CS5, Adobe added an Align to Pixel feature that ensures crisp antialiasing, and in a recent episode of Fridays with Mordy, we spoke about using Illustrator for various web design projects.

When designing for the web -- specifically for sites that will be built with CSS -- it's a good idea to get into the right mindset, so that you can easily translate what you create in Illustrator into code later on. In a previous post, I spoke about limited CSS export from Illustrator, but today, I'd like to share a way that you can simulate the CSS box model in Illustrator, which will ultimately help you create better design mockups.


Before you get started, I would suggest that you first activate the Use Preview Bounds preference setting in Illustrator, as this will ensure that the values you see in the Transform panel are accurate (by default, values are only of the vector path itself). In addition, it will also ensure that you can use the Align functions in Illustrator and get the results you want.

  1. Start by using the Rectangle tool to create a shape. For web design, I rarely eyeball it, and choose to click once with the tool on the artboard. This brings up the Rectangle dialog box where you can specify the exact width of your rectangle. As we'll see, the length isn't important right now.
  2. Select the Type tool and click anywhere along the path of the rectangle to convert it to an Area Text object. When you see the text cursor blinking, you can add some text. 
  3. At this point, we have a regular box that contains text within. However, we often don't want the text to come right up to the edge of the text frame, which we can control with the Inset command in Illustrator. In CSS, we refer to this as Padding. With the Rectangle selected, choose Type > Area Type Options. In the Offset section, specify a padding setting by modifying the Inset value, and click OK.
  4. When positioning boxes with CSS, you can also specify an attribute called Margin. To simulate this value, do the following: With the text frame selected, click the Add New Fill button in the Appearance panel. Apply a color to the fill and then drag the fill so that it appears beneath the Characters in the Appearance panel. With the fill still targeted, choose Effect > Convert to Shape > Rectangle. You'll want to work with the Relative values, and choose both Width and Height values to simulate the margin attribute. Click OK.

It's important to realize that margins can be set independently on all sides of the box, and here, we've only been able to specify extra width and height, and these values are distributed evenly. In other words, if you specified a margin width of 20px, then you'd see 20px added to either side of your box. What if you only wanted 20px on one side, but not the other? Well, first, you'd specify an extra width of just 10px, and then, with the same fill still targeted, choose Effect > Distort & Transform > Transform. In the Move section of the Transform Effect dialog box, specify a Horizontal value of 10px and click OK.

(Click image to enlarge)

Since we're working with an Area Text object, you can use the Selection tool to simply adjust the height of the frame to match the amount of text you have. Here is some more information on scaling Area Text frames in Illustrator.

If you use Character and Paragraph styles to simulate CSS for styling the text, you can take this to the next level. What would be really cool is if Illustrator could be able to export all of this as a CSS stylesheet. But for now, at least, you have a better way to visualize how you might build your mockup with CSS.

Illustrator and Dreamweaver Integration

As a core graphics program, Illustrator is used in just about every type of design workflow. Of all the applications found in Adobe Creative Suite (every edition), Illustrator has the most robust support when it comes to integration and file support. Illustrator is much like a universal bottle opener, supporting formats like AI, PDF, EPS, FXG, SVG, SWF, PSD, TIF, DXF, DWG, EMF, WMF, and just about any other 3-letter extension you can think of. When it comes to working with other applications, Illustrator has direct support with major applications like Photoshop, InDesign, Flash, Flash Catalyst, Fireworks, Acrobat, After Effects, Premiere Pro, and heck, even Flex (Illustrator can create Flex skins).

A closer look at that list reveals a gaping hole... Dreamweaver. One of the big features added to the CS4 version of Dreamweaver was support for Smart Objects, or the ability to place native Photoshop files directly into a Dreamweaver layout. Oddly, native Illustrator support is missing from that feature, leaving Illustrator users to find other ways to get graphics into their layouts.



Adobe's now-defunct GoLive did have its limitations, but support for native Illustrator files wasn't one of them. But all is not lost, as there are still a variety of ways to use both Illustrator and Dreamweaver hand in hand. In this article, I present two ways to do so.

CREATING CSS LAYOUTS WITH ILLUSTRATOR
If you're paying attention to anything that's going on in the world of web design, you know that web standards, such as CSS-based layouts, are all the rage. And for good reason. The limitation of table-based layouts become immediately apparent when you consider that the web browser as we know it is fading from view, and we are accessing web content on all types of screens and devices. That being said, there are all types of layouts that work for various tasks. At times, I can quickly visualize in my mind where I want to go -- and others require a bit more work. I like to sketch out my layouts in Illustrator as it's so easy to make changes and experiment with ideas.

I use regular rectangles with different fill colors and NO STROKES to indicate the regions in my layout. These regions will eventually become DIVs in my CSS layout. I use no strokes to avoid any possible antialiasing issues. I use the Transform panel to quickly and precisely adjust the sizes and position of the rectangles. I then select my rectangles and choose Object > Slice > Make to convert all of my rectangles to slices.

You may stop me there and cry "Hey Mordy! Slices create HTML tables! Why would you want to do that?" And the answer is quite simple. Illustrator has a feature called Save for Web & Devices. Not many people realize that this feature was once a full-blown separate application called ImageReady (oh, the memories). As such, Save for Web & Devices has a lot of "hidden" functionality that you have to dig for. One of those hidden gems is CSS support.



Once my slices are created, I choose File > Save for Web & Devices. I don't care about what file format to use for the images, because I won't use the images at all -- all I want is for Illustrator to use the slices I created to generate CSS DIV tags for layout. If you double-click on any slice with the Slice Select tool in the Save for Web & Devices dialog, you can assign a name to each slice -- a name which will eventually become the DIV ID for that region. Click Save and then from the Save Optimized As dialog box, choose "HTML Only" for the Format and from the Settings popup menu, choose "Other...".



Now the fun begins. You're now accessing tons of settings that once belonged to the full-blown ImageReady application. In the HTML panel, check the "Output XHTML" button, then switch to the Slices tab. For the Slice Output method, choose Generate CSS. Click OK, and then Click Save to create your HTML file. Opening the resulting HTML file in Dreamweaver will reveal a layout with all of your regions set up as AP DIVs (Absolute Position DIVs), giving you a head start on your layout. At this point, you can simply drop images or graphics into any of your DIVs. If only you could drop native AI files right into those DIVs...

ILLUSTRATOR SMART OBJECTS IN DREAMWEAVER
OK, denial has run its course and I've now entered the acceptance phase. Dreamweaver snubbed us and doesn't support Illustrator Smart Objects -- Dreamweaver and Photoshop are obviously having a big party and Illustrator wasn't invited (I'm sure the invite just got lost in the mail or got caught in a spam filter somewhere). But that's OK, because Illustrator can sneak into the party anyway. Sure, DW doesn't support AI smart objects. But PS does. SCORE.

Place your Illustrator art into Photoshop as a smart object, and then place the PSD into your Dreamweaver layout. Want to edit the file? Click the Edit button in Dreamweaver to open the PSD in Photoshop. Then double click the Vector Smart Object in Photoshop to open the file in Illustrator. Make the required edits and save the Illustrator file. Save the Photoshop file. Return to Dreamweaver, and everything updates. SWEET. It's like Photoshop is a revolving door. Wham bam thank you ma'am -- you've just been served. It may sound like a lot of extra steps, but in reality, it's just one more double-click than a standard Photoshop smart object.

In closing, by using Illustrator in this way, you have the benefit of using Illustrator art in pixel form via Photoshop (GIF/JPG/PNG), while you can still dump the art into Flash or Flash Catalyst for vector art (SWF). If you'd like to see more support for Illustrator in future versions of Dreamweaver, please speak up and leave a comment here. I'd love to send the folks on the Dreamweaver team a few wishes for what I'd like to see in the new year :)

Making Illustrator and Fireworks Fit

Me love Illustrator long time. I use it for many many things, including web design. I even have an entire video training title dedicated to creating pixel-based graphics with Illustrator.

At the same time, I have always been aware of another application called Fireworks, which admittedly, I've ignored somewhat. Ok, so that isn't really fair. When it was originally released, Fireworks was touted as a crossover application -- it was like one of those vanilla and chocolate swirl soft ice cream cones (yum) -- handling both vector- and pixel-based graphics. Back then, I can't say that I was doing enough web design to care, especially considering that back then, it was also easy enough to use Photoshop and ImageReady (remember that sweet app?) to handle my needs. Fireworks also lacked a sophisticated user interface or advanced text features. I also had trouble adjusting to the drawing tools, again, coming from an Illustrator perspective.



When Adobe and Macromedia merged and Creative Suite 3 was released, there was no FreeHand, but there was a Fireworks and there was an Illustrator. I took another look at Fireworks, considering that I was now doing much more web work. There was some cool stuff to find in Fireworks, but the barriers were still there.

A few months back, Adobe released public betas of some of the CS4 products -- and Fireworks CS4 was included in that. Since then, I've played a lot with Fireworks. Now, with the rest of the CS4 apps on the horizon, I thought it might be a good time to take a closer look at what Fireworks has to offer.

For the first time since I've looked at Fireworks, I can say that I now "get it". I grok FW. Especially when you consider not only the kind of work I do on a daily basis that involves web graphics, but when you also consider that it isn't just about graphics anymore. Web 2.0 standards have given reason for designers to think carefully about how they create content. And it isn't just web stuff either. Designers also work on user experiences and other interactive elements.

First, let's take a look at some of the stuff that Adobe packed into Fireworks CS4:

- A new user interface. If you haven't already seen it, you should take a look at the new user interface in Fireworks CS4. Why? Because it's the new user interface that Adobe has integrated across all CS4 applications. With this new interface, I now feel comfortable in Fireworks. Yeah, it's a small thing, but sometimes these small things mean a lot.

- The Adobe Text Engine. Illustrator, Photoshop, and After Effects all share the same underlying text engine code. Now, Fireworks joins the party, making it possible to move text easily between these Adobe apps.

- PDF Export. It's now easy to create a PDF of your design to send off to a client for review. Sending JPEG files were always a pain, especially for multiple-page designs. Uploading content to a server meant clients couldn't access or review content off-line (or required logins, etc).

These items have certainly removed the barrier -- I can now find my way around Fireworks and using it isn't the frustrating experience it once was. But I'll admit that I was still wondering why I would want to do all my work in Fireworks when I was able to accomplish just about the same stuff in my far more comfortable environment of Illustrator. After all, I could crank stuff out MUCH faster from AI than I ever could in FW. The lightbulb went on when I began to understand the significance of some of the other features that are new in Fireworks CS4:

- CSS and Images Export. As I understand more and more about how the web works, and what Web 2.0 really means, I have come to understand the importance of CSS. One of the key concepts of CSS is being able to understand that content and structure are two very different things (traditional designers always combine the two). To contrast, when you draw a rectangle in Illustrator, you get an image on export. Draw that same rectangle in Fireworks and on export, you get a "div". Even more amazing, Fireworks can even write CSS for auto-expanding elements that stretch to fit content. With Illustrator, I'd design something, slice it into bits and then try my hand at coding it in Dreamweaver. In FW, it just happens. This is SIGNIFICANT. One could argue that Illustrator should have such functionality built in. I for one would love to see it. But at the same time, Fireworks CS4 has it, and I LOVE it. Now I can design stuff and have the code written for me. Isn't that the way it was always supposed to be?

- AIR Authoring. OK, I can hear you all snickering now. Mordy has gone off the deep end. AIR authoring is for developers, not designers. Why would a designer even THINK about writing an AIR application? And the answer is, never. For the same reason as I stated above. Because Fireworks just does it for you. It's literally a mouse click. And so you ask why you'd ever want to create an AIR app. And the answer is that Fireworks has the ability to build interaction into a design. I'm not talking about Flash animation stuff -- I'm talking about building a prototype. Maybe it's a 4 page website. You want your client to see a design mockup and you want it to WORK so that when they click on the buttons, the pages turn, etc. You want rollovers to work. Well, Fireworks was always able to do that. And now, when you need to show the client a comp, you create an AIR app and send it to them. AIR apps run right on the desktop. No need for a browser. No need for an internet connection. Mac, Windows, it's all good. And the comp WORKS. Again, it would be totally awesome if Illustrator could do something like that. But it can't even come close. And FW not only does it, it does it really well.

OK, so after all this, I'll admit I was still not totally sold on Fireworks. After all, I need to repurpose my art all the time. When you're in Illustrator, you can go to the web, to print, to video, and practically to ANY app with no barriers. Fireworks is a one-trick pony -- it's great for designing something specifically for the web, but what do I do if I need to move something into InDesign? Besides, I'm too reliant upon Illustrator.

Well, two things have since caught my eye.

1. Fireworks now does a really awesome job on importing art from Illustrator. In fact, you can use Fireworks CS4 to open native Illustrator files directly. Layers are maintained, text is completely compatible. It's awesome. Basically, I can create my initial designs in Illustrator and bring them right into Fireworks when I'm ready to take it to the next step. So my initial problem of not being comfortable with the drawing environment is a non-issue. I can create art in AI and bring it into FW as needed.

2. Speaking of the drawing environment, Fireworks DOES have some really sweet drawing tools, which are LIVE editing tools. Unlike Illustrator, where once you let go of an object, it becomes a static path, objects created in Fireworks are editable. For example, you can click and drag on a star to change the number of points. You can draw arrows and adjust them as needed, at any time. What a concept. WHY Illustrator can't do this is beyond comprehension, but I have found inner peace. Fireworks has a command in the Edit menu called Copy as Vectors. And wouldn't you know, you can move content from FW right into AI. Of course, the object isn't live once it gets to AI, but it's just as easy to readjust in FW and repaste it into AI again. Go figure -- now I'm using FW to create art that I'm using in Illustrator!

At the end of the day, even beyond the anti-aliasing issues that Illustrator has, I've found reasons to look to Fireworks. Especially when working on designs that require Web 2.0 compatibility. Hopefully, this post will be helpful to those who find that they are at the limits of what Illustrator can do in regard to web and interactive design. If you haven't looked at Fireworks CS4 yet, it's worth heading over to Adobe Labs for a look. At the very least, you'll get some experience with the new CS4 user interface. At the very best, you'll have found a new application in your design tool box.

Got additional comments about Illustrator or Fireworks? Discussion is ALWAYS encouraged!
Blogger Tips and TricksLatest Tips And TricksBlogger Tricks