Home

Awesome

Compass plugin to make it easier to work with Photoshop Drop Shadows. Allows you to take the values directly from the Photoshop style dialog and create an identical shadow in pure CSS. Works for Drop Shadow, Inner Shadow, Drop Shadows on text and has some basic support for Inner and Outer Glow.

Installation

Install the Ruby Gem.

gem install compass-photoshop-drop-shadow

Existing Compass Projects

You can include it in any existing Compass project by including the plugin in your config.rb file.

# Require any additional compass plugins here.
require 'compass-photoshop-drop-shadow'

New Compass Projects

You can install the plugin as part of a new Compass project.

compass create my_project -r compass-photoshop-drop-shadow

Usage

@import 'photoshop-drop-shadow';

Examples

// make sure the mixins are imported
@import 'photoshop-drop-shadow';

// Simple shadow
div.box-shadow {
  @include photoshop-drop-shadow(120, 5px, 0, 5px, rgba(#000, 0.75));
}

// Inner shadow
div.inner-box-shadow {
  @include photoshop-inner-shadow(120, 5px, 0, 5px, rgba(#000, 0.75));
}

// Supporting multiple shadows
div.multiple-box-shadow {
  @include box-shadow(
    photoshop-shadow(120, 5px, 0, 5px, rgba(#000, 0.75)),
    photoshop-shadow(120, 5px, 0, 5px, rgba(#000, 0.75), inset)
  );
}

// Text Shadow
h1 {
  // NOTE: $spread has no effect for text shadows
  @include photoshop-text-shadow(120, 5px, 0, 5px, rgba(#000, 0.75));
}

// Multiple Text Shadow
h2 {
  @include text-shadow(
    photoshop-text-shadow(120, 5px, 0, 5px, rgba(#000, 0.75)),
    photoshop-text-shadow(-60, 5px, 0, 5px, rgba(#300, 0.75))
  );
}

Variables

Functions

Mixins