Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Add offset helper classes #43

Open
wants to merge 2 commits into
base: v2.1.0
Choose a base branch
from
Open

Add offset helper classes #43

wants to merge 2 commits into from

Conversation

j1mie
Copy link

@j1mie j1mie commented May 15, 2018

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

@joshblack joshblack requested a review from seejamescode May 16, 2018 16:53
Copy link
Contributor

@seejamescode seejamescode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks helpful! I’m looking at the legacy files. It looks like each offset needs only one selector for Flexbox, but another selector for each column in the grid. This probably means that we should switch from grid-column to grid-column-start and grid-column-end (#34). Can you make that change, @j1mie?

@j1mie
Copy link
Author

j1mie commented Jun 14, 2018

@seejamescode Absolutely! Will update shortly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants