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

Nth offset option for column proposal #538

Open
corbanbrook opened this issue Feb 26, 2018 · 0 comments
Open

Nth offset option for column proposal #538

corbanbrook opened this issue Feb 26, 2018 · 0 comments

Comments

@corbanbrook
Copy link

I find that it is sometimes useful to be able to offset the nth-child indexing when using cycle.

I propose the addition of an additional option, $nth-offset to the column mixin which would allow one to offset by a certain number. It would default to 0 which would have no effect.

Applied like this:

@if $cycle != 0 {
    &:#{$nth-selector}(n) {
      margin-#{_opposite-direction($side)}: $margin-r * 1%;
      float: $side;
      clear: none;
    }

    &:#{$nth-selector}(#{$cycle}n + #{$nth-offset}) {
      margin-#{_opposite-direction($side)}: $margin-last * 1%;
      float: _opposite-direction($side);
    }

    &:#{$nth-selector}(#{$cycle}n + #{1 + $nth-offset}) {
      clear: both;
    }
  } @else {
    &:last-child {
      margin-#{_opposite-direction($side)}: $margin-last * 1%;
    }
  }
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

No branches or pull requests

1 participant