Please subscribe to watch this video
Daniel Walter Scott || VIDEO: 40 of 45
Hi there, in this video we're going to look at exporting some of the code from Illustrator. Oh, code!
If you've never used code before, and this is something that will be really helpful for the person building your site. If you're going to be building your site, this is going to be super helpful for you.
So, what we'll do is we'll look at the different elements, we'll do a couple of them but the rules are the same for lots of it. So, what we're going to do is we'll start at this heading because it's the biggest and easiest, so with it selected, go to 'Window', and let's go to 'CSS Properties', and the cool thing about this is that it's going to tell us lots of the CSS characters, so I'm going to drag this 'Property' panel out by just-- Can you see here, I just kind of grabbed the top of the tab, the word there, so I can see it all.
What it's going to tell me is, it's going to tell me interesting stuff about this font, it's going to tell me what font family it is, whether it's bold, what size it is, the color it is, this is the kind of stuff that a web designer would love, because instead of you just giving them that PDF that we made earlier, and saying, "Guess the font, guess the size, guess the color," and they'll come back to-- Say they're building this site for you, and you're like, "What font was that? Who uses Comic Sans?" And they've used regular instead of bold, and all of the stuff you spent up ages trying to work out, "You know, it's going to be 80 pixels, or 81 pixels." You can actually tell them.
So what you can do is, you can grab them, copy them, and start building up a kind of a spec sheet. So you can say, 'Desktop', and this one here is going to be my, this is going to be my-- I know it's going to be called 'h1', but you might just call it something like 'Heading'. And delete anything you don't like in there, or adjust it, but this is going to be my main heading. If you’re a web designer you'll know a few, you’ll be able to give it things like class names, or tag names, but it's up to you really.
The cool thing about it is I'll have a desktop version, and what I'll do is I'll have a mobile version as well, of the exact same thing, but over here, when I select it, can you see, it is the different font sizes, got everything here, great. Mobile, it's going to be this. So the exact same, so he knows that this is my 'Heading1', my main heading, and the difference is still 'Playfair', still 'Bold', but it's this size now.
One thing to be aware of, it's given me lots of the information, but in Illustrator here, you can see it's not given me the text line, so there's bits and pieces that it doesn't give you. It's great, it's awesome, it's missing a couple of little things, annoying, but that's okay. It saves the day for lots of-- having to kind of pass things over to the developer, or just for yourself. I use this all the time myself. I’ll fiddle around with the fonts in here, and then just come in and check. I won't probably build a document like this for myself, I'll probably just work step by step as I'm building the site to come into Illustrator and just pull it out, but if you are sending it to somebody else--
One other thing, say this box down here, you wouldn't export that as a graphic, this kind of peachy box here, you wouldn't export it as a PNG graphic, it will be designed in code, and css, and would give it it's height and width in color. So you can certainly select those, so there's no css generated, you're going to give them names for some reason. So you could do the long version, and go into your 'Layers' panel, twirl down your layers, and what happens is, we've only got two layers right, but within those layers all those objects are listed out, and what you can do, with it selected over here, can you see this little search icon, it jumps down to this thing called a rectangle. Let's give him a name, instead of rectangle we can call him 'call-to-action'. We can't use spaces. 'call-to-action', I'm making them up with hyphens, and now it will give me a class name called 'call-to-action', and the actual color for it.
I don't like doing it that way, I like doing it-- Main thing, your classes in here, it's cool if you kind of know what you're doing, but I don't find it super helpful. Let's say it's this box here, and again, it's not going to give me my name until I go off and find it and give it a name, it's easier actually to just go into your settings at the bottom of ‘Generate CSS’, oops, not that one, the one that says 'Export Options', that's it, the first icon. And there's this one here that says 'Generate CSS for Unnamed Objects'. Let’s just call that 'st0', and I'm going to copy this, and I'm going to pop this into my document, and, on desktop, because it's going to be my-- I don't know what I'm going to call it. Cool, it's nothing. 'Black-Box', okay. And I'm going to name it in here. Awesome!
It's missing a few things though, like, I quite often need the height and width, but I've decided in here, so there's a few options in this first kind of 'Export' options again that I like to include, this one that says 'Include Dimensions', so I'm going to do that. And it’s included pixel dimensions there as well, just give it a height and width, I find that's quite helpful.
All right, and you now just work around your document, and tell people how big things are. You can grab this green box in the background, give him the height and width, in pixels. I'll have to unlock this layer here, so I know that this guy is a background width, it's mainly the height that I want to deal with, I want to make sure I got it at the right height, and same with these buttons up the top, the right colors, and the height and width that I'm using, this logo. I could tell them the height and the width that I wanted.
Just really quite helpful to pull the css out for yourself, or if you're going to build it next, and that's what we will do in one of my next tutorial after this one, we'll go and build this in Dreamweaver, but if you're working with a web developer or web designer, you can just hand them off a kind of a spec sheet to give them a rough kind of gauge. You don't have to list out every single thing, and every single bit of margin, but it could be really helpful.
All right, that's how to export the css from Illustrator, to work with your website.