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

Cannot compile nested multiple variables with latest 1_4_0 #1042

Closed
alexo opened this issue Nov 19, 2012 · 16 comments
Closed

Cannot compile nested multiple variables with latest 1_4_0 #1042

alexo opened this issue Nov 19, 2012 · 16 comments

Comments

@alexo
Copy link

alexo commented Nov 19, 2012

I've tested the latest version from branch 1_4_0 and apparently it fails for the following example (which works correctly with 1.3.1):

    @xxx: 4px;
    @variable: 10;

    first:something(@variable), second:pseudoclass(@xxx) {
      @xxx: 'string';
      @variable: 'other';

      declaration: value;

      nested1:length(@xxx), nested2:content(@variable) {
        declaration: value;
      }
      nested3:content(@variable), nested4:length(@xxx) {
        declaration: value;
      }
    }

    first:something(@variable), second:pseudoclass(@xxx) {
      @xxx: 'string';
      @variable: 'other';

      declaration: value;

      nested1:length(@xxx), nested2:content(@variable) {
        declaration: value;
        deep1:length(@xxx), deep2:content(@variable) {
          declaration: 1 2;
        }
        deep3, deep4 {
          declaration: 3 4;
        }
      }
    }

The error message is:

{
  "type": "Parse",
  "message": "Syntax Error on line 4",
  "index": 43.0,
  "filename": null,
  "line": 4.0,
  "column": 16.0,
  "extract": [
    "",
    "first:something(@variable), second:pseudoclass(@xxx) {",
    "  @xxx: 'string';"
  ]
@lukeapage
Copy link
Member

first:something(@variable), second:pseudoclass(@xxx) {

needs to be (at the moment on 1.4.0)

first:something(@{variable}), second:pseudoclass(@{xxx}) {

this matches the replaced selector format, e.g.

.@{a} {
}

@alexo
Copy link
Author

alexo commented Nov 20, 2012

Just wondering, wouldn't this test-case make the new version (1.4.0) incompatible with previous versions?

@lukeapage
Copy link
Member

yes, 1.4.0 will have lots of breaking changes in it. We are putting all the breaking changes into 1.4.0 with new big features and putting bug fixes into 1.3.2

@lukeapage
Copy link
Member

we have yet to commit the main breaking change to 1.4.0 which is that all calculations must be done in brackets.

@gaurav21r
Copy link

+1
Bootstrap is not compiling with LESS 1.4

1.4 has extends functionality. Can it be merged into 1.3.2 with backward compatibility? #1048

@lukeapage
Copy link
Member

Extend isn't finished.. I'm about to push some more changes.. so no, it
doesn't make sense. Please encourage bootstrap to use the new format and
therefore require 1.3.1.

@gaurav21r
Copy link

@agatronic I didn't understand "require 1.3.1". Will 1.3.1 have extends functionality when it is finished?
Also please check the issue and pull request at #1048 It allows extend-like functionality in 1.3.1. Can it be merged?

@mdo
Copy link

mdo commented Nov 28, 2012

@agatronic Do you have a succinct list of changes for 1.4 going yet, perhaps with examples? I'd love to make Bootstrap ready for 1.4. Any info you guys have to share would be most helpful :).

@lukeapage
Copy link
Member

I say require 1.3.1 because the breaking changes in 1.4.0 can be avoided by using things supported in 1.3.1

@mdo there are only 2 things you need to do

  1. Put all operations into brackets

  2. replace

    ~(@{a}) {
    }

or

:nth-child(@a)

with

@{a} {
}
:nth-child(@a)

both are supported in 1.3.1

Since brackets requirement is not in the 1.4.0 branch yet, the problem in this bug was (2)

@gaurav21r
Copy link

@mdo THanks for responding to my request but can we move the issue back to (twbs/bootstrap#6037) ? The original issue is getting ignored.

@agatronic @cloudhead Can you please give me feedback on the pull request at #1048 as mentioned above? It will add the much needed support for having Standard CSS Selectors as mixins. And its within the scope of 1.3.1

@lukeapage
Copy link
Member

@gaurav21r the scope of 1.3.x releases is mainly bug fixes and critical issues and documentation, to get less back on track. I don't have any big objection to your feature (or I would have said something) but I marked it low priority because there are other things lots of people have been asking for, for a long long time. If you or anyone else has a pull request and @MatthewDL agrees to it (he is rightfully stricter than me - someone has to me) and cloudhead doesn't disagree, then we could move it into 1.4 or 1.3.2

@matthew-dean
Copy link
Member

The strictness is my German DNA, mixed with American obnoxiousness, tempered only by living in Canada.

What am I agreeing to? This thread sort of jumps around.

@matthew-dean
Copy link
Member

Related to @mdo's question: can we put together documentation for 1.4.0 before we actually launch that version? I'd also love it if we did something like a "Gold Master" for 1.4.0. That is, there's no changes, but it's not released as a build yet. That could give time for Crunch, Simpless, Less.app to update apps for launch. Same thing with Bootstrap. With the breaking changes, we should give them a chance to manage the transition, and to have apps ready to compile Bootstrap.

My conservatism is due to the fact that I want devs to think of LESS as reliable. I think all the breaking changes are good and necessary, but they are also a big deal and I want the fewest people surprised. Maybe we can do something as simple as documenting the old syntax vs. new.

@mdo
Copy link

mdo commented Dec 3, 2012

@MatthewDL Yes, please!

@gaurav21r
Copy link

Hi @MatthewDL Yea this thread sure does jump around!!!

As for What am I agreeing to?, kindly refer to the thread and pull request at #1048 and we can continue the discussion there. @agatronic has no objections to the feature. @cloudhead , @MatthewDL , waiting for your feedback please.

@matthew-dean
Copy link
Member

Commented on the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants