Skip to content

Commit

Permalink
restore negative marginLeft
Browse files Browse the repository at this point in the history
  • Loading branch information
veej committed Mar 29, 2024
1 parent ce64533 commit 42670d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 3 additions & 6 deletions packages/bento-design-system/src/Layout/Column.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ import { Breakpoint, breakpoints } from "../util/breakpoints";

export const columnsSpace = createVar("columns-space");

export const column = style({});
export const columns = style({
marginLeft: `calc(${columnsSpace} * -1)`,
});

export const columnContent = style({
marginLeft: columnsSpace,
selectors: {
[`${column}:first-child &`]: {
marginLeft: 0,
},
},
});

const styleForScale = (scale: number): StyleRule => ({
Expand Down
6 changes: 3 additions & 3 deletions packages/bento-design-system/src/Layout/Columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
mobileWidths,
fullWidth,
columnsSpace,
column,
columns,
columnContent,
} from "./Column.css";
import { assignInlineVars } from "@vanilla-extract/dynamic";
Expand All @@ -36,9 +36,8 @@ export function Column({ children, width, sticky }: ColumnProps) {

const className =
width == null
? [column, fullWidth]
? fullWidth
: [
column,
wide && wideWidths[wide],
desktop && desktopWidths[desktop],
tablet && tabletWidths[tablet],
Expand All @@ -65,6 +64,7 @@ export function Columns({ space, children, align, alignY, collapseBelow, reverse
display="flex"
{...responsiveCollapsibleAlignmentProps({ align, alignY, collapseBelow, reverse })}
style={assignInlineVars({ [columnsSpace]: `${space}px` })}
className={columns}
>
{flattenChildren(children).map((child, index) => {
if (isColumn(child)) {
Expand Down

0 comments on commit 42670d6

Please sign in to comment.