Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/addons/a11y/src/components/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ const Subnav = styled.div(({ theme }) => ({
overflow: 'auto',
paddingRight: 10,
gap: 6,
scrollbarColor: `${theme.barTextColor} ${theme.background.app}`,
scrollbarWidth: 'thin',
}));

const TabsWrapper = styled.div({});
Expand Down
9 changes: 5 additions & 4 deletions code/core/src/component-testing/components/Subnav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
SyncIcon,
} from '@storybook/icons';

import { styled } from 'storybook/theming';
import { styled, useTheme } from 'storybook/theming';

import { type Call, CallStates, type ControlStates } from '../../instrumenter/types';
import type { Controls } from './InteractionsPanel';
Expand All @@ -33,13 +33,13 @@ const SubnavWrapper = styled.div(({ theme }) => ({
zIndex: 1,
}));

const StyledSubnav = styled.nav(({ theme }) => ({
const StyledSubnav = styled.nav({
height: 40,
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
paddingLeft: 15,
}));
});

interface SubnavProps {
controls: Controls;
Expand Down Expand Up @@ -121,10 +121,11 @@ export const Subnav: React.FC<SubnavProps> = ({
onScrollToEnd,
}) => {
const buttonText = status === CallStates.ERROR ? 'Scroll to error' : 'Scroll to end';
const theme = useTheme();

return (
<SubnavWrapper>
<Bar>
<Bar backgroundColor={theme.background.app}>
<StyledSubnav aria-label="Component tests toolbar">
<Group>
<StatusBadge status={status} />
Expand Down
9 changes: 6 additions & 3 deletions code/core/src/components/components/bar/bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,17 @@ const UnstyledBar = ({ children, className, scrollable }: UnstyledBarProps) =>
);

export interface BarProps extends UnstyledBarProps {
backgroundColor?: string;
border?: boolean;
}
export const Bar = styled(UnstyledBar)<BarProps>(
({ theme, scrollable = true }) => ({
({ backgroundColor, theme, scrollable = true }) => ({
color: theme.barTextColor,
width: '100%',
height: 40,
minHeight: 40,
flexShrink: 0,
scrollbarColor: `${theme.barTextColor} ${backgroundColor || theme.barBg}`,
scrollbarWidth: 'thin',
overflow: scrollable ? 'auto' : 'hidden',
overflowY: 'hidden',
Comment thread
Sidnioulz marked this conversation as resolved.
}),
Expand Down Expand Up @@ -94,7 +97,7 @@ export interface FlexBarProps extends ComponentProps<typeof Bar> {
export const FlexBar = ({ children, backgroundColor, className, ...rest }: FlexBarProps) => {
const [left, right] = Children.toArray(children);
return (
<Bar className={`sb-bar ${className}`} {...rest}>
<Bar backgroundColor={backgroundColor} className={`sb-bar ${className}`} {...rest}>
<BarInner bgColor={backgroundColor}>
<Side scrollable={rest.scrollable} left>
{left}
Expand Down
2 changes: 2 additions & 0 deletions code/core/src/manager/components/preview/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ const Toolbar = styled.div<{ shown: boolean }>(({ theme, shown }) => ({
marginTop: shown ? 0 : -40,
boxShadow: `${theme.appBorderColor} 0 -1px 0 0 inset`,
background: theme.barBg,
scrollbarColor: `${theme.barTextColor} ${theme.barBg}`,
scrollbarWidth: 'thin',
zIndex: 4,
}));

Expand Down
Loading