less.js icon indicating copy to clipboard operation
less.js copied to clipboard

Container style queries unexpected space

Open woody-li opened this issue 2 years ago • 14 comments

To reproduce:

https://lesscss.org/less-preview/#eyJjb2RlIjoiQGNvbnRhaW5lciBzdHlsZSgtLXRoZW1lOiBkYXJrKXtcbiAgLm1haW57XG4gICAgY29sb3I6IzAwMDtcbiAgfVxufVxuXG4iLCJhY3RpdmVWZXJzaW9uIjoiNC4yLjAiLCJtYXRoIjoicGFyZW5zLWRpdmlzaW9uIiwic3RyaWN0VW5pdHMiOmZhbHNlfQ==

@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:

  • less version: 4.2.0

woody-li avatar Sep 26 '23 01:09 woody-li

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.

haseeb196 avatar Sep 26 '23 16:09 haseeb196

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

woody-li avatar Sep 27 '23 01:09 woody-li

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

matthew-dean avatar Oct 30 '23 15:10 matthew-dean

@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.

woody-li avatar Nov 13 '23 02:11 woody-li

@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.

matthew-dean avatar Nov 13 '23 13:11 matthew-dean

Sorry for my mistake, it should be style. Thanks

woody-li avatar Nov 14 '23 00:11 woody-li

How can I contribute to this issue?

ghazanfarofficial01 avatar Nov 21 '23 20:11 ghazanfarofficial01

How to contribute to this issue?

BhushanNalawade avatar Dec 01 '23 06:12 BhushanNalawade