inuitcss / trumps.spacing-responsive

[DEPRECATED] [go to intuitcss/inuitcss]
https://github.com/inuitcss/inuitcss
12 stars 16 forks source link

error on css generation #2

Closed ghost closed 9 years ago

ghost commented 10 years ago

I have an error when generating the css of this file:

error src/scss/styles.scss (Line 47 of components/inuit-spacing-responsive/_trumps.spacing-responsive.scss: Invalid CSS after "...breakpoint, 1) ": expected "}", was "!global;")
csswizardry commented 10 years ago

What version/flavour of Sass are you using? Works fine for me using plain ol’ Sass 3.3.11.

ghost commented 10 years ago

Sass is v3.3.11 (Maptastic Maple), compass 0.12.7 and grunt-contrib-compass 0.9.0

rinusvandam commented 10 years ago

Hi, i have the same error generating the css. Using Sass 3.3.11.

fitzhaile commented 10 years ago

Me three -- using grunt-sass/node-sass/libsass.

According to sass/libsass/issues/278, they've merged in a fix to ignore the !global modifier but not implement the correct scoping behavior.

I'm still getting the error, but I'm assuming it's because of my version of libsass.

jonotron commented 10 years ago

Compatibility with libsass/Sass 3.2 asside, the use of !global here feels a bit wrong and is a bit confusing to understand.

I realize that this was implemented to DRY up the $breakpoint iteration, but is there a way to do this that does not require setting and unsetting a global var?

jonotron commented 10 years ago

As a minimal change to get this working, I've submitted #4, which preserves the basic functionality, but does not use the breaking !global

jonotron commented 10 years ago

Alternatively, people can depend on 0.0.2 in their bower.json (which compiles out to basically the same css and does not have the breaking !global keyword)

scottkellum commented 10 years ago

!global will break Sass 3.2 and Libsass compiles, no matter how much logic you write to avoid the situation.

However there is a workaround to your use case! You can use a function for your logic and then write the variable from global scope instead of nested within the logic itself. Here is a gist of it: http://sassmeister.com/gist/a9619ea180d8b7ea9d4e

…Also @desgnl, Compass 0.12.x is not compatible with Sass 3.3.x. You are probably actually on Sass 3.2.x.

minimaldesign commented 9 years ago

@scottkellum looking at your example but not 100% clear on implementation in that specific case. Would you mind sharing how you'd modify the inuit-generate-spacing mixin? Thanks.

scottkellum commented 9 years ago

@minimaldesign I think this bug is fixed in LibSass and can probably be closed.

minimaldesign commented 9 years ago

Indeed! Just updated to latest libsass and it's now working… Thanks!