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

Problem setting gutter to zero #10

Closed
rolandtoth opened this issue Jul 27, 2017 · 8 comments
Closed

Problem setting gutter to zero #10

rolandtoth opened this issue Jul 27, 2017 · 8 comments

Comments

@rolandtoth
Copy link

Gutter value 0 doesn't seem to work:

cell(2, 3, g: 0)

However, using 0.0001 works. Is there something I miss or is this a bug?

@juliancwirko
Copy link
Owner

Hi, are you sure that you don't have any other styles which could overwrite gutter styles? Maybe some paddings or margins on the same element?

@rolandtoth
Copy link
Author

Yes, it's a new project with almost no styles. Plus the devtools shows 'invalid property value':

flex-basis: calc(100% * .25 - 0)

In case of 0.00001 it looks like this (it's a 1/4 col):

flex-basis: calc(100% * .25 - 6.25e-7rem)

@juliancwirko
Copy link
Owner

Ok, that's weird ;) I'll debug this asap.

@juliancwirko
Copy link
Owner

I've tested it using something like:

@import 's-grid-settings'
@import 's-grid-functions'

.grid
  grid()
  .cell
    cell(1, 3, g: 0)

And it produces me something like:

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  flex-direction: row;
}
.grid .cell {
  flex-basis: calc(100% * 0.333333333333333 - 0rem);
  min-width: 0;
}

So it seems to work well. The output in the browser is also good in both cases with and without gutter.

@rolandtoth
Copy link
Author

rolandtoth commented Jul 28, 2017

Thanks, I see now where it fails. It's the compiler setting --compress which removes the "rem" and then the CSS calc fails.

http://stylus-lang.com/docs/executable.html

I think sGrid work around this because I guess I'm not the only one who uses --compress.

@juliancwirko
Copy link
Owner

sure, good point, I'll try to fix this

@juliancwirko
Copy link
Owner

Ok, you can try with version 1.2.1 It is also published on npm

@rolandtoth
Copy link
Author

Seems to work fine after the upgrade, thanks!

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

2 participants