Drupal 7 Theme System
Theme

http://drupal.org/project/themes
Theme from scratch
sites/default/themes/NAME

         NAME.info
name = My super theme
core = 7.x
engine = phptemplate
NAME.info
stylesheets[all][] = css/style.css
                                           all,
                                         print,
File                                  screen,
css/style.css                        projector
Webkit Inspector
       Firebug
IE Developers Toolbar
NAME.info
scripts[] = js/actions.js


File
js/actions.js
Regions
Name.info
regions[sidebar] = Sidebar
regions[ads_mini] = Small ads
regions[ads_big] = Big ads
                                            first,
                                sidebar second,
                                        content,
                                        header,
                                          footer,
                                    highlighted,
                                           help,
                                 page_bottom,
                                      page_top
NAME.info
settings[main_color] = 'orange'
theme-settings.php
theme_get_settings(VAR);
Templates
Overriding template files

          copy
Special template files
node--nodeid.tpl.php
node--type.tpl.php
node.tpl.php

block--module--delta.tpl.php
block--module.tpl.php
block--region.tpl.php

page.tpl.php
page--node.tpl.php
page--node--%.tpl.php
page--node--1.tpl.php
page--node--edit.tpl.php
page--front.tpl.php
                           http://drupal.org/node/1089656
Template function
theme(HOOK, ARGS[]);
      image
      item_list
      link
      links
      table
      username
      breadcrumb
      ...
Overriding template function
1. NAME_HOOK()
2. sites/default/themes/NAME/HOOK.tpl.php
3. theme_HOOK()
function mytheme_table($header, $rows, $args)
Preprocess functions
TEMPLATE_preprocess(&$variables, $hook)

TEMPLATE_preprocess_HOOK(&$variables)
Defining your own template
HOOK_theme()
Distributing content
Subtheme

http://drupal.org/node/225125

Drupal 7 Theme System