Understanding SharePoint Styles

A little more on SharePoint Styles and the way CSS works.

I have tried several variations of style finders for SharePoint in the past. Most recently Todd Bleekers. These are great little tools that can tell you what class/id is being used.

Before you begin customizing however you should be aware of the basic cascading rule of style-sheets and the style-sheets which SharePoint (SPS and WSS) reference.

SharePoint references several style-sheets at any given time by default.

Windows SharePoint Services for example references the OWS.CSS style-sheet by default. If you apply a theme to your WSS site it then also makes a reference to the theme.css file. The theme.css file also appends several color.css files to it (To create that theme1011-109.css file in case anyone ever wondered what the heck it was). Not to mention your menu.css file which controls the drop-down menu styles like the modify shared page.

SharePoint Portal Server has the SPS.CS equivalent by default but you can create WSS sites under SPS so you also have an OWS.CSS. Then you have all the extras in there as well.

By now this should be putting things into perspective. At any time you can have several style-sheets referenced and this is where problems can arise:

These style-sheets contain several of the “same” selectors, ie: The class ms-yourclass could be in 2 or 3 different stylesheets, all of which may be referenced.

It is also possible that the same selectors may be duplicated within the ‘same style-sheet’.

The final thing to point out is that there are several selectors combined in the style-sheets if you change the properties for one you change them for them all.

Ok so why am I saying all this?

The reason I say this is it’s quite possible you will use this utlitly to locate and change a style only to find out it didn’t change and then (virtually) scream at Todd. Before you start screaming however you need to understand why it didn’t change.

This is where the basic cascading rules come into play.

Stylesheets are referenced and read in order. This means if you reference 2 style-sheets in your document the second one will take precedence over the first and over-ride any styles which were the same.

It also means if you have 2 of the same classes in this file the second one will over-ride the first. Then there are inline styles (styles put directly into the mark-up). Those take precedence over all others.

The biggest one is that you may have two of the same classes in two different style-sheets BUT there may be an extra property or two in one that’s not in the other.

There are other little things such as telling a property to be !important or using which can force precedence but that is not usually an issue within SharePoint styles.

So all that being said, if you change something and it doesn’t take maybe it’s referenced in another style-sheet.

These are a few things to take note of when using style-finders. Perhaps a future enhancement would be to display the stylesheets which the documents reference and in order as well.

Food for thought.

SharePoint Styles, Find them, Change Them

If you done much SharePoint customization you will have quickly realised there are a lot of classes and id’s which you can manipulate in order to change the look of your site.

Apart from that there are several stylesheets which SharePoint can use at any time. While the color.css files are appended to the theme.css in Windows SharePoint Services, there is also the OWS.CSS and in SharePoint Portal Server 2003 there is the SPS.CSS. Throw in a little inline-styling, double-referencing and combined selectors and you have your customization work really cut out for you.

Todd Bleeker has used the DOM to his benefit and conjured up some nifty Javascript that you can pop in a Content Editor Web Part. Once you have this one your page you can hover over elements on the page to see what classes, ID’s etc. are applied to them.

You can view Todd Bleekers Style Under Cursor Content Editor Web Part here.

Tim Hortons Trip Planner

I have just discovered my new best friend for when I am on the road. Normally whenever I hit a new town on a consulting gig, the order of business is A) Locate my hotel and B) Locate nearest Tim Hortons. The order of those tasks may vary depending on a number of items.

Normally I hit msn.com for all the directions to my hotel and then I blindly drive around till I hit a Tims. In Canada it usually doesn’t require more than 15 minutes driving to find one. However I think I have just found a better alternative.

The Tim Hortons website has a mapquest link that will not only provide you with directions for your trip but will also provide a listing of all Tim Hortons locations you will pass along the way. I love it when people put technology to good use.

Check out the Tim Hortons Trip Planner.

I was even able to map my way home from the office with it. Notice the 3 locations within the 5 minute drive.

Deployment and Customization Best Practices for Windows SharePoint Services

I first noticed this on Patricks site. This is a definate starting point for anyone delving into Windows SharePoint Services and customization.

Overview:

This document provides answers to some of the most frequently asked questions (FAQs) that IT professionals have about Windows SharePoint Services. The questions and answers will be of specific interest to system architects, implementers and operations staff who have deployed, are deploying or are evaluating the deployment of Windows SharePoint Services in a medium or large size organization.

Built on the Windows Server 2003 platform, Microsoft Windows SharePoint Services makes it easy for IT professionals to implement a dependable, scaleable infrastructure that enables teams to create Web sites for information sharing and document collaboration, using straightforward administrative tools and services. In addition to providing Information Workers more effective information sharing, collaboration and discoverability capabilities, Windows SharePoint Services, when deployed within business units and across organizations, benefits IT departments and administrators in the following ways:

• Reliable and scalable platform. Whether deployed on a single server supporting a small organization or in a large enterprise with tens of thousands of sites and thousands of users, Windows SharePoint Services provides a cost-effective, scaleable collaboration and information sharing solution, without compromising system reliability, security, or performance.

• Powerful administrative control and security. Windows SharePoint Services enables IT Professionals to establish a foundation that can help to reduce administration effort and total cost of ownership while providing exceptional support for present and future team and project collaboration needs.

• Better management and consolidation of corporate file shares. Storing files in Windows SharePoint Services document libraries provides many advantages over storing documents in network file servers. Windows SharePoint Services supplies Web sites with document storage and retrieval with check-in and check-out functionality, version history, custom metadata, and flexible, customizable views. Users can find and share data, with the added assurance that data will not be lost. Overall administration and associated operating costs are lowered.

• Easy to Extend and Integrate. Windows SharePoint Services provides IT professionals with a collaboration environment that is easy to extend and that can connect disparate applications, solutions, and systems into an integrated platform with less administrative time and effort.

• Rich Partner Ecosystem. Broad adoption of Windows SharePoint Services and the resulting demand for related applications and services has lead to the development of an active and growing SharePoint partner ecosystem including ISVs, system integrators, educators and publications.

• Rapid user adoption. Rich out-of-the-box functionality combined with Windows SharePoint Services integration with everyday tools such as web browsers, Microsoft Office applications, e-mail and instant messaging, enable users to quickly and easily begin using Windows SharePoint Services – reducing training needs, as well as helpdesk and IT support requests.

Get the best practices for deployment and customization of Windows SharePoint Services paper here.

The Beauty of SharePoint

Most of my posts are about SharePoint customization so I wanted to switch it up a little and write something slightly different but not too far off the beaten path.

I have read several posts/debates about the negative aspects of SharePoint Products and Technologies most of which dwell on things it was never expected to do.

The common theme that I have found in the negative critique has been an overwhelming lack of education or perhaps a misinterpretation of the product.

I have been heavily and exclusively involved with SharePoint Products and Technologies both Windows SharePoint Services 2.0 and SharePoint Portal Server 2003 for the past two years and want to share my own experiences with the product, positive ones.

The truth about SharePoint Products and Technologies

While it was meant to be utilized as a document management and collaboration platform it goes way above and beyond that.

In my opinion the single most important yet commonly overlooked strength of SharePoint is it’s diversity and flexibility as a building platform.

What I mean by that is it SharePoint offers a very extensible foundation from which to build solutions that will adapt to and grow with virtually any business process.

What it really boils down to is empowering the workers to manage (and create) dynamic websites, teams, projects and documents all from a single access point.

This sets off a chain reaction where fewer resources are required to perform tasks which once required a technical professional, and those extra resources can spend their time more efficently working on more complex tasks.

Ultimately this leads to the obvious goal of any organization, to reduce costs and resources by creating a more streamlined and productive environment. In other words – Do more with less.

The above only scratches the surface on some of the benefits of using SharePoint Products and Technologies. I didnt even touch on the re-usability of Web Parts, The Easy Website Creation/Maintenance or the ability to be customizaed to suit your corporate brand.

If I could try to sum it up into one tagline I think it would be “Making Technology Simple”. I think SharePoint has done a fantastic job of that.