From 5916f2f7cbbc80af734a6ffee986d8fc71e5018c Mon Sep 17 00:00:00 2001 From: Ed Ngai Date: Tue, 19 Sep 2017 12:25:49 -0700 Subject: [PATCH] fix(subtabs): adjust position of unsaved indicator when used with notifications --- ui/components/tabs/base/_index.scss | 27 ++++++++++++++++ ui/components/tabs/sub-tabs/example.jsx | 43 ++++++++++++++++++++++++- 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/ui/components/tabs/base/_index.scss b/ui/components/tabs/base/_index.scss index 7f2b5fffc8..6019f79b1c 100644 --- a/ui/components/tabs/base/_index.scss +++ b/ui/components/tabs/base/_index.scss @@ -194,6 +194,33 @@ background-color: $color-brand-dark; } } + + .slds-indicator_unread { + display: inline-block; + height: 6px; + width: 6px; + position: relative; + top: auto; + left: auto; + } + } + + /** + * @summary Creates styles for a Tab Item when its in an unsaved or dirty state + * @selector .slds-is-unsaved + * @restrict .slds-tabs_default__item + */ + &.slds-is-unsaved { + + .slds-indicator_unread { + margin-left: -0.35rem; //random but matches spec + } + + .slds-indicator_unsaved { + position: relative; + top: ($spacing-xx-small * -1); + } + } } diff --git a/ui/components/tabs/sub-tabs/example.jsx b/ui/components/tabs/sub-tabs/example.jsx index 96e34c2d08..e58612a15b 100644 --- a/ui/components/tabs/sub-tabs/example.jsx +++ b/ui/components/tabs/sub-tabs/example.jsx @@ -18,7 +18,8 @@ let Subtab = props => ( { 'slds-has-notification': props.hasNotification, 'slds-has-focus': props.hasFocus, - 'slds-active': props.active + 'slds-active': props.active, + 'slds-is-unsaved': props.itemUnsaved }, props.className )} @@ -352,5 +353,45 @@ export let states = [ ) + }, + { + id: 'subtabs-notification-dirty', + label: 'Unsaved With Notification', + element: ( +
+ +
+ Item One Content +
+
+ Item Two Content +
+
+ ) } ];