[Branding Tip] Custom Style in Newsfeed and Site Feed webpart in SharePoint 2013

Introduction

A typical requirement in SharePoint 2013 intranets is the ability to customize styling of My Site Newsfeed or Site Feed Web Part. The MySite News Feed Web Part (also known as the MicroFeedWebPart) has roughly 181 related CSS classes in portal.css.

I’d like to share a custom CSS included in SharePoint master page in order to stylize Newsfeed Web Part. The main changes are:

  • Custom header and title styles
  • Change Newsfeed height and add scroll bar (Limit the height of Site Feed web part)
  • Change margins and padding in order to have more compressed style
  • Change width for all thread divs (newsfeed items) in order to maintain aspect when scroll bar is included
  • Change Post Box height
  • Change Add a reply width to avoid collapse with scroll bar.

These are the CSS classes modified:

image

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/********* Newsfeed Styles **************/
.ms-microfeed-siteFeedTitleArea
{
background-color: silver;
padding-left: 20px;
text-transform:uppercase;
padding-bottom: 3px;
padding-top: 2px;
margin-bottom: 5px;
}
.ms-microfeed-siteFeedMicroBlogPart
{
margin-bottom: 2px;
}
.ms-microfeed-siteFeedTitleLabel
{
color: red !important;
}
.ms-microfeed-threadsDiv
{
height: 250px;
overflow-y: auto;
overflow-x: hidden;
}
.ms-microfeed-thread
{
max-width: 435px;
margin-bottom: 10px;
}
.ms-microfeed-replyArea
{
max-width: 375px;
min-width: 300px;
}
.ms-microfeed-attachmentButton
{
padding-top: 2px;
padding-bottom: 2px;
display: block;
}
.ms-microfeed-postButton
{
padding-top: 2px;
padding-bottom: 2px;
}
.ms-microfeed-postButtonSpan
{
margin-top: 2px;
}
.ms-microfeed-postBox
{
height: 20px;
}

UPDATE: If we add display: block; CSS property on .ms-microfeed-attachmentButton class. Then, when we click on “Start a conversation” we will maintain the height on the webpart. If we don’t have this css, then when focus on that textarea, the height will be increased and our global design can be affected negatively.

References

 

Author: José Quinto
Link: https://blog.josequinto.com/2014/06/09/branding-tip-custom-style-in-newsfeed-and-site-feed-webpart-in-sharepoint-2013/
Copyright Notice: All articles in this blog are licensed under CC BY-SA 4.0 unless stating additionally.