aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Regression: CSS isolation not applying all styles in Blazor Server .NET 10

Open vsfeedback opened this issue 1 month ago • 3 comments

This issue has been moved from a ticket on Developer Community.


[regression] [worked-in:Visual Studio Version 2026 18.0.2] Environment:

Blazor Server Web App

.NET 10.0.100 SDK

Visual Studio 18.0.2 (Community)

EF Core Power Tools latest

SSMS 22

No Azure services involved

Steps to reproduce:

Create a new Blazor Server Web App project in .NET 10.

Copy existing components and CSS files (App.css, MainCss.css, DefaultCss.css, etc.) into wwwroot/lib.

Add <link> references in App.razor (or host page).

Apply a theme class to <body> (e.g., class="Free-0").

Run the app.

Expected behavior:

Global CSS variables (--Main, etc.) defined in MainCss.css should be recognized.

Dropdowns and other styles should apply as they did in earlier Blazor versions.

Actual behavior:

FontAwesome icons load correctly.

Some CSS rules apply (basic styles).

Dropdown styles and theme variables (--Main) show as “not defined” in dev tools.

Isolation seems to block or ignore certain global styles.

Notes:

Worked in previous Blazor versions.

Regression observed after upgrading to .NET 10 templates.

TheProjectName.styles.css loads, but global CSS doesn’t cascade into isolated components.

Possible gap in CSS isolation pipeline.


Original Comments

Feedback Bot on 12/3/2025, 07:32 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

vsfeedback avatar Dec 03 '25 22:12 vsfeedback

It would be useful to have a minimal repository with reproduction.

ilonatommy avatar Dec 04 '25 15:12 ilonatommy

Thank you for filing this issue. In order for us to investigate this issue, please provide a minimal repro project that illustrates the problem without unnecessary code. Please share with us in a public GitHub repo because we cannot open ZIP attachments, and don't include any confidential content.

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.