0

I managed to change the style Title with background (of the summary links) by changing one color in the file

//domain/_catalogs/theme/Themed/141089E3/controls15-51FFDD78.themedcss

The color was changed as expected. However when I insert a media part (or insert video) the color reverts back to the standard blue. Here is what I see in the explorer

The one that looks 'deleted' is the correct one, while the one above popped up only when I inserted the video/media

enter image description here

The link to that css file is

domain/_layouts/15/1033/styles/controls15.css?rev=GF%2Fpek4jNA7LfT%2Ffzc2JQA%3D%3D

and I cant find this place to edit this color or delete this entry.

What can I do and why it is behaving this way when I insert a media?

1

It's usually recommended to not edit any of the default SharePoint files, because if an update to SharePoint gets applied, and that file is part of the update, your changes will get overwritten by the update.

There are a couple of ways you could approach this. If the site you are working with has the publishing features enabled, in Site Settings under "Look and Feel" there should be a link titled "Master page". In the Master Page settings, there is a place to specify an Alternate CSS file to be used. This would apply throughout the site. You can create a stylesheet with the settings you want to override .title-With-Background, upload it to a location on the site (I like to put things in the Site Assets folder), and specify the URL to the file in the Alternate CSS URL setting.

If you do not have publishing enabled, you can use a similar technique to link in a stylesheet just to the page you want it on. You would upload the custom style sheet to somewhere on the site, go to the page you want it applied to, add a Script Editor Web Part at the top of the page, and in the script editor snippet, add the link to the style sheet:

<link rel="stylesheet" type="text/css" href="/sites/mysite/SiteAssets/myStyleSheet.css" />

That should override the SP default styles. If it does not, one thing you might want to try is to make a more specific selector.

By that I mean, look at the page and see if you can see some other element you can use that is applicable to all the places you want your new title-With-Background style to apply, and use that to narrow the selection. For instance, you could just specify all title-With-Backgrounds that are within a web part zone:

.ms-webpart-zone .title-With-Background {
    /* your custom styles here */
}
  • +1 for mentioning the lesser know features of CSS Specificty good read: stuffandnonsense.co.uk/archives/css_specificity_wars.html – Danny '365CSI' Engelman Aug 7 '15 at 18:48
  • Any guess on why the 'revert' only happens when I insert a media part? Is this related to a botched job by the branding agency or it would have happened in a natural non customized SP environment? – susan Aug 7 '15 at 18:59
  • Not entirely sure why the revert happened. It may have to do with the order the files are loaded, or it may have to do with the specificity of the selectors. Most likely it would have happened on a non-customized SP environment, but if the color in the "themedcss" file was the original blue, you would never notice that the "controls15" is actually overriding the theme. – Dylan Cristy Aug 7 '15 at 19:29
0

Ok, I edited the default sharepoint file. This is a trivial matter for me and even if Microsoft overrides my editing with an update I can revert back. For those of you who are interested, I edited the following (the file to be edited was Controls15.css)

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\FEATURES\PublishingLayouts\en-us

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\1033\STYLES

Not sure why it is on 2 location, I guess one for the publishing sites and the other for the non-publishing sites.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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