Using stylesheets in feeds: issues, approaches, interest, and discussion.

Structure vs. Presentation

Structure vs. Presentation is a permathread and, for the most part, irrelevant to the discussion as the users who desire more presentational control will get that feature implemented somewhere and somehow regardless of all the hand waving from either side of the issue. :-)

There are certain limitations in feed consumers that are different from browsers, however, and producers do not have the range of control available on their own site.



CSS is the most commonly discussed styling approach for use in feeds. CSS is used widely with HTML and some other formats (SVG, most notably).

CSS was designed with a "document" in mind, applying "the same CSS stylesheet" to an entire "document". In an HTML document, the stylesheet would be contained in or linked from the <head> element of the document and elements within the document would be generally (by element name) or specifically (by class or id) styled according to the stylesheet.

CSS styles can also be applied on a per-element basis within the document using the @style attribute of an element.

In most feed consumers, the concept of the "document", or HTML page, is different than for the feed producer's website. In all cases, the feed consumer takes elements from the feed (title, author, link, dates, etc.) and creates an "entry" surrounding the body (content) and then displays them together. Some consumers will do this individually, with just one entry from the feed, or in groups, either with entries from the same feed or with entries from different feeds.

CSS does not have the ability to "scope" styles, so for multiple items to be displayed from multiple sources, the CSS stylesheets must be "merged" in some manner or extracted from stylesheets and transferred to individual elements for display.

Style Attributes

[WWW]Style Attributes provide a method to use CSS syntax in HTML to denote styles without using a full Stylesheet.