From 3314bc3ba699f43a2ae14e4fc64970e9e03109ee Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 17 Sep 2018 20:52:36 +0200 Subject: [PATCH] Move styles to button --- src/core/client/ui/components/Tabs/Tab.css | 23 ++++++++++------------ src/core/client/ui/components/Tabs/Tab.tsx | 8 ++++---- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/core/client/ui/components/Tabs/Tab.css b/src/core/client/ui/components/Tabs/Tab.css index ca7ac0f66..4000b151b 100644 --- a/src/core/client/ui/components/Tabs/Tab.css +++ b/src/core/client/ui/components/Tabs/Tab.css @@ -1,9 +1,16 @@ .root { + display: inline-block; + list-style: none; + margin-right: -1px; + margin-bottom: -1px; +} + +.button { + height: 100%; box-sizing: border-box; + border-bottom: 0; list-style: none; padding: var(--spacing-unit); - display: inline-flex; - margin-bottom: -1px; font-weight: var(--font-weight-regular); font-family: var(--font-family-serif); @@ -12,22 +19,12 @@ } } -.root.primary { +.primary { background: var(--palette-grey-lightest); color: var(--palette-grey-main); border: 1px solid var(--palette-grey-main); - border-left-width: 0; padding: calc(0.5 * var(--spacing-unit)) calc(var(--spacing-unit) * 2); - &:first-child { - border-left-width: 1px; - border-top-left-radius: var(--round-corners); - } - - &:last-child { - border-top-right-radius: var(--round-corners); - } - &.active { background-color: var(--palette-common-white); color: var(--palette-common-black); diff --git a/src/core/client/ui/components/Tabs/Tab.tsx b/src/core/client/ui/components/Tabs/Tab.tsx index 59f24cf20..8e0390c42 100644 --- a/src/core/client/ui/components/Tabs/Tab.tsx +++ b/src/core/client/ui/components/Tabs/Tab.tsx @@ -41,8 +41,8 @@ class Tab extends React.Component { public render() { const { className, classes, children, tabId, active, variant } = this.props; - const rootClassName = cn( - classes.root, + const buttonClassName = cn( + classes.button, { [classes.primary]: variant === "primary", [classes.secondary]: variant === "secondary", @@ -53,13 +53,13 @@ class Tab extends React.Component { return (