Skip to content

Commit

Permalink
chore(global-navigation): Move slds-has-sub-tabs to nav item rather t…
Browse files Browse the repository at this point in the history
…han on top level component
  • Loading branch information
brandonferrua committed Oct 16, 2017
1 parent 82a4339 commit d99332b
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion ui/components/global-navigation/__tests__/index.spec.js
Expand Up @@ -22,13 +22,14 @@ const { matchesMarkupAndStyle } = createHelpers(__dirname);
it('renders a global-navigation with sub-tabs', () => it('renders a global-navigation with sub-tabs', () =>
matchesMarkupAndStyle( matchesMarkupAndStyle(
<div className="demo-only" style={{ height: '8rem' }}> <div className="demo-only" style={{ height: '8rem' }}>
<ContextTabBar className="slds-has-sub-tabs"> <ContextTabBar>
<ContextTab <ContextTab
title="Home" title="Home"
symbol="home" symbol="home"
tabPanelId="context-tab-panel-1" tabPanelId="context-tab-panel-1"
id="context-tab-id-1" id="context-tab-id-1"
itemActive itemActive
hasSubtabs
/> />
<ContextTab <ContextTab
title="Tab Item 1" title="Tab Item 1"
Expand Down
23 changes: 23 additions & 0 deletions ui/components/global-navigation/navigation-bar/_index.scss
Expand Up @@ -400,6 +400,29 @@ $color-background-context-bar-brand-light: rgba($color-background-context-bar-br
} }
} }


/**
* @summary Modifier that notifies a parent component that it has sub tabs inside of it
* @selector .slds-has-sub-tabs
* @restrict .slds-context-bar__item_tab
*/
.slds-context-bar__item_tab.slds-has-sub-tabs.slds-is-active,
.slds-context-bar__item_tab.slds-has-sub-tabs.slds-is-active:hover {
animation: none;
background-color: transparent;

&:after {
content: '';
display: block;
position: absolute;
bottom: -3px;
height: 3px;
width: 100%;
background-color: $color-background-context-bar;
border: 0;
mix-blend-mode: unset;
}
}

/** /**
* Unsaved indicator - This can probably be used in other locations as well * Unsaved indicator - This can probably be used in other locations as well
* *
Expand Down
Empty file.
Expand Up @@ -64,7 +64,8 @@ export let ContextTab = props => (
'slds-is-active': props.itemActive, 'slds-is-active': props.itemActive,
'slds-is-unsaved': props.itemUnsaved, 'slds-is-unsaved': props.itemUnsaved,
'slds-is-pinned': props.pinned, 'slds-is-pinned': props.pinned,
'slds-has-notification': props.itemUnread 'slds-has-notification': props.itemUnread,
'slds-has-sub-tabs': props.hasSubtabs
} }
)} )}
role="presentation" role="presentation"
Expand Down Expand Up @@ -1187,13 +1188,14 @@ export let states = [
label: 'Sub Tabs - Open', label: 'Sub Tabs - Open',
element: ( element: (
<div className="demo-only" style={{ height: '8rem' }}> <div className="demo-only" style={{ height: '8rem' }}>
<ContextTabBar className="slds-has-sub-tabs"> <ContextTabBar>
<ContextTab <ContextTab
title="Home" title="Home"
symbol="home" symbol="home"
tabPanelId={tabPanelId01} tabPanelId={tabPanelId01}
id={tabId01} id={tabId01}
itemActive itemActive
hasSubtabs
/> />
<ContextTab <ContextTab
title="Tab Item 1" title="Tab Item 1"
Expand Down
Empty file.
26 changes: 0 additions & 26 deletions ui/components/tabs/sub-tabs/_index.scss
Expand Up @@ -58,29 +58,3 @@
text-decoration: underline; text-decoration: underline;
} }
} }

/**
* @summary Modifier that notifies a parent component that it has sub tabs inside of it
* @selector .slds-has-sub-tabs
* @restrict .slds-context-bar
*/
.slds-has-sub-tabs {

.slds-context-bar__item_tab.slds-is-active,
.slds-context-bar__item_tab.slds-is-active:hover {
animation: none;
background-color: transparent;

&:after {
content: '';
display: block;
position: absolute;
bottom: -3px;
height: 3px;
width: 100%;
background-color: $color-background-context-bar;
border: 0;
mix-blend-mode: unset;
}
}
}

0 comments on commit d99332b

Please sign in to comment.