Smart Monday: Modifiying CSS

Today I read a post in Pearsonified about how to modify your wordpress CSS stylesheet. I would like to talk about it with a  much wider approach, based on my experience with Sharepoint Portal Server 2003.

Sometimes, as a web developer you have to work with CSS stylesheets handed by some other web developer, or the guy that was previously in your seat doing what you are doing now. Sometimes they have done an amazing job, sometimes you just thank god you never met the poor devolved b*st*rd.

This is how the post I mentioned above says you should work, which is also how I’ve been working with Sharepoint: Don’t modify the current stylesheet, add a new one with the modified styles. If you can’t add a new reference (say you don’t have access to modify html code) add the new styles at the bottom of the current stylesheet with a HUGE comment indicating that it is your modification.

What I do is: Find what you want to chnge in the HTML code. Look into it and find out what styles are applied to it. Find the style in the stylesheet and copy it. Paste it along with all the modifications and start messing with it.

The reasons:

  1. Say you need to keep track of these changes, having all of them in one place is the best way to do so.
  2. If you make a change and all of the sudden everything goes upside down, you can always just remove the last change, or remove all your changes with one press of *delete*.
  3. If there is no “template” for the pages then you will *only* have to add the references to each page to make them all look the same.
Advertisements

Leave a comment

Filed under CSS, development, microsoft, sharepoint

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s