Your Interactive Tool Belt

Convert a PSD to CSS

Last updated on June 28, 2016

Export Kit takes PSD to CSS and CSS3 to another level with advanced Photoshop layer support to convert your PSD to CSS in minutes. You can convert both natural Photoshop designs to CSS or use our exclusive PSD to CSS Styles and Themes engine for total control when creating CSS style sheets from your Photoshop PSD.

You can use any PSD to convert your design to CSS. Export Kit supports both legacy IE6 and current CSS3 effects based on your Photoshop layer styles. Each style in your PSD will convert to individual CSS mappings based on the layer type, with all CSS effects included.

NOTE: There are many things to consider with PSD to CSS conversions as Photoshop and CSS do not render effects the same - learn more.

IMPORTANT: This tutorial covers a CSS only export, if you want to create a website the try our PSD to HTML tutorial.

Before You Begin

CSS has very specific rendering rules which you must follow when designing a PSD for CSS conversion. Your PSD layer names and ordering are key to correctly rendering valid CSS without visual errors. You should plan ahead if you are creating styles for a current Export Kit project, or classes for an external project.

Use Unique Names

The most important is your PSD layer order when converting your CSS styles. CSS will override any previously defined style – this means that if you do not use UNIQUE layer names, you may override a previous PSD layer in your CSS.

Photoshop vs HTML/CSS

Photoshop and HTML/CSS are not the same. Photoshop is a single-emulated environment – meaning you can only use Photoshop to view/use Photoshop. Where HTML is a multi-emulated environment – meaning any browser and device can render HTML any way it likes.

Export Kit Default CSS

Export Kit uses specific CSS content to allow your PSD design to convert pixel-perfect. In most situations, a current website will not use the same base CSS settings, and will likely have a custom CSS framework.

Example Export Kit Base CSS

Step 1: Working With Layers

Each Photoshop layer is processed differently with Export Kit to correctly render your PSD to valid and clean CSS. You PSD layer will convert with all available styles and effects based on your document settings. Each effect will process with support for all major browsers including IE.

Step 2: Working With Layer Effects

Layer Effects will enhance your Output with additional rendering features for use with PSD to CSS. You can add effects to any Photoshop layer element and Export Kit will render the effect directly in CSS.

NOTE: CSS3 DOES NOT support all Photoshop layer effects.

IMPORTANT: Depending on your effect and the angle, your element size may change to reflect the effect applied to the element - learn more.

Drop and Inner Shadow

Outer and Inner Glow

Glow Color

Opacity

Color Overlay

Fill Color

Opacity

Gradient Overlay

Gradient Colors

Opacity

Angle

Style

Stroke

Stroke Color

Size

Opacity

Step 3: Multiple CSS Files

Enable Page Tags with your output and you can extend CSS by creating multiple stylesheets in a single PSD file. You can store individual layer styles in a single page, eg. buttons.css or theme.css – containing only the required elements. This allows for a modular approach when creating your PSD to CSS styles.

Step 4: Responsive Media Queries

Use CSS Screen Tags to create unlimited media queries for any device size. Use unlimited target screens to personalize your responsive export. CSS will store the position and size of elements individually per target screen to render your design as-is.

Common Responsive Screen Sizes

You can cut and pates any of the following tags and use them as your responsive css folder group name. Each target screen will contain element properties based on the design for that screen.

${css|screen:160} Smartphone All

${css|screen:240} Smartphone Portrait

${css|screen:321} Smartphone Landscape

${css|screen:760} Tablet

${css|screen:768} iPad

${css|screen:1224} Desktop/Laptop

${css|screen:1824} Widescreen

Step 5: Custom CSS Styles

CSS classes in your PSD are applied directly to your Photoshop layer elements regardless of the layer type. This allows you to create global PSD to CSS styles that you can apply to any element in your HTML output.

Your ${css|styles} folder will contain all the custom CSS class styles to reuse in your document. All elements added to this folder will render as a CSS class in the output using the element name, styles and effects.

IMPORTANT: You can create very advanced CSS styles with Export Kit but it takes a full understanding of CSS or you can easily override a previous class (similar to real life).

Normal Usage

CSS is compiled in order – last in, last out. This means that you MUST add your custom styles at the TOP of your PSD document, otherwise the layer elements will maintain their layer effects/styles without change. This includes responsive designs, keep your CSS Styles at the very top of your layers.

Advanced Usage with Responsive

When using CSS Styles, it will create the styles AT THE POINT you place it in your design. We ask users to place the folder at the “top” of their design to avoid confusion. When you place your CSS Styles inside a screen folder, the next screen will NOT contain the previous styles – this is NOT a mistake. What you did was target the CSS Styles to render ONLY when the target screen is active.

You can further target specific styles to map only to an individual target screen by placing your CSS Styles folder inside the screen. Note that your global styles will likely OVERRIDE your screen styles if they are placed at the “top“.

Advanced Usage with Pages

Pages are similar to Screens where individual styles can reflect a single page only. Adding a CSS Styles folder to an individual CSS page will render the styles with that page only, but will also render the global styles.

Advanced Usage with Themes

You can target individual styles to only render under a parent element, this allows you to create multiple CSS styles for example; a content background, button background and image background in a single PSD file.