Skip to content

Commit

Permalink
fix(theme): remove bottom border and vertical padding from vertical t…
Browse files Browse the repository at this point in the history
…abs (redhat-developer#135)

Signed-off-by: Christoph Jerolimov <[email protected]>
  • Loading branch information
christoph-jerolimov authored and 04kash committed Dec 12, 2024
1 parent 9405846 commit ddb78cc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
5 changes: 5 additions & 0 deletions workspaces/theme/.changeset/moody-camels-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@red-hat-developer-hub/backstage-plugin-theme': patch
---

remove bottom border and vertical padding from vertical tabs
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,23 @@ export const TabExamples = () => {
return (
<div>
{colors.map(color => (
<div key={color} style={{ padding: '20px 0' }}>
<div key={color}>
<div style={{ padding: '20px 0' }}>color: {color ?? 'undefined'}</div>
<Tabs
value={selectedTab}
indicatorColor="primary"
textColor="primary"
onChange={handleChange}
>
<Tab label={`color: ${color}`} />
<Tab label="One" />
<Tab label="Two" />
<Tab label="Three" />
<Tab label="Disabled" disabled />
</Tabs>
</div>
))}

<div style={{ padding: '20px 0' }}>Vertical test</div>
<Tabs
orientation="vertical"
value={selectedTab}
Expand All @@ -55,7 +57,7 @@ export const TabExamples = () => {
onChange={handleChange}
aria-label="disabled tabs example"
>
<Tab label="Vertical test" />
<Tab label="One" />
<Tab label="Two" />
<Tab label="Three" />
<Tab label="Disabled" disabled />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export const TabExamples = () => {
return (
<div>
{colors.map(color => (
<div key={color} style={{ padding: '20px 0' }}>
<div key={color}>
<div style={{ padding: '20px 0' }}>color: {color ?? 'undefined'}</div>
<Tabs
value={selectedTab}
indicatorColor="primary"
Expand All @@ -47,6 +48,7 @@ export const TabExamples = () => {
</div>
))}

<div style={{ padding: '20px 0' }}>Vertical test</div>
<Tabs
orientation="vertical"
value={selectedTab}
Expand All @@ -55,7 +57,7 @@ export const TabExamples = () => {
onChange={handleChange}
aria-label="disabled tabs example"
>
<Tab label="Vertical test" />
<Tab label="One" />
<Tab label="Two" />
<Tab label="Three" />
<Tab label="Disabled" disabled />
Expand Down
4 changes: 4 additions & 0 deletions workspaces/theme/plugins/theme/src/utils/createComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,10 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
borderBottom: `1px solid ${general.tabsBottomBorderColor}`,
padding: '0 1.5rem',
},
vertical: {
borderBottom: `none`,
padding: 0,
},
flexContainerVertical: {
'& > button:hover': {
boxShadow: `-3px 0 ${general.tabsBottomBorderColor} inset`,
Expand Down

0 comments on commit ddb78cc

Please sign in to comment.