Skip to content

Property autocomplete + syntax highlighting does not trigger inside custom directive blocks #423

Open

Description

If you add a new directive to CSS custom data, autocomplete + syntax highlighting does not work within blocks defined by the directive. Mixins are one example where this would be useful:

@define-mixin sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

While this behavior may not be desirable for all directives, it'd be nice to have this as an option for some of them.

Activity

  1. jackholden commented on Mar 19, 2026

    @jackholden

    +1

    I have also just bumped into this whilst using LightningCSS custom transforms. The unknown at-rules warning is gone however so has the syntax highlighting and auto-complete.

    Image

    When I wrap the contents in a div, the syntax highlighting returns, however the auto-complete does not. It would be awesome to have an option to say treat this like a div?

    Image

    Additionally, the @view-transition at-rule does also not have syntax highlighting as of yet so I wonder if there is a current limitation which needs to be addressed beforehand. There is a pre-existing issue.

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions