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

Support for container queries #51

Closed
Dgcim1 opened this issue Mar 7, 2024 · 2 comments · Fixed by #54
Closed

Support for container queries #51

Dgcim1 opened this issue Mar 7, 2024 · 2 comments · Fixed by #54
Labels
enhancement New feature or request

Comments

@Dgcim1
Copy link

Dgcim1 commented Mar 7, 2024

Is there any plan to support for container queries? Browser support is already good enough.

@mr150
Copy link
Owner

mr150 commented Mar 8, 2024

Hi there. Yes, we are currently working on a big release that will have JIT mode and add container queries in it as well

But you don't have to wait and add basic support yourself, right in your config! See the example below:

@use 'sass:map';
@use 'sass:meta';

@use 'mlut/tools' as ml with (
  $utils-data: (
    'utils': (
      'registry': (
        'Ctnt': (
          'properties': container-type,
          'keywords': (
            'is': inline-size,
          ),
        ),
      ),
    ),
  ),
  $at-rules-data: (
    'container': (
      'alias': 'c',
    ),
  ),
);

// using at-rule converter from @supports
ml.$at-rules-db: map.set(
  ml.$at-rules-db,
  'container',
  'converter',
  meta.get-function('convert-ar-supports', false, ml),
);

@include ml.apply('@c:mnw600_P5u Ctnt-is');

CSS output:

@container (min-width: 600px) {
  .\@c\:mnw600_P5u {
    padding: 1.25rem;
  }
}
.Ctnt-is {
  container-type: inline-size;
}

@mr150 mr150 added the enhancement New feature or request label Mar 8, 2024
@Dgcim1
Copy link
Author

Dgcim1 commented Mar 10, 2024

Wow, thanks, it works! Looking forward to JIT mode!

@mr150 mr150 linked a pull request Apr 26, 2024 that will close this issue
@mr150 mr150 closed this as completed in #54 Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants