Skip to content

Commit

Permalink
[MIRROR] TGUI Stack Zebra Mode [MDB IGNORE](#1020)
Browse files Browse the repository at this point in the history
* TGUI Stack Zebra Mode (#79972)
---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: ZeWaka <[email protected]>
Co-authored-by: oranges <email@ oranges.net.nz>
  • Loading branch information
4 people authored Dec 7, 2023
1 parent b373e96 commit cc7479b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tgui/packages/tgui/components/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ import { computeFlexClassName, computeFlexItemClassName, computeFlexItemProps, c
type StackProps = FlexProps & {
vertical?: boolean;
fill?: boolean;
zebra?: boolean;
};

export const Stack = (props: StackProps) => {
const { className, vertical, fill, ...rest } = props;
const { className, vertical, fill, zebra, ...rest } = props;
return (
<div
className={classes([
'Stack',
fill && 'Stack--fill',
vertical ? 'Stack--vertical' : 'Stack--horizontal',
zebra && 'Stack--zebra',
className,
computeFlexClassName(props),
])}
Expand Down
2 changes: 1 addition & 1 deletion tgui/packages/tgui/stories/Stack.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Story = (props) => {
<Stack fill className="debug-layout">
<SmallStackItems />
<Stack.Item grow={1}>
<Stack fill vertical>
<Stack fill vertical zebra>
<SmallStackItems />
<Stack.Item>
<Stack fill>
Expand Down
6 changes: 6 additions & 0 deletions tgui/packages/tgui/styles/components/Stack.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
@use '../base.scss';
@use './Divider.scss';

$zebra-background-color: base.$color-bg-section !default;

.Stack--fill {
height: 100%;
}
Expand All @@ -26,6 +28,10 @@
}
}

.Stack--zebra > .Stack__item:nth-child(even) {
background-color: $zebra-background-color;
}

.Stack--horizontal > .Stack__divider:not(.Stack__divider--hidden) {
border-left: Divider.$thickness solid Divider.$color;
}
Expand Down

0 comments on commit cc7479b

Please sign in to comment.