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

[css] Support CSS property container-type #170589

Closed
janosh opened this issue Jan 4, 2023 · 30 comments
Closed

[css] Support CSS property container-type #170589

janosh opened this issue Jan 4, 2023 · 30 comments
Assignees
Labels
css-less-scss Issues and items concerning CSS,Less,SCSS styling feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@janosh
Copy link

janosh commented Jan 4, 2023

Support CSS property container-type.

Screenshot 2023-01-04 at 14 41 30

Browser support has grown rapidly in the 2nd half of 2022, now at 76%.

@aeschli aeschli changed the title Support CSS property container-type [css] Support CSS property container-type Jan 11, 2023
@aeschli aeschli added css-less-scss Issues and items concerning CSS,Less,SCSS styling feature-request Request for new features or functionality labels Jan 11, 2023
@aeschli aeschli added this to the Backlog milestone Jan 11, 2023
@rdennis
Copy link

rdennis commented Feb 10, 2023

The features needed for container queries are:

properties

at-rule

length units

  • cqw
  • cqh
  • cqi
  • cqb
  • cqmin
  • cqmax

image

@natirivero
Copy link

+1

1 similar comment
@tummalasujith
Copy link

+1

@titisouven
Copy link

+1
Also other missing properties like x, y and rx (used with svg tag)

@matteorchard
Copy link

+1, lots of support already

@MichalNovotnyCZ
Copy link

+1

1 similar comment
@swashbuck
Copy link

+1

@SelfMadeSystem
Copy link

+1.0000000000000002

@bandarupk
Copy link

When you will release update on this?

@hirasso
Copy link

hirasso commented Apr 20, 2023

People, could you please refrain from posting +1-comments? This puts unnecessary stress on the maintainers. They will take care of this, even without additional noise from the "community".

They actually also took care of creating this amazing free and open source editor everyone of you is using 😄

A more constructive way to communicate your interest in a feature is to add a 👍 emoji to the original post.

Thank you! 🙏

@starball5
Copy link

Related on Stack Overflow: Container-type property and @container rule are not recognized by VS Code?. I'll update my answer there once this is implemented. Cheers and thanks for your team's work!

@msr8
Copy link

msr8 commented Jun 12, 2023

Any way to make the linter ignore this?

@starball5
Copy link

@msr8 see https://stackoverflow.com/a/76125894/11107541

@starball5
Copy link

starball5 commented Jun 18, 2023

@wileycoyote78 I suggest you create a PR with your https://github.com/wileycoyote78/custom-css/blob/main/.vscode/custom-css.json adapted for VS Code.

@wileycoyote78
Copy link

@starball5 forgive my ignorance... PR?

@starball5
Copy link

starball5 commented Jun 19, 2023

@wileycoyote78 "PR" = "Pull Request" :) https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests

@wileycoyote78
Copy link

@starball5 Thanks for the info. I'm afraid I still have questions about this, as I am not all too familiar with GitHub (just know enough to back things up). Since it will be off-topic for this board, I won't ask them here. I'll try to figure it out.

@SIGSTACKFAULT
Copy link

SIGSTACKFAULT commented Aug 6, 2023

+1 considered making a MR but I'm honestly not sure where this data is defined

edit: what did i do?

@FifthTundraG
Copy link

Created a PR in microsoft/vscode-css regarding container, container-name, and container-type. See PR #14.

@andrewfoxunista
Copy link

+1

@starball5
Copy link

wileycoyote78 Also added a PR at microsoft/vscode-css#15

@coolCucumber-cat
Copy link

coolCucumber-cat commented Sep 15, 2023

+ Container properties no longer show as errors
+ Hovering over the properties shows the MDN reference
+ Container query units are display correctly

- Still shows errors for container rules (and incorrect syntax highlighting for the name and params)
- Still no Intellisense in containers (syntax highlighting works but you can't even hover)

@FifthTundraG
Copy link

Commit #193333 officially adds container, container-name, and container-type support. There are still some complications with the addition of @container, though.

@aeschli
Copy link
Contributor

aeschli commented Oct 11, 2023

Parsing support for @container got added by microsoft/vscode-css-languageservice#365

@aeschli aeschli closed this as completed Oct 11, 2023
@aeschli aeschli modified the milestones: Backlog, October 2023 Oct 11, 2023
@aeschli aeschli added the verification-needed Verification of issue is requested label Oct 23, 2023
@aeschli
Copy link
Contributor

aeschli commented Oct 23, 2023

Verify that @container rules parse without validation errors. Search the web for some examples.
Also verify that there's code completion support and color decorators for statements inside rules
Verify that you can use length usints: cqw, cqh, cqi, cqb, cqmin, cqmax

@container (min-width: 700px) {
  .card h2 {
    font-size: max(1.5em, 1.23em + 2cqi);
  }
}

@jrieken jrieken added the verified Verification succeeded label Oct 24, 2023
@lauslim12
Copy link

lauslim12 commented Nov 4, 2023

Hi there! My apologies for commenting on a closed issue. Please let me know if this issue belongs elsewhere or if I should create an issue in another repository. It seems like this problem still persists in SCSS (not CSS), as you can see in the following screenshot:

Screenshot 2023-11-04 at 15 51 25

As you can see from the screenshot above, I'm trying to use cqw in order to implement a text whose font size could fill the parent container. If you take a look at below screenshot, the CSS version is fine.

Screenshot 2023-11-04 at 15 51 50

Is this a known issue? Thank you very much for your help!

For additional information, I'm using the latest version of VSCode and MacOS as the development machine.

$ code --version
1.84.0
d037ac076cee195194f93ce6fe2bdfe2969cc82d
x64

@dalmolinz
Copy link

Still a problem in 1.84.0 (scss)
image
image

@starball5
Copy link

starball5 commented Nov 6, 2023

Is there an issue ticket yet for adding support to SASS/SCSS? Or should one be created?

If anyone creates one, please ping me there with @starball5.

@aeschli
Copy link
Contributor

aeschli commented Nov 7, 2023

Please open a new issue with the sample code to reproduce.

@lauslim12
Copy link

I created an issue here: #197744. Thank you for looking into it!

@github-actions github-actions bot locked and limited conversation to collaborators Nov 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
css-less-scss Issues and items concerning CSS,Less,SCSS styling feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests