Skip to content

Commit

Permalink
set tabs to inline when not full width
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle McGuire committed May 7, 2019
1 parent 2128be7 commit ac6bc8a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
- removed `border` prop from `Table.td`
- removed `isActionable` from `table`
- added `presetSize` to `SettingsIcon`
- `Tabs` is now an inline element when the `hasFullWidthTabs` is false
11 changes: 10 additions & 1 deletion src/components/Tabs/Tabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,16 @@ const Tabs = createClass({
: selectedIndex;

return (
<div {...omitProps(passThroughs, Tabs)} className={cx('&', className)}>
<div
{...omitProps(passThroughs, Tabs)}
className={cx(
'&',
{
'&-container-variable-width': !hasFullWidthTabs,
},
className
)}
>
<ul
className={cx('&-bar', {
'&-bar-is-multiline': hasMultilineTitle,
Expand Down
16 changes: 11 additions & 5 deletions src/components/Tabs/Tabs.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
@Tabs-border-width: 1px;

.@{prefix}-Tabs {


&-bar {
font-size: @size-font;
font-weight: @font-weight-semiBold;
Expand All @@ -15,6 +17,10 @@
padding: 0;
}

&-container-variable-width {
display: inline;
}

&-variable-width {

display: inline-flex;
Expand All @@ -39,15 +45,15 @@
color: @color-darkGray;
user-select: none;
background-color: @color-white;

&:hover {
border-bottom: 3px solid @color-primary;
}

&:active {
.dropshadow-gradient(@color-gray, @color-lightGray, @Tabs-spacer-height);
}

.@{prefix}-Badge {
cursor: pointer;
}
Expand All @@ -56,15 +62,15 @@
&-Tab-is-disabled {
color: @color-neutral-6;
cursor: not-allowed;

&:hover {
border-bottom: 0;
}

&:active {
background: @color-white;
}

.@{prefix}-Badge {
color: @color-neutral-6;
border-color: @color-neutral-5;
Expand Down
18 changes: 9 additions & 9 deletions src/components/Tabs/__snapshots__/Tabs.spec.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`Tabs [common] example testing should match snapshot(s) for 01-title-as-prop 1`] = `
<div
className="lucid-Tabs"
className="lucid-Tabs lucid-Tabs-container-variable-width"
>
<ul
className="lucid-Tabs-bar lucid-Tabs-variable-width"
Expand Down Expand Up @@ -68,7 +68,7 @@ exports[`Tabs [common] example testing should match snapshot(s) for 01-title-as-

exports[`Tabs [common] example testing should match snapshot(s) for 02-title-as-child 1`] = `
<div
className="lucid-Tabs"
className="lucid-Tabs lucid-Tabs-container-variable-width"
>
<ul
className="lucid-Tabs-bar lucid-Tabs-variable-width"
Expand Down Expand Up @@ -148,7 +148,7 @@ exports[`Tabs [common] example testing should match snapshot(s) for 02-title-as-

exports[`Tabs [common] example testing should match snapshot(s) for 03-complex-title-as-child 1`] = `
<div
className="lucid-Tabs"
className="lucid-Tabs lucid-Tabs-container-variable-width"
>
<ul
className="lucid-Tabs-bar lucid-Tabs-bar-is-multiline lucid-Tabs-variable-width"
Expand Down Expand Up @@ -358,7 +358,7 @@ exports[`Tabs [common] example testing should match snapshot(s) for 03-complex-t

exports[`Tabs [common] example testing should match snapshot(s) for 04-tab-as-prop 1`] = `
<div
className="lucid-Tabs"
className="lucid-Tabs lucid-Tabs-container-variable-width"
>
<ul
className="lucid-Tabs-bar lucid-Tabs-variable-width"
Expand Down Expand Up @@ -462,7 +462,7 @@ exports[`Tabs [common] example testing should match snapshot(s) for 05-full-widt

exports[`Tabs [common] example testing should match snapshot(s) for 06-variable-width 1`] = `
<div
className="lucid-Tabs"
className="lucid-Tabs lucid-Tabs-container-variable-width"
>
<ul
className="lucid-Tabs-bar lucid-Tabs-variable-width"
Expand Down Expand Up @@ -541,7 +541,7 @@ exports[`Tabs [common] example testing should match snapshot(s) for 06-variable-

exports[`Tabs [common] example testing should match snapshot(s) for 07-progression 1`] = `
<div
className="lucid-Tabs"
className="lucid-Tabs lucid-Tabs-container-variable-width"
>
<ul
className="lucid-Tabs-bar lucid-Tabs-variable-width"
Expand Down Expand Up @@ -619,7 +619,7 @@ exports[`Tabs [common] example testing should match snapshot(s) for 07-progressi

exports[`Tabs [common] example testing should match snapshot(s) for 08-progression-variable-width 1`] = `
<div
className="lucid-Tabs"
className="lucid-Tabs lucid-Tabs-container-variable-width"
>
<ul
className="lucid-Tabs-bar lucid-Tabs-variable-width"
Expand Down Expand Up @@ -722,7 +722,7 @@ exports[`Tabs [common] example testing should match snapshot(s) for 08-progressi

exports[`Tabs [common] example testing should match snapshot(s) for 09-with-count 1`] = `
<div
className="lucid-Tabs"
className="lucid-Tabs lucid-Tabs-container-variable-width"
>
<ul
className="lucid-Tabs-bar lucid-Tabs-variable-width"
Expand Down Expand Up @@ -806,7 +806,7 @@ exports[`Tabs [common] example testing should match snapshot(s) for 09-with-coun

exports[`Tabs [common] example testing should match snapshot(s) for 10-floating 1`] = `
<div
className="lucid-Tabs"
className="lucid-Tabs lucid-Tabs-container-variable-width"
>
<ul
className="lucid-Tabs-bar lucid-Tabs-variable-width lucid-Tabs-floating"
Expand Down

0 comments on commit ac6bc8a

Please sign in to comment.