Skip to content

Specifying multiple parameters in nested elements #7

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

Closed
snowe2010 opened this issue Apr 17, 2016 · 7 comments
Closed

Specifying multiple parameters in nested elements #7

snowe2010 opened this issue Apr 17, 2016 · 7 comments
Assignees

Comments

@snowe2010
Copy link

I'm trying specify multiple font families, but I'm getting errors.

  font: {
    family: 'Raleway', Arial, sans-serif
    weight: 500
  }

results in

compiling... [Error: ParseError: C:\Users\Tyler\Dropbox\Tyler\personal\projects\roots\starboardservices_rewrite\assets\css\header.css.styl:37:31
   33|
   34| .links
   35|   background: #fff
   36|   font: {
   37|     family: 'Raleway', Arial, sans-serif
-------------------------------------^
   38|     weight: 500
   39|   }
   40|   text: {

expected ":", got ","
]

Potentially unhandled rejection [36] ParseError: C:\Users\Tyler\Dropbox\Tyler\personal\projects\roots\starboardservices_rewrite\assets\css\header.css.styl:37:31
   33|
   34| .links
   35|   background: #fff
   36|   font: {
   37|     family: 'Raleway', Arial, sans-serif
-------------------------------------^
   38|     weight: 500
   39|   }
   40|   text: {

expected ":", got ","

Any clue what I'm doing wrong?

Also, I'm using stylus with postcss processors like Lost and nested props.

@jednano
Copy link
Owner

jednano commented Apr 18, 2016

Does it work if you un-nest them?

@snowe2010
Copy link
Author

Yes.

@jednano
Copy link
Owner

jednano commented Apr 18, 2016

Doesn't appear to be anything wrong w/ your syntax. Do you think you could create a failing test in the form of a PR?

@snowe2010
Copy link
Author

I will try!

@jednano
Copy link
Owner

jednano commented Aug 29, 2016

@snowe2010, are you still having this issue? The following test works just fine for me:

it('parses multiple parameters in nested elements', () => {
    check(
        `a{font:{family:'Raleway', Arial, sans-serif;\nweight:500}}`,
        `a{font-family:'Raleway', Arial, sans-serif;font-weight:500}`
    );
});

Can you try to update the PostCSS parser and see if that fixes it? Try version 5.1.2.

Note: I do get errors if I don't put the semi-colon in there, which is why I'm a bit suspicious that the PostCSS parser might be actually having an issue.

@snowe2010
Copy link
Author

I haven't worked on this project in a while, but as soon as I get back to it (which should be soon) I'll test it out again.

@jednano
Copy link
Owner

jednano commented Jan 20, 2017

This issue is stale. Closing until further notice.

@jednano jednano closed this as completed Jan 20, 2017
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

2 participants