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

Support repeating in ASCII syntax #2

Open
lazarljubenovic opened this issue Mar 13, 2017 · 0 comments
Open

Support repeating in ASCII syntax #2

lazarljubenovic opened this issue Mar 13, 2017 · 0 comments

Comments

@lazarljubenovic
Copy link
Owner

Basic idea

It'd come in handy if Grassy allowed to repeat rows "forever", instead of forcing a full spec declaration. For example, a simple alternating layout such as the following will work only for 1, 2, 3 or 4 elements. The fifth element would not styled at all.

x-x x
x x-x

The grid mixin should accept a parameter $repeat, which can be set to true.

Extending the idea

However, it's not always desirable to repeat the whole layout. Consider this.

x-x-x
x x-x
x-x x

We might want to repeat the last two rows "forever". Something like $repeat-last: 2.

Thinking further

Of course, this begs for $repeat-first, or even $repeat: from 2 to 4 in cases like the following:

x-x-x
x x-x
x-x x
x-x-x

This would make sure that the first and last elements are always spanning across the whole grid, while the middle ones are alternating. However, even such a simple case would have too many edge cases to consider, which would have to be configurable in order to be sued properly:

  • What if there is only 1 element? 2?
  • How to even-out "dangling" elements?

This needs very careful consideration, so I'll open a new issue for this after the basic case is done first.

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

No branches or pull requests

1 participant