-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
CSS Isolation fails when @Layout is set to null #32491
Comments
@msschl thanks for contacting us. #h1-main h1 {
color: red;
} Does not match anything on the page. You likely want to say |
Oh, sry my bad. I mixed <!DOCTYPE html>
b-0pr8yvohll<html b-0pr8yvohll lang="en">
<head>
<meta b-0pr8yvohll charset="utf-8" />
<meta b-0pr8yvohll name="viewport" content="width=device-width, initial-scale=1.0" />
<title b-0pr8yvohll>Home Page - tmp</title>
<link rel="stylesheet" href="/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="/css/site.css" />
<link b-0pr8yvohll rel="stylesheet" href="tmp.styles.css" />
</head>
<body>
<header b-0pr8yvohll>
<nav b-0pr8yvohll class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div b-0pr8yvohll class="container">
<a class="navbar-brand" href="/">tmp</a>
<button b-0pr8yvohll class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span b-0pr8yvohll class="navbar-toggler-icon"></span>
</button>
<div b-0pr8yvohll class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul b-0pr8yvohll class="navbar-nav flex-grow-1">
<li b-0pr8yvohll class="nav-item">
<a class="nav-link text-dark" href="/">Home</a>
</li>
<li b-0pr8yvohll class="nav-item">
<a class="nav-link text-dark" href="/Home/Privacy">Privacy</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div b-0pr8yvohll class="container">
<main b-0pr8yvohll role="main" class="pb-3">
<div b-0pr8yvohll class="text-center">
<h1 b-0pr8yvohll id="h1-main" class="display-4">Welcome</h1>
<p b-0pr8yvohll>Learn about <a b-0pr8yvohll href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>
</main>
</div>
<footer b-0pr8yvohll class="border-top footer text-muted">
<div b-0pr8yvohll class="container">
© 2021 - tmp - <a href="/Home/Privacy">Privacy</a>
</div>
</footer>
<script src="/lib/jquery/dist/jquery.min.js"></script>
<script src="/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="/js/site.js?v=4q1jwFhaPaZgr8WAUSrux6hAuh0XDg9kPS3xIVq36I0"></script>
<script src="/_framework/aspnetcore-browser-refresh.js"></script></body>
</html> |
Sry I was a bit inaccurate while describing the issue I was having. The issue was not that CSS isolation isn't working, but rather there is a bit of text added after the doctype. I am sry, I should have been a bit clearer with what I meant. |
Ok thanks 👍🏽 |
Describe the bug
Using css isolation with a
@Layout
set tonull
results in css isolation failing.To Reproduce
Index.cshtml
to this version:Index.cshtml.css
Results in the following:
Further technical details
ASP.NET Core version:
ASP.NET Core in .NET 6 Preview 3
Include the output of
dotnet --info
vscode 1.56.0
The text was updated successfully, but these errors were encountered: