Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixed header levels

...

Tapestry includes sophisticated support for CSS in the form of annotation-based linking, far-future expire headers, automatic duplicate removal, and other features provided for assets.

Default CSS Stylesheet

Tapestry includes a built-in stylesheet, default.css, in all HTML documents (documents that have an outer <html> element and a nested <head> element). The default.css stylesheet is always ordered first ... any additional stylesheets will come after. This allows you to override Tapestry's default styles with your own.

All the styles in the default stylesheet are prefixed with "t-" (for Tapestry).

Adding your own CSS

A page or component (for example, a layout component) that is rendering the <head> tag can add a stylesheet directly in the markup.

...

The "context:" prefix means that the remainder of the expansion is a path to a context asset, a resource in the web application root (src/main/webapp in your workspace).

Using the @Import Annotation

Another approach to adding a stylesheet is to include an @Import annotation (starting with Tapestry 5.2) on your component class:

...