Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants