This document is a work in progress. It is evolving. Not every mentioned feature is fully implemented.


Cascading Style Sheets

The DOMBlogger CMS requires that all presentation semantics be described using Cascading Style Sheets (CSS) that are external to the HTML document and referenced in the document head.


Remote Style Sheets

There are some cases where you will need to reference a style sheet hosted on another server. In general this is a bad idea as you do not want your web site to depend upon a third party to properly render, there are times when it is necessary.

For example, if you wish to use a web font bureau that is not natively supported by DOMBlogger, you will need to tell the DOMBlogger the location of the remote CSS file the web font bureau wants you to use.


Remote CSS Management

In the “CSS” tab of the Admin interface, select “Remote” as the source for the CSS file and enter the remote URL into the interface.

After you click “Submit” you will be asked the context where you want the remote CSS file used (Globally, Layout Specific, Group Specific, File Specific).

Only users with full administrative privileges may specify a remote CSS file.


SSL Warning

DOMBlogger does not allow a resource to have two different domain names depending upon whether it is being served over HTTP or HTTPS. The path to the external resource must be identical regardless of the protocol being used.

The CMS also does not allow inclusion on insecure resources on a secure web page. If the remote source for your external style sheet does not provide the file over HTTPS as well as HTTP, the style sheet will not be loaded on pages DOMBlogger serves as SSL. This apparently is a problem with some Content Distribution Networks (such as the Amazon Cloudfront CDN with a CNAME URL).

If that is a problem for you, I am sorry, but a secure page has no business including resources from an insecure server. Browsers will often notify users of the problem, and users are right to shy away from secure pages that contain insecure resources.

A local CSS style sheet is a style sheet on the same server as your content.

In the DOMBlogger CSS, each web page can have up to four local custom CSS style sheets, although you should try to avoid having that many. If you have more than one style sheet you wish to apply to a context, they should be combined into a single style sheet to reduce the number of HTTP requests a client has to make.

The contexts of the four custom style sheets are described below:


Global CSS

You may define one custom style sheet that is global in nature. It will be served with every web page under control of the DOMBlogger Content Management System.

This is the file you use to define styles you want applied everywhere. For example, you can have this file automatically place smart quotes around the contents of a q node in the context of a p node:

p q:before {
 content: '\201C'; }
 p q:after {
 content: '\201D'; }

He said I do not know who took the cookie from the cookie jar but I knew it was him.

The CSS applies the quotation marks, they are not in the HTML source.

The Global CSS file is always loaded after any CSS files that are part of DOMBlogger itself and before any CSS files associated with the other contexts.


Layout CSS

There may be some cases where you need to apply over over-ride a style when a specific layout template is used.

For example, you may want to apply custom fonts to one specific layout but keep the default specified fonts for other layouts. This is done through a layout specific CSS file.

The Layout specific CSS is loaded after the Global CSS file.


Group CSS

You may have some styles you only want to apply to documents that fall into a certain grouping, such as blogs.

I recommend against using this, for site consistency purposes it is better not to have different styles apply to different groups of documents. You may however do so if you choose.

Any Group specific CSS files are loaded after any Layout specific CSS files.


Page CSS

Finally, you may have a CSS file you want to have applied to a specific web page. If defined, it will always be last CSS file applied to a web page.

In most cases, it is usually better to define page specific styles in your Global CSS file unless you are really sure you will not want to use the same style on a different web page.


Local CSS Management

To add your style sheets to the CMS, use the “CSS” tab in the admin interface.

For the Global CSS style sheet, you will only be able to upload a file replacing any existing Global CSS or edit an existing Global CSS file on-line using our very basic web based text editor (basically a textarea node).

Only users with full administrative privileges may modify or replace the Global CSS file.

For Layout, Group, and Page level CSS files, you also have the option of selecting an existing file to apply in a new context. For example, if you have a style sheet already applied to the “Condition” layout and you also want it applied to the “Yosemite” layout, you may choose that file from a drop down menu of existing Layout CSS files. This paragraph is confusing and needs to be rewritten.

Only users with full administrative privileges may modify or replace a Layout specific CSS file. Group or Page specific CSS files may be modified by lower level content providers if a user with full administrative privileges has authorized it.


File Caching

Browsers like to cache CSS files, and usually that is a good thing. It reduces traffic to your web site and hastens page load.

Unfortunately sometimes when changes are made to a web site, the web site looks funny if it is using a cached version of a style sheet. To mitigate this issue, DOMBlogger uses a serial number as part of every CSS filename.

The serial number is not actually part of the CSS file name as it sits on the server, but the web browser does not know that. When you update a CSS file, the serial number changes. Any pages that reference that style sheet will now reference the style sheet with a new serial number. Web browser that request those pages will download the new version of the style sheet

We can thus tell browsers they can cache the style sheets until the sun goes red giant if they want.

The serial number we use is the UNIX timestamp of the CSS file.

[Follow Me On Twitter]