Skip to content

[CSS] Remove extra indent for multiline :where, :is and :not selectors #16165

@GrimLink

Description

@GrimLink

Prettier 3.2.5
Playground link

--parser css
--tab-width 4

Input:

:where(input:not([type="button"], [type="reset"], [type="submit"]), textarea, select) {
    /* CSS here */
}

Output:

:where(
        input:not([type="button"], [type="reset"], [type="submit"]),
        textarea,
        select
    ) {
    /* CSS here */
}

Expected output:

:where(
    input:not([type="button"], [type="reset"], [type="submit"]),
    textarea,
    select
) {
    /* CSS here */
}

Why?

The extra indent added when wrapping, the extra indent should not be needed, it makes more sense to format the :where, :is and :not selectors with a single indentation based on the tab-width as shown in the Expected output

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:css/scss/lessIssues affecting CSS, Less or SCSSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions