css-gridish icon indicating copy to clipboard operation
css-gridish copied to clipboard

Add offset helper classes

Open j1mie opened this issue 6 years ago • 1 comments

Adds offset helper classes .#{$prefix}-grid__offset--[x] to complement helper classes for columns.

For example the following:

<div class="bx-grid__col--sm--4 bx-grid__offset--sm--4">Element</div>

Would use the these rules for CSS grid:

.bx-grid__offset--sm--4.bx-grid__col--sm--4 {
    grid-column: 5 / span 4; 
}

And for legacy / flex:

.bx-grid__offset--sm--4 {
  margin-left: calc((100vw - 10vw) * 0.3333);
  margin-left: calc(((100vw - var(--scrollbar-width)) - 10vw) * 0.3333); 
}

Interested in hearing your thoughts @seejamescode

j1mie avatar May 15 '18 16:05 j1mie

@seejamescode Absolutely! Will update shortly.

j1mie avatar Jun 14 '18 10:06 j1mie