Tao is a base theme for Drupal that is all about going with the flow. It is not meant for general-purpose use, but instead takes care of several tasks so that sub-themes can get on with their job:
- Aggressive resets of not only browser default styles but Drupal core defaults
- Unification of several template families into a single consistent format (e.g. node.tpl.php, block.tpl.php, etc.)
- Theme overrides of several core annoyances (fieldsets, pagers)
- On-screen print stylesheet display and framework for further customized print styling
Tao makes several assumptions about how you, the themer, would like to work with Drupal and the theme system:
- Minimize template overrides and leverage preprocessors as much as possible
- Preference for generalized styling over exceptions and particular design of one-off elements
- High degree of control over CSS, particularly selector specificity
Overview for subthemers
The following is a comprehensive list of things to know about Tao as a subthemer.
Alterations to core markup
Tao leaves most core element markup alone. When things don't make sense, however, it makes changes and aggressive ones at that. Here's a list of things to expect:
fieldsetelement in core has been retained but with additional markup for simpler theming. The
legendelement contains a sub-element
spanthat can be positioned properly across browsers and the main contents of the fieldset follow other object templates with a
To distinguish between different instances of the
.form-itemwrapper, Tao adds a
.form-item-labeledclass to labeled items and
.form-item-optionto checkboxes and radios.
All numeric page links are grouped together into a
ul.pager-listset. Next/previous links are grouped together under
All username instances are wrapped in an
Attributes and the
$vars['attr'] variable is the standard way for adding any HTML attribute
to the major containing element of the corresponding template. The
drupal_attributes($attr) is used in each template to render attributes. For
example, to add a class to a node, you would add the following to your
subtheme's node preprocessor:
$vars['attr']['class'] .= ' myclass';
CSS resets & removal
Tao implements an aggressive
reset.css but also strips out the inclusion of
many of the CSS files included in core with the exception of
tao.info for the specifics). Tao reimplements and
consolidates Drupal core CSS styles in a way that will not affect a
typographical or other strict grid in
drupal.css that can be overridden by
sub themes for even greater control.
Tao does not remove any contrib CSS added from other module directories, e.g.
Note: The main reason for the stripping of core CSS is to achieve consistent
typography and grid layout. Many styles in Drupal core add inconsistent
font-size adjustments to elements, making it
extremely costly to hunt down individual instances and correct them.
Tao allows a site's print stylesheets to be previewed by checking whether
$_GET['print'] is set. For example, to preview a node's print stylesheets, you
would go to
http://example.com/node/5?print. Other niceties related to print,
like support for full expansion of a book tree on print, has been added.
Say no to
Tao does not use the
all key for any of its stylesheets and expects that you
will not either. Be specific - if the stylesheet is for the screen, or for
print, say so. Any stylesheet overrides your subtheme provides should use the
same media key as the one in
tao.info for the stylesheet that is being
reset.cssprovides browser CSS style resets and core styling resets. Override this in your subtheme only if you need to add or omit certain reset styles.
- drupal.css` reimplements core CSS styles that are functionally important without allowing any modifications to a typographical or layout grid.
base.cssprovides very basic structural, non-aesthetic styling for many elements. See inline comments for more information.
print.cssis a default print stylesheet. Override this in your subtheme to alter print styling entirely.
All of the following theme functions go through the exact same template in Tao
(with the exception of
fieldset which go through slightly modified
versions for better usability and compatibility with contrib modules):
The template is designed to follow a strict pattern. Each element is classed as such:
with the name of its hook and then the type of wrapping element within the
template. For example, for a node, the following elements are provided:
.node-links etc. For comments, the
corresponding classes would be
.comment-links and so on.
The code for Tao is hosted on GitHub. Please report issues and submit patches/fork requests at http://github.com/developmentseed/tao. You can download packages of the latest release of Tao at http://code.developmentseed.org/tao.
- yhahn (Young Hahn)