Skip to content

[less] css-varvalueexpected when using more complicated variable assignment statements #141

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
kevinramharak opened this issue Jan 4, 2019 · 7 comments
Assignees
Milestone

Comments

@kevinramharak
Copy link

The following code will compile correctly on [email protected]

// mixin namespace: http://lesscss.org/features/#mixins-feature-namespaces
#util() {
    .mixin() {
        @result: 1;
    }
}

.mixin() {
  @result: 2;
}

// property / value accessors: http://lesscss.org/features/#mixins-feature-mixins-as-functions-feature
@var: #util.mixin()[];
@other: .mixin()[];

:root {
  --var: @var;
  --other: @other;
}

The #util part of @var: #util.convert... will signal a css-varvalueexpected error as wil the . from @other: .mixin()[]

Might be related to #134

@kevinramharak
Copy link
Author

I just noticed #135, tough my understanding of the source code is very limited so i cannot tell if that PR solves this problem

@ThePlenkov
Copy link

I can confirm I have same working with less.

Just copying examples from here http://lesscss.org/features/#maps-feature it's easy to reproduce.

@ghost
Copy link

ghost commented Jul 5, 2019

Hellow,

Same here using multiple guarded namespaces and ref-link them to a variable as shown below. You can copy and paste this code on this online Less compiler (which uses Less 3.9.0), so its valid Less code!

@color: light;

#scheme() when (@color = light){
    primary: #f0f0f0;
    secondary: #000000;
    /* [...] */
}
#scheme() when (@color = dark){
    primary: #121212;
    secondary: #FFFFFF;
    /* [...] */
}

@primary: #scheme[primary]; // <-- "scheme" gets an error with css-varvalueexpected!
@secondary: #scheme[secondary]; // <-- It's fine, doesn't get shown as error!

.my-color{
    color: @primary;
}

less

Sincerely,
Sam.

@kevinramharak
Copy link
Author

I tested the cases as written above. All seems to be working with the merging + shipping of #135. Thanks for the effort!

@DATEx2
Copy link

DATEx2 commented Jan 30, 2025

I am still getting lint warnings for valid CSS code

@view-transition {
    navigation: auto;
} 

@aeschli
Copy link
Collaborator

aeschli commented Feb 3, 2025

@DATEx2 can you file an new issue? @view-transition is quite new and not yet adopted by all browsers

@gegoune
Copy link

gegoune commented Feb 22, 2025

can you file an new issue? @view-transition is quite new and not yet adopted by all browsers

#425

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

6 participants