Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How are you handling font sizing with Sharepoint? Just curious on how things are working out. We seem to have a mix of px, pt, and em scattered everywhere among our CSS. I'm trying to clean things up, but it seems like EM might not be the best route with how convoluted sharepoint's CSS structure is.

I mean, put a base font size is good practice, but sharepoint and the seemingly thousands of containers, I don't know if EMs is the way to go.

Thoughts?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

It really depends on how your SharePoint site is branded. An even more necessary dependency is weather or not it should be flexible for both desktop and mobile-device diplay. In which case I recomment making 2 stylesheets or use CSS Media Query (if you're a rather experienced SharePoint brander).

I usually disregard the default SharePoint masterpages and CSS files, as they have caused me WAY too much trouble for minor quite needless element modifications.

EM and % (Percentage) is the primary font-size handlers to use when you need to optimize the SharePoint site for mobile-devices, while PX or PT are more suitable for desktop display only.

EM is in my experience a bit hard to fool around with when toying with SharePoint branding, as this font-size is rather annoying as it double scales and you end up in many situations where you'll have you write font-size: X.[1-9]EM;. With that said, EM is preferred for mobile-device optimized SharePoint sites. Pixels and Points is honestly a NO-GO on mobile-devices.

When I change the font-size on my clients SharePoint sites I tend to only override 3 classes.
body, .ms-WPBody, .ms-WPBody TD

There is no need what so ever to change it on every single container which has its own set font-size as it usually contains child elements which has its own anyways, which is either an inheritance of body or its content resides within a container inheriting from .ms-WPBody in most cases.

share|improve this answer
    
That's great insight and seems to be a pretty logical way to do things. Thanks. –  CeeMoney Mar 10 '12 at 21:46

Read this: CSS Font-Size: em vs. px vs. pt vs. percent

share|improve this answer
    
I understand how it works, but it seems like sharepoint and EMs might not be the best solution with it's complexity. –  CeeMoney Mar 9 '12 at 16:55
    
Over 75% of all font sizes declared in the standard SharePoint 2010 base style sheets use a font-size in Points. erikswenson.blogspot.com/2011/11/… –  BioGeneZ Mar 9 '12 at 17:47
    
Ugh. Doing a CSS reset is probably a good practice eh? This is what I do to start. Trying to dig up more info on what's working for people... and isn't. kyleschaeffer.com/sharepoint/css-reset –  CeeMoney Mar 9 '12 at 18:44

We use font-size for all text scaling. No more going crazy about traversing all parents (100 of levels) to check font-size definition.

share|improve this answer
    
Not sure what you're getting at? Could you elaborate please? –  CeeMoney Mar 9 '12 at 18:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.