Canddi

Using Photoshop CC’s new CSS Workflow

Photoshop’s Copy CSS command can transfer styling information from a design into a web project’s stylesheet. It is useful for passing on the appearance of a shape or text layer, but it does not build a complete responsive page for you. This guide updates the workflow originally introduced here in 2013.

Design a simple content panel

Start with a shape layer and give it an identifiable name such as bluebox. Add a fill, rounded corners, a border and a drop shadow. Keep a layered PSD so that you can adjust the design later.

The original exercise used a 15-pixel corner radius and a shadow with a 135-degree angle, 60% opacity, 13-pixel distance and 10-pixel size. Treat those as practice settings, not a recipe that every web panel needs. Use a border thickness and colour that suit your own design, and compare the result at the intended display size.

Concept panel mapping rounded corners to border-radius, border to border, and shadow to box-shadow; HTML, spacing and responsive testing remain necessary.
A concept reference for shape styling and CSS properties. This is not a Photoshop interface capture or an exact rendering of the original bluebox settings.

Copy the layer’s CSS

  1. Select the shape layer in the Layers panel.
  2. Right-click it and choose Copy CSS, or use Copy CSS from the Layers panel menu.
  3. Paste the result into your web project’s stylesheet and inspect the generated selector and declarations.

Adobe documents support for shape layers, text layers and suitable layer groups. To process several layers together, group them first. Copy CSS does not work directly on a Smart Object; open its contents and work with suitable layers inside it. See Adobe’s current Copy CSS guidance for supported properties and limitations.

Connect the stylesheet to real HTML

Create an HTML element for the content and give it the class used by your CSS selector. For example, a CSS selector of .bluebox matches an element with class="bluebox". Check the selector that was actually copied; do not assume the layer name and output will always need no cleanup.

A minimal HTML container could be:

<div class="bluebox">
  <p>Your panel content.</p>
</div>

Put the CSS rules in the stylesheet used by that page. If you are creating a standalone practice page, link the stylesheet from the document’s head. Pasting raw CSS into the visible body of an HTML document will not apply it as a stylesheet. Dreamweaver or another code editor can be used for this step.

Review appearance and layout separately

Keep useful appearance rules, then review any copied dimensions and positioning against the needs of the page. A fixed design-canvas position is not necessarily the right position inside a flexible web layout.

  • Content space: provide enough padding for the text and test with longer content.
  • Responsive sizing: test a narrow viewport as well as a wide one; avoid a panel width that forces horizontal scrolling.
  • Typography: confirm the intended font is available to the browser and that text remains readable.
  • Shadow: compare the browser result with the design. CSS box-shadow uses offsets and blur values; do not paste Photoshop’s angle and distance into unrelated CSS positions.

MDN’s box-shadow reference explains those values. Save the page, reload it in a browser and inspect the panel in context before handing it over.

If selecting the right source layer is slowing you down, our Photoshop layer-selection guide can help.

Build this skill: Photoshop for design

Explore Academy Class Photoshop courses, or tell us about your design-to-web workflow so we can discuss relevant training.