Skip to content

Commit

Permalink
fix(subgrid): narrow mode margin value
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonjoseph committed Dec 16, 2024
1 parent 2c2bbcb commit 9bb3b03
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/grid/scss/_css-grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@

// Narrow
.#{$prefix}--css-grid--narrow {
--cds-grid-gutter-start: 0;
--cds-grid-gutter-start: 0rem; /* stylelint-disable-line length-zero-no-unit */
}

// Condensed
Expand All @@ -156,12 +156,12 @@

// Start
.#{$prefix}--css-grid--start {
margin-inline-start: 0;
margin-inline-start: 0rem; /* stylelint-disable-line length-zero-no-unit */
}

// End
.#{$prefix}--css-grid--end {
margin-inline-end: 0;
margin-inline-end: 0rem; /* stylelint-disable-line length-zero-no-unit */
}

// -----------------------------------------------------------------------------
Expand All @@ -183,11 +183,11 @@
.#{$prefix}--subgrid--wide {
--cds-grid-gutter-start: #{math.div($grid-gutter, 2)};
--cds-grid-gutter-end: #{math.div($grid-gutter, 2)};
--cds-grid-column-hang: 0;
--cds-grid-column-hang: 0rem; /* stylelint-disable-line length-zero-no-unit */
}

.#{$prefix}--subgrid--narrow {
--cds-grid-gutter-start: 0;
--cds-grid-gutter-start: 0rem; /* stylelint-disable-line length-zero-no-unit */
--cds-grid-gutter-end: #{math.div($grid-gutter, 2)};
--cds-grid-column-hang: #{math.div($grid-gutter, 2)};
}
Expand Down
52 changes: 52 additions & 0 deletions packages/react/src/components/Grid/Grid.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,58 @@ export default {
],
};

export const ATestSubgrid = () => {
return (
<>
<h5>Wide</h5>
<Grid>
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={8} lg={16}>
<Grid>
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
</Grid>
</Column>
</Grid>
<h5>Narrow</h5>
<Grid narrow>
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={8} lg={16}>
<Grid narrow>
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
</Grid>
</Column>
</Grid>
<h5>Condensed</h5>
<Grid condensed>
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={8} lg={16}>
<Grid condensed>
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
<Column sm={4} md={4} lg={4} />
</Grid>
</Column>
</Grid>
</>
);
};

export const Default = () => {
return (
<Grid>
Expand Down

0 comments on commit 9bb3b03

Please sign in to comment.