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

Variable names with -# or _# cause errors #451

Closed
wvankuipers opened this issue Jan 28, 2015 · 13 comments
Closed

Variable names with -# or _# cause errors #451

wvankuipers opened this issue Jan 28, 2015 · 13 comments

Comments

@wvankuipers
Copy link

Hello,

There seems to be a problem with variable names that have a hyphen or underscore followed by a number.

Example:
fontsize-1: 14px;

Generates the following error:

Parsing error: Please check the validity of the block starting from line #1

1*| $fontsize-1: 14px;

This seems to be incorrect, hyphens and underscores followed by a number are valid SASS variable names.

@jpbackman
Copy link
Contributor

Hi @wvankuipers

You're right, they should be allowed. This is an open issue in gonzales-pe which we use to parse the style source and pick up the variable declarations and values, but it's been open for quite a while now.

As a workaround I can only suggest either removing the hyphen or underscore or adding something before the digit, e.g. $fontsize-v1. It might also be beneficial to think of renaming the variable to something more specific and descriptive such as $fontsize-li for clarity, readability and maintainability.

@wvankuipers
Copy link
Author

@jpbackman Ok, should be fixed in gonzales-pe dev now. Guess it will be in stable soon.

@tdogg137
Copy link

I'm running into the same issue with variable name $color-gray-light-20 and I'm using gulp for sc5 styleguide. Does anybody know if this is fixed?

@kvendrik
Copy link

+1 also having this issue

@techsoldaten
Copy link

+1 also having the issue

@hitautodestruct
Copy link

+1

@iegik
Copy link

iegik commented Oct 30, 2015

+1

Generating style guide to output dir: styleguide
Parsing error: Please check validity of the block starting from line #55

53 |             $num: index($types, $type);
54 |             .-pd-#{nth($types_class, $num)}-#{$name} {
55*|                 padding-#{$type}: $padding;
56 |             }
57 |         }

Syntax: scss
Gonzales PE version: 3.0.0-31

@Darrenbydesign
Copy link

+1
anyone know if this issue is fixed yet?

@wvankuipers
Copy link
Author

Yes, this was fixed in gonzales-pe v2.0.2 and the styleguide generator is now on 3.0.0-31.

@kwiss
Copy link

kwiss commented Jan 4, 2016

Parsing error: Please check validity of the block starting from line #255
Syntax: less
Gonzales PE version: 3.0.0-31

@wvankuipers not really ?

@wvankuipers
Copy link
Author

@kwiss It's fixed nu thuis commit I believe tonyganch/gonzales-pe@c9f7f8d

What code are you rating to parse?

@jaynnasc
Copy link

I just installed the style guide and am still seeing this issue. Here is my error:

`Parsing error: Please check validity of the block starting from line #7

5 | @else
6 | .no-padding-#{$side}
7*| padding-#{$side}: 0 !important
9 | =vertical-align

Syntax: sass
Gonzales PE version: 3.0.0-31`

@wvankuipers
Copy link
Author

Nope, you are missing a dot on line 7. It shoud read '.padding-#{$side}: 0 !important' 😉

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