Skip to content

Instantly share code, notes, and snippets.

@mparker17
Last active January 12, 2019 18:48
Show Gist options
  • Save mparker17/5363388 to your computer and use it in GitHub Desktop.
Save mparker17/5363388 to your computer and use it in GitHub Desktop.
My Photoshop to CSS conversion notes

This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 Canada License.

Template

Navigation menu item {
  font-family:   'ClarendonLTStd';
  font-variant:  'Regular';
  font-size:     16.41pt;
  font-leading:  39.59pt;
  font-kerning:  Metrics;
  font-tracking: -25;
  color:         #fff;
  font-style:    normal;
  font-weight:   normal;
  font-aa:       Strong;
}

Leading

A leading of Auto is equivalent to 1.2 or 120%.

Tracking / Letter spacing

Photoshop's letter-spacing property values are 1/1000em. Therefore, a letter-spacing of -25 in Photoshop corresponds with a letter-spacing of -0.025em.

Anti-aliasing

Photoshop's anti-aliasing property values are:

The CSS3 property font-smooth just turns anti-aliasing on or off. It's recommended to turn on for the whole document; but it won't translate nicely.

Webkit has a -webkit-font-smoothing property which does a bit better. It's values are:

  • none

    • turns off anti-aliasing
  • subpixel-antialiased

    • looks bolder, like Photoshop's "sharp" and "strong" (respectively)
  • antialiased

    • looks lighter, like Photoshop's "crisp" and "smooth"

    See http://maxvoltar.com/archive/-Webkit-font-smoothing for an example of all values.

Therefore, I'm recommending:

Photoshop settingCSS setting
`none``none`
`sharp``subpixel-antialiased`
`crisp``antialiased`
`strong``subpixel-antialiased`
`smooth``antialiased`

Gradients

Use http://www.colorzilla.com/gradient-editor/ to generate code for maximum compatibility.

Box Shadows

Use http://css3generator.com/ to generate code for maximum comaptibility.

Text Shadows

Use http://css3generator.com/ to generate code for maximum compatibility.

Border radius

Use http://css3generator.com/ to generate code for maximum compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment