Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions common/changes/users-jechayav-4_3_2017-04-05-17-55.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Callout: Allow Callout to specify background color.",
"type": "minor"
}
],
"email": "jechayav@microsoft.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export interface ICalloutProps extends React.Props<Callout | CalloutContent> {
*/
beakWidth?: number;

/**
* The background color of the Callout in hex format ie. #ffffff.
* @default $ms-color-white
*/
backgroundColor?: string;

/**
* The bounding rectangle for which the contextual menu can appear in.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ export class CalloutContent extends BaseComponent<ICalloutProps, ICalloutState>
isBeakVisible,
beakStyle,
children,
beakWidth } = this.props;
beakWidth,
backgroundColor } = this.props;
let { positions } = this.state;
let beakStyleWidth = beakWidth;

Expand All @@ -112,7 +113,8 @@ export class CalloutContent extends BaseComponent<ICalloutProps, ICalloutState>
top: positions && positions.beakPosition ? positions.beakPosition.top : BEAK_ORIGIN_POSITION.top,
left: positions && positions.beakPosition ? positions.beakPosition.left : BEAK_ORIGIN_POSITION.left,
height: beakStyleWidth,
width: beakStyleWidth
width: beakStyleWidth,
backgroundColor: backgroundColor,
};

let directionalClassName = positions && positions.directionalClassName ? `ms-u-${positions.directionalClassName}` : '';
Expand Down Expand Up @@ -145,7 +147,7 @@ export class CalloutContent extends BaseComponent<ICalloutProps, ICalloutState>
className={ css('ms-Callout-main', styles.main) }
onDismiss={ this.dismiss }
shouldRestoreFocus={ true }
style={ { maxHeight: contentMaxHeight } }>
style={ { maxHeight: contentMaxHeight, backgroundColor: backgroundColor } }>
{ children }
</Popup>
</div>
Expand Down