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

Unknown shorthand property: [null] on v3-alpha5 #630

Closed
robsonsobral opened this issue Apr 24, 2017 · 12 comments
Closed

Unknown shorthand property: [null] on v3-alpha5 #630

robsonsobral opened this issue Apr 24, 2017 · 12 comments

Comments

@robsonsobral
Copy link

Hi, @mirisuzanne .

One of my coworkers just found a bug on version alpha 5:

    _src/stylesheets/vendor/susy/_utilities.scss
Error: [susy-parse] Unknown shorthand property: [null] ``
        on line 59 of _src/stylesheets/vendor/susy/_utilities.scss
>>   @error '[#{$source}] #{$message}';
   --^

Bye!

@mirisuzanne
Copy link
Member

Thanks @robsonsobral - can you give me any more context around how you triggered the bug? What were they trying to do?

@robsonsobral
Copy link
Author

I just tried to rebuild a project made using alpha1 and GULP.

Is there some change I can make to try to find the line which triggered the bug?

@mirisuzanne
Copy link
Member

Hmmm, are there any places you are passing null into Susy? The parser is throwing an error because it doesn't understand null as a valid value in the Susy shorthand.

@robsonsobral
Copy link
Author

I can't find any.

My config:

$susy: (
	'columns': 12 x (70 / 16 * 1rem),
	'gutters': (30 / 16 * 1rem),
);

Some samples of code you may want to add to tests:

  • (span(7) * -1 - gutter() * .5)
  • $grid: susy-normalize($grid)
  • span(12 'wider');
  • width: calc(50% + #{span(6 'wide') + gutter() * .5});
  • (span(1) / 2)
  • margin: (span(1) * -1) auto span(1);
  • margin: 0 gutter() gutter() 0;

@mirisuzanne
Copy link
Member

Oh, I like all the weird ways you're using it! :)

  • Doing math with the results of a span is not something we control, so I'm not worried about those.
  • $grid: susy-normalize($grid) depends completely on the value of $grid. Where are you using that? We do normalization internally when we parse, so that's probably not necessary in most cases.
  • I think it works to do span(0.5) instead of (span(1) / 2)

Everything else in there is already tested on our end. Can you try commenting out partials, or lines of code, to narrow it down?

@robsonsobral
Copy link
Author

I'm using $grid: susy-normalize($grid) on my grid mixin. The one I sent you last year.

Tomorrow I try to find the source of the issue. I had a loooooooong day. I'm sorry.

Thank you so much, @mirisuzanne .

@robsonsobral
Copy link
Author

Hi, @mirisuzanne .

I found that any gutter() breaks the code. So, problably it's a config problem.

I tried to change the config to:

$susy: (
	'columns': 12,
	'gutters': 0.5
);

and:

$susy: (
	'columns': 12 x 4.375em,
	'gutters': 1.875em
);

Without luck.

Is there any special place I should put the config map?

@mirisuzanne
Copy link
Member

Based on #631, it sounds like this error can be triggered with an empty gutter() function.

@robsonsobral
Copy link
Author

Yeap! gutter(1) fi... Prevent it!

@mirisuzanne
Copy link
Member

I think the problem is in the parser, not in your config.

In the meantime, any single number passed to gutter() will act as context, so use 12 for a 12-column grid, and you should get what you need.

@robsonsobral
Copy link
Author

It's too much to change right now, Miriam. It's safer to stay on alpha 1. Thank you!

@mirisuzanne
Copy link
Member

Fixed in 67fd193 - released in https://github.com/oddbird/susy/releases/tag/3.0.0.alpha.6 - enjoy!

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