Skip to content

Commit

Permalink
feat: allow grid offset and start reset (#16479)
Browse files Browse the repository at this point in the history
* feat: allow grid offset and start reset

* chore(storybook): remove unneeded example stories

---------

Co-authored-by: kennylam <909118+kennylam@users.noreply.github.com>
Co-authored-by: Alison Joseph <alison.joseph@us.ibm.com>
  • Loading branch information
3 people committed Sep 3, 2024
1 parent ef5aa57 commit 3fcf739
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/react/src/components/Grid/Column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,16 @@ function getClassNameForBreakpoints(
if (typeof breakpoint === 'object') {
const { span, offset, start, end } = breakpoint;

if (typeof offset === 'number' && offset > 0) {
classNames.push(`${prefix}--${name}:col-start-${offset + 1}`);
if (typeof offset === 'number') {
classNames.push(
`${prefix}--${name}:col-start-${offset > 0 ? offset + 1 : 'auto'}`
);
}

if (typeof start === 'number') {
classNames.push(`${prefix}--${name}:col-start-${start}`);
classNames.push(
`${prefix}--${name}:col-start-${start ? start : 'auto'}`
);
}

if (typeof end === 'number') {
Expand Down

0 comments on commit 3fcf739

Please sign in to comment.