Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Update Coachmark basic example and fix TeachingBubble SCSS selectors",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "edwl@microsoft.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { Coachmark } from '../Coachmark';
import { TeachingBubbleContent } from 'office-ui-fabric-react/lib/TeachingBubble';
import { ICalloutProps } from 'office-ui-fabric-react/lib/Callout';
import { DefaultButton } from 'office-ui-fabric-react/lib/Button';
import { DefaultButton, IButtonProps } from 'office-ui-fabric-react/lib/Button';
import { IStyle } from '../../../Styling';
import {
BaseComponent,
Expand Down Expand Up @@ -60,6 +60,14 @@ export class CoachmarkBasicExample extends BaseComponent<{}, ICoachmarkBasicExam
};
});

const primaryButtonProps: IButtonProps = {
text: 'OK'
};

const secondaryButtonProps: IButtonProps = {
text: 'Cancel'
};

return (
<div className={ classNames.root }>
<div
Expand All @@ -78,6 +86,10 @@ export class CoachmarkBasicExample extends BaseComponent<{}, ICoachmarkBasicExam
<TeachingBubbleContent
headline='Example Title'
calloutProps={ calloutProps }
hasCloseIcon={ true }
primaryButtonProps={ primaryButtonProps }
secondaryButtonProps={ secondaryButtonProps }
onDismiss={ this._onCalloutDismiss }
>
Welcome to the land of coachmarks
</TeachingBubbleContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,16 @@
font-weight: $ms-font-weight-semilight;
}

.root .closeButton {
.closeButton {
position: absolute;
@include ms-right(0);
top: 0;
color: $ms-color-white;
font-size: $ms-icon-size-s;

&:hover {
background: transparent;
}
}

.footer {
Expand Down Expand Up @@ -155,7 +159,7 @@
}

//Primary button style override
.root .primaryButton {
.primaryButton {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing specificity here could cause issues.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed...i'm guessing these styles are overriding previous styles...probably applied via a classname, so any change in load order could break this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to simplify this, you could pass the styles into the button styles prop

background-color: $ms-color-white;
border-color: $ms-color-white;

Expand All @@ -181,7 +185,7 @@
}

//Secondary button style override
.root .secondaryButton {
.secondaryButton {
background-color: $ms-color-themePrimary;
border-color: $ms-color-white;

Expand Down