Skip to content

Commit e012cdc

Browse files
committedMar 14, 2025
HDS-4532 Add comments to explain how gap values are defined in the CSS
1 parent 0421dfc commit e012cdc

File tree

1 file changed

+6
-3
lines changed
  • packages/components/src/styles/components/layout

1 file changed

+6
-3
lines changed
 

‎packages/components/src/styles/components/layout/grid.scss

+6-3
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
)
2424
);
2525

26-
// gap: rowGap, columnGap
26+
// Note: The gap style is defined here to avoid setting it repeatedly for the gap size variants defined below.
27+
// For the gap size variants, we override the value of the gap custom properties to set the desired sizes.
2728
gap:
28-
var(--hds-layout-grid-row-gap, var(--hds-layout-grid-gap, 0))
29-
var(--hds-layout-grid-column-gap, var(--hds-layout-grid-gap, 0));
29+
var(--hds-layout-grid-row-gap, var(--hds-layout-grid-gap, 0)) // rowGap
30+
var(--hds-layout-grid-column-gap, var(--hds-layout-grid-gap, 0)); // columnGap
3031
}
3132

3233
// inline
@@ -46,6 +47,8 @@
4647

4748
// gap
4849

50+
// We set the values of the gap custom properties overriding the default value of 0px
51+
4952
// set row & column gap together
5053
.hds-layout-grid--gap-4 { --hds-layout-grid-gap: 4px;}
5154
.hds-layout-grid--gap-8 { --hds-layout-grid-gap: 8px; }

0 commit comments

Comments
 (0)