Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Invalid property name #641

Closed
Closed

Description

@matthewlein

Hello,

I was testing out my grid generator file in sassmeister with libsass 3.0.1 and I get Invalid property name errors. The line numbers seem way off where the problem is, maybe from loops, so I haven't had much luck reducing it down.

I know it doesn't like .#{$namespace}--1,

I haven't been able to test in 3.0.2, I'm not really sure how to do that.

Here's the whole thing, maybe it will have useful test cases in it:
http://sassmeister.com/gist/4d1336034073b8cc3dee

Activity

  1. xzyfer commented on Nov 14, 2014

    @xzyfer
    Contributor

    I managed to reduce the test case down to what's causing the issue and it's exactly as you pointed out.

    .#{"foo"}--1 { a:a }

    Looks like <interpolant>--<number> isn't handled correctly.

  2. matthewlein commented on Nov 14, 2014

    @matthewlein
    Author

    Great. Thanks for doing that.

  3. xzyfer commented on Nov 14, 2014

    @xzyfer
    Contributor

    Thanks for reporting this!

    Could you please add a spec in https://github.com/sass/sass-spec ?

    Here's an example of a good spec PR for reference https://github.com/sass/sass-spec/pull/89/files

  4. matthewlein commented on Nov 16, 2014

    @matthewlein
    Author

    Here you go sass/sass-spec#135

    If you need anything else on that, let me know.

    While digging in it a little, I found that interestingly, this works just fine:

    $grid-columns: 4;
    
    @for $i from 1 through $grid-columns {
      @for $j from 1 through $grid-columns {
        @if $j > $i {
          .#{"bar"}--#{$i}_#{$j} {
            width: percentage( $i/$j );
          }
        }
      }
    }
    

    When it interpolates the number from the loop var, it has no problem.

  5. matthewlein commented on Nov 16, 2014

    @matthewlein
    Author

    .#{"foo"}--#{'1'} { width:100%; } is probably a simpler way of saying that. :)

    This works fine, and might be a workaround for me for now.

  6. xzyfer commented on Nov 16, 2014

    @xzyfer
    Contributor

    Makes sense. Interpolations (#{}) and numbers are treated differently. Thanks for this, I'll dig into it.

  7. self-assigned this
    on Dec 2, 2014
  8. modified the milestone: on Dec 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions