less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
16.99k stars 3.41k forks source link

Container style queries unexpected space #4235

Open woody-li opened 9 months ago

woody-li commented 9 months ago

To reproduce:

https://lesscss.org/less-preview/#eyJjb2RlIjoiQGNvbnRhaW5lciB0eXBlKC0tdGhlbWU6IGRhcmspe1xuICAubWFpbntcbiAgICBjb2xvcjojMDAwO1xuICB9XG59XG5cbiIsImFjdGl2ZVZlcnNpb24iOiI0LjIuMCIsIm1hdGgiOiJwYXJlbnMtZGl2aXNpb24iLCJzdHJpY3RVbml0cyI6ZmFsc2V9

@container style(--theme: dark){
  .main{
    color: #000;
  }
}

Current behavior: There's a space between "style" and the bracket.

@container style (--theme: dark)

Expected behavior: No space between "style" and the bracket.

@container style(--theme: dark)

Environment information:

haseeb196 commented 9 months ago

Maybe this is not a error the less code is correct but some text editors and Markdown renderers might automatically add a space after type and it does not affect the functionality of the code.

woody-li commented 9 months ago

@haseeb196 But it doesn't take effect in Chrome when contains a space. Seems the "style" is recognized as a function.

matthew-dean commented 8 months ago

Sorry what? AFAIK, @container [function] is not valid, unless you can point to where it is.

woody-li commented 7 months ago

@matthew-dean I don't ensure it's a function. But according to the specification, the style syntax: style( <style-query> ) looks like a function.

Only Chrome has implemented the container style query so far, and it cannot take effect when a space exists between style and bracket.

matthew-dean commented 7 months ago

@woody-li Ah, okay, your issue was written confusingly, because type( would be invalid. (I'm not sure why you didn't write style( in your example?) I see the style( reference now, my bad.

woody-li commented 7 months ago

Sorry for my mistake, it should be style. Thanks

ghazanfarofficial01 commented 7 months ago

How can I contribute to this issue?

BhushanNalawade commented 7 months ago

How to contribute to this issue?