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

[scss] Interpolations #68

Closed
tonyganch opened this issue May 17, 2015 · 17 comments
Closed

[scss] Interpolations #68

tonyganch opened this issue May 17, 2015 · 17 comments

Comments

@tonyganch
Copy link
Owner

Interpolations should be parsed correctly almost everywhere when ident is ok.

csscomb/csscomb.js#271

tonyganch added a commit that referenced this issue May 19, 2015
tonyganch added a commit that referenced this issue May 27, 2015
@mel0mani4
Copy link

Hello, do you know when this issue will be fixed ? Because it prevents me from using SC5 Styleguide Generator on my platform :'(
Thank you very very much in advance...

@tonyganch
Copy link
Owner Author

@mel0mani4, can you give me a sample code that fails for you, please? It'll help me write a test and fix this issue faster.

@mel0mani4
Copy link

I had this problem by adding KNACSS and Bourbon code in my project.

Every interpolated variables inside braces (not as selectors) gave me errors, whether it is the "TypeError:
Cannot call method 'toCSS' of undefined" (with KNACSS' interpolations inside braces, in
its _03-grids.scss file) or simply "Parsing error: Please check the validity of the block starting from line #68" (with all the Bourbon interpolations inside braces).

Just try to install Bourbon in your project, and you'll see :)

@mel0mani4 https://github.com/mel0mani4, can you give me a sample code
that fails for you, please? It'll help me write a test and fix this issue
faster.


Reply to this email directly or view it on GitHub
#68 (comment)
.

@igoratron
Copy link

It seems to me gonzales is struggling to understand interpolated property names. See the following SCSS example:

.test { 
  $property: color; 
  #{$property}: black; 
}

Running this through gonzales throws Error: Please check the validity of the CSS block starting from the line #1. Any thoughts on this?

@danoc
Copy link
Contributor

danoc commented Aug 6, 2015

Also running into the issue that @igoratron described. Has anyone looked into it? I'm exploring a fix.

@danoc
Copy link
Contributor

danoc commented Aug 6, 2015

Pretty sure I found the fix. Will write some tests and submit a PR in the next few days.

@karlhorky
Copy link

I would like this to be fixed as well. @danoc did you get any further with the fix?

@danoc
Copy link
Contributor

danoc commented Aug 17, 2015

@karlhorky – Just created a PR with the fix. #80

@karlhorky
Copy link

Awesome, thanks!

@tonyganch
Copy link
Owner Author

Fixed in dev 🍒

@karlhorky
Copy link

Thanks @tonyganch !

@igoratron
Copy link

Excellent news, @tonyganch! Any idea when this will be released?

@danoc
Copy link
Contributor

danoc commented Sep 10, 2015

Thanks for all the hard work, @tonyganch!

Have you written/spoken about this project? I'd love to learn more about it.

@cgtm
Copy link

cgtm commented Oct 2, 2015

@tonyganch I'm running the dev branch (currently 3.0.0-31) and I'm seeing the same problem as @igoratron did above. Specifically, the following code produces an error with the same message as Igor's.

a {
  $attribute: background-color;
  $color: #aaa;
  #{$attribute}: $color;
}

You message above implies this should be fixed now. Is there a more recent version than the one I'm using? Many thanks for any help.

Further: more digging shows my gonzales-pe/lib/scss/parse.js doesn't have, for example, checkIdentOrInterpolation() whereas gonzales-pe/blob/dev/src/scss/parse.js defines it.

@ivnmaksimovic
Copy link

Same here with 3.0.0-31.
Parsing error: Please check validity of the block starting from line #7

left: calc(50% - #{$logo-width / 2});

Syntax: scss
Gonzales PE version: 3.0.0-31

@DanPurdy
Copy link
Collaborator

DanPurdy commented Oct 13, 2016

@ivnmaksimovic this is fixed in the latest versions of gonzales-pe

.test {
  left: calc(50% - #{$logo-width / 2});
}
 -> stylesheet
 | -> ruleset
 | | -> selector
 | | | -> class
 | | | | -> ident
 | | | |    "test"
 | | -> space
 | |    " "
 | | -> block
 | | | -> space
 | | |    "\n"
 | | | -> declaration
 | | | | -> property
 | | | | | -> ident
 | | | | |    "left"
 | | | | -> propertyDelimiter
 | | | |    ":"
 | | | | -> space
 | | | |    " "
 | | | | -> value
 | | | | | -> function
 | | | | | | -> ident
 | | | | | |    "calc"
 | | | | | | -> arguments
 | | | | | | | -> percentage
 | | | | | | | | -> number
 | | | | | | | |    "50"
 | | | | | | | -> space
 | | | | | | |    " "
 | | | | | | | -> operator
 | | | | | | |    "-"
 | | | | | | | -> space
 | | | | | | |    " "
 | | | | | | | -> interpolation
 | | | | | | | | -> variable
 | | | | | | | | | -> ident
 | | | | | | | | |    "logo-width"
 | | | | | | | | -> space
 | | | | | | | |    " "
 | | | | | | | | -> operator
 | | | | | | | |    "/"
 | | | | | | | | -> space
 | | | | | | | |    " "
 | | | | | | | | -> number
 | | | | | | | |    "2"
 | | | -> declarationDelimiter
 | | |    ";"
 | | | -> space
 | | |    "\n"

@ivnmaksimovic
Copy link

@DanPurdy ok. Thanks. I am using SC5 styleguide, but haven't updated it...

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

8 participants