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

Typing a semi-colon in code block in a Blazor page is causing CSS indentation to be flattened if @code contains an attribute #11417

Open
jimmylewis opened this issue Jan 24, 2025 · 0 comments

Comments

@jimmylewis
Copy link
Contributor

jimmylewis commented Jan 24, 2025

Reduced repro sample page:

@page "/list"

<style>
    .form-container {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin: auto;
        padding: 1rem;
    }

    .form-group {
        display: flex;
        flex-direction: row;
    }

        .form-group label {
            margin-bottom: 0.5rem;
            width: 150px;
        }
</style>

@code {
    [Parameter]
    public int? StoredItemId { get; set; }

    private string product = "Vs";
}

Repro steps:

  • type a ; anywhere in the @code block

Expected:
no changes to the rest of the file

Actual:
CSS block gets flattened to a single level of indentation (every line has 4 space indent)

Format Document or selecting the CSS and doing Format Selection will fix it., but it's really annoying.

I'm using VS 17.14.0 Preview 1.0 [35714.230.main]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant