Right now, typogrify is adding the span tags to the html that drupal outputs, but it's not loading a css file to show off typographic refinements yet. CSS should probably be informed by the example page, here http://static.mintchaos.com/projects/typogrify/

Comments

Tim Gambell’s picture

How to properly add CSS files: http://www.lullabot.com/articles/how_to_properly_add_css_files

<?php
// Modules should do:
drupal_set_html_head(theme('stylesheet_import', base_path() . drupal_get_path('module', 'mymodule') .'/mymodule.css'));
?>
Tim Gambell’s picture

Here is the CSS from the typogrify examples page:

<style type="text/css" media="screen">
  body {padding: 18px 45px; }
  #page {width: 550px; }
  h2 {font-family:georgia; font-weight:normal; }
  .caps {font-size:.92em;}
  .amp {color:#666; font-size:1.05em;font-family:"Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua",serif; font-style:italic;}    
  .dquo {margin-left:-.38em;}
  div.about {background:#ddd; padding:1em; margin-bottom:1em;}
  .about h1 {font-size:1.3em; border-bottom:1px solid #bbb; margin:0 0 4px 0; padding:0 0 4px 0; line-height:1;}
  .about p {margin:0;}
</style>

Typogrify.module's CSS file should look good in Garland. People using other themes should roll their own custom CSS rules using the typogrify CSS selectors. How will this look in the Garland theme?

Tim Gambell’s picture

Status: Active » Needs review

Added CSS. Please review code or install and test.

Does it work?
Does it break anything?
Can't seem to get the theme function to import a stylesheet correctly. Currently using a hack. Any thoughts?

Code is available on CVS now, and should be available from the project page when the packaging script gets around to it, sometime tomorrow (July 10, 2007).

Tim Gambell’s picture

Status: Needs review » Needs work

A bug in this implementation (the one I was referring to when I said "Currently using a hack.") has been filed at http://drupal.org/node/159961

Tim Gambell’s picture

As noted at http://drupal.org/node/159961 it looks like the correct way for a module to add css is to say:

drupal_add_css(drupal_get_path('module', 'typogrify'). '/typogrify.css', 'module', 'all', TRUE);

See http://api.drupal.org/api/HEAD/function/drupal_add_css for reference. Will implement asap.

We should allow people to turn this stylesheet off from the admin interface (but it should default to on).

Tim Gambell’s picture

Status: Needs work » Needs review

Patched. Let me know how this works for you.

Tim Gambell’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)