diff --git a/src/ProjectTemplates/Shared/AspNetProcess.cs b/src/ProjectTemplates/Shared/AspNetProcess.cs
index 5c46e6abc504..a620f008fe6d 100644
--- a/src/ProjectTemplates/Shared/AspNetProcess.cs
+++ b/src/ProjectTemplates/Shared/AspNetProcess.cs
@@ -139,7 +139,10 @@ public async Task ContainsLinks(Page page)
foreach (IHtmlLinkElement styleSheet in html.GetElementsByTagName("link"))
{
Assert.Equal("stylesheet", styleSheet.Relation);
- await AssertOk(styleSheet.Href.Replace("about://", string.Empty));
+ // Workaround for https://github.com/dotnet/aspnetcore/issues/31030#issuecomment-811334450
+ // Cleans up incorrectly generated filename for scoped CSS files
+ var styleSheetHref = styleSheet.Href.Replace("_", string.Empty).Replace("about://", string.Empty);
+ await AssertOk(styleSheetHref);
}
foreach (var script in html.Scripts)
{
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Shared/_Layout.cshtml b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Shared/_Layout.cshtml
index c58fb98a2b8c..0ad799723ae6 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Shared/_Layout.cshtml
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Shared/_Layout.cshtml
@@ -6,6 +6,7 @@
@ViewData["Title"] - Company.WebApplication1
+
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Shared/_Layout.cshtml.css b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Shared/_Layout.cshtml.css
new file mode 100644
index 000000000000..a72cbeaf3379
--- /dev/null
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Shared/_Layout.cshtml.css
@@ -0,0 +1,48 @@
+/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
+for details on configuring this project to bundle and minify static web assets. */
+
+a.navbar-brand {
+ white-space: normal;
+ text-align: center;
+ word-break: break-all;
+}
+
+a {
+ color: #0077cc;
+}
+
+.btn-primary {
+ color: #fff;
+ background-color: #1b6ec2;
+ border-color: #1861ac;
+}
+
+.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
+ color: #fff;
+ background-color: #1b6ec2;
+ border-color: #1861ac;
+}
+
+.border-top {
+ border-top: 1px solid #e5e5e5;
+}
+.border-bottom {
+ border-bottom: 1px solid #e5e5e5;
+}
+
+.box-shadow {
+ box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
+}
+
+button.accept-policy {
+ font-size: 1rem;
+ line-height: inherit;
+}
+
+.footer {
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ white-space: nowrap;
+ line-height: 60px;
+}
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/wwwroot/css/site.css b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/wwwroot/css/site.css
index 41726e4ac2a9..f27e5ad20531 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/wwwroot/css/site.css
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/wwwroot/css/site.css
@@ -1,53 +1,13 @@
-/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
-for details on configuring this project to bundle and minify static web assets. */
-
-a.navbar-brand {
- white-space: normal;
- text-align: center;
- word-break: break-all;
-}
-
-a {
- color: #0077cc;
-}
-
-.btn-primary {
- color: #fff;
- background-color: #1b6ec2;
- border-color: #1861ac;
-}
-
-.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
- color: #fff;
- background-color: #1b6ec2;
- border-color: #1861ac;
-}
-
html {
font-size: 14px;
}
+
@media (min-width: 768px) {
html {
font-size: 16px;
}
}
-.border-top {
- border-top: 1px solid #e5e5e5;
-}
-.border-bottom {
- border-bottom: 1px solid #e5e5e5;
-}
-
-.box-shadow {
- box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
-}
-
-button.accept-policy {
- font-size: 1rem;
- line-height: inherit;
-}
-
html {
position: relative;
min-height: 100%;
@@ -55,11 +15,4 @@ html {
body {
margin-bottom: 60px;
-}
-.footer {
- position: absolute;
- bottom: 0;
- width: 100%;
- white-space: nowrap;
- line-height: 60px;
-}
+}
\ No newline at end of file
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Views/Shared/_Layout.cshtml b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Views/Shared/_Layout.cshtml
index ce37eac9145b..553992a8978c 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Views/Shared/_Layout.cshtml
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Views/Shared/_Layout.cshtml
@@ -6,6 +6,7 @@
@ViewData["Title"] - Company.WebApplication1
+
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Views/Shared/_Layout.cshtml.css b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Views/Shared/_Layout.cshtml.css
new file mode 100644
index 000000000000..a72cbeaf3379
--- /dev/null
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Views/Shared/_Layout.cshtml.css
@@ -0,0 +1,48 @@
+/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
+for details on configuring this project to bundle and minify static web assets. */
+
+a.navbar-brand {
+ white-space: normal;
+ text-align: center;
+ word-break: break-all;
+}
+
+a {
+ color: #0077cc;
+}
+
+.btn-primary {
+ color: #fff;
+ background-color: #1b6ec2;
+ border-color: #1861ac;
+}
+
+.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
+ color: #fff;
+ background-color: #1b6ec2;
+ border-color: #1861ac;
+}
+
+.border-top {
+ border-top: 1px solid #e5e5e5;
+}
+.border-bottom {
+ border-bottom: 1px solid #e5e5e5;
+}
+
+.box-shadow {
+ box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
+}
+
+button.accept-policy {
+ font-size: 1rem;
+ line-height: inherit;
+}
+
+.footer {
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ white-space: nowrap;
+ line-height: 60px;
+}
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/wwwroot/css/site.css b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/wwwroot/css/site.css
index 41726e4ac2a9..f27e5ad20531 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/wwwroot/css/site.css
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/wwwroot/css/site.css
@@ -1,53 +1,13 @@
-/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
-for details on configuring this project to bundle and minify static web assets. */
-
-a.navbar-brand {
- white-space: normal;
- text-align: center;
- word-break: break-all;
-}
-
-a {
- color: #0077cc;
-}
-
-.btn-primary {
- color: #fff;
- background-color: #1b6ec2;
- border-color: #1861ac;
-}
-
-.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
- color: #fff;
- background-color: #1b6ec2;
- border-color: #1861ac;
-}
-
html {
font-size: 14px;
}
+
@media (min-width: 768px) {
html {
font-size: 16px;
}
}
-.border-top {
- border-top: 1px solid #e5e5e5;
-}
-.border-bottom {
- border-bottom: 1px solid #e5e5e5;
-}
-
-.box-shadow {
- box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
-}
-
-button.accept-policy {
- font-size: 1rem;
- line-height: inherit;
-}
-
html {
position: relative;
min-height: 100%;
@@ -55,11 +15,4 @@ html {
body {
margin-bottom: 60px;
-}
-.footer {
- position: absolute;
- bottom: 0;
- width: 100%;
- white-space: nowrap;
- line-height: 60px;
-}
+}
\ No newline at end of file
diff --git a/src/ProjectTemplates/test/template-baselines.json b/src/ProjectTemplates/test/template-baselines.json
index c0e547b72ada..55a6d5731494 100644
--- a/src/ProjectTemplates/test/template-baselines.json
+++ b/src/ProjectTemplates/test/template-baselines.json
@@ -22,6 +22,7 @@
"Pages/_ViewImports.cshtml",
"Pages/_ViewStart.cshtml",
"Pages/Shared/_Layout.cshtml",
+ "Pages/Shared/_Layout.cshtml.css",
"Pages/Shared/_LoginPartial.cshtml",
"Pages/Shared/_ValidationScriptsPartial.cshtml",
"Properties/launchSettings.json",
@@ -104,6 +105,7 @@
"Pages/_ViewImports.cshtml",
"Pages/_ViewStart.cshtml",
"Pages/Shared/_Layout.cshtml",
+ "Pages/Shared/_Layout.cshtml.css",
"Pages/Shared/_ValidationScriptsPartial.cshtml",
"Properties/launchSettings.json",
"wwwroot/favicon.ico",
@@ -185,6 +187,7 @@
"Pages/_ViewImports.cshtml",
"Pages/_ViewStart.cshtml",
"Pages/Shared/_Layout.cshtml",
+ "Pages/Shared/_Layout.cshtml.css",
"Pages/Shared/_LoginPartial.cshtml",
"Pages/Shared/_ValidationScriptsPartial.cshtml",
"Properties/launchSettings.json",
@@ -267,6 +270,7 @@
"Pages/_ViewImports.cshtml",
"Pages/_ViewStart.cshtml",
"Pages/Shared/_Layout.cshtml",
+ "Pages/Shared/_Layout.cshtml.css",
"Pages/Shared/_LoginPartial.cshtml",
"Pages/Shared/_ValidationScriptsPartial.cshtml",
"Properties/launchSettings.json",
@@ -349,6 +353,7 @@
"Pages/_ViewImports.cshtml",
"Pages/_ViewStart.cshtml",
"Pages/Shared/_Layout.cshtml",
+ "Pages/Shared/_Layout.cshtml.css",
"Pages/Shared/_ValidationScriptsPartial.cshtml",
"Properties/launchSettings.json",
"wwwroot/favicon.ico",
@@ -430,6 +435,7 @@
"Pages/_ViewImports.cshtml",
"Pages/_ViewStart.cshtml",
"Pages/Shared/_Layout.cshtml",
+ "Pages/Shared/_Layout.cshtml.css",
"Pages/Shared/_LoginPartial.cshtml",
"Pages/Shared/_ValidationScriptsPartial.cshtml",
"Properties/launchSettings.json",
@@ -611,6 +617,7 @@
"Views/Home/Privacy.cshtml",
"Views/Shared/Error.cshtml",
"Views/Shared/_Layout.cshtml",
+ "Views/Shared/_Layout.cshtml.css",
"Views/Shared/_LoginPartial.cshtml",
"Views/Shared/_ValidationScriptsPartial.cshtml",
"wwwroot/favicon.ico",
@@ -692,6 +699,7 @@
"Views/Home/Privacy.cshtml",
"Views/Shared/Error.cshtml",
"Views/Shared/_Layout.cshtml",
+ "Views/Shared/_Layout.cshtml.css",
"Views/Shared/_ValidationScriptsPartial.cshtml",
"wwwroot/favicon.ico",
"wwwroot/css/site.css",
@@ -772,6 +780,7 @@
"Views/Home/Privacy.cshtml",
"Views/Shared/Error.cshtml",
"Views/Shared/_Layout.cshtml",
+ "Views/Shared/_Layout.cshtml.css",
"Views/Shared/_LoginPartial.cshtml",
"Views/Shared/_ValidationScriptsPartial.cshtml",
"wwwroot/favicon.ico",
@@ -853,6 +862,7 @@
"Views/Home/Privacy.cshtml",
"Views/Shared/Error.cshtml",
"Views/Shared/_Layout.cshtml",
+ "Views/Shared/_Layout.cshtml.css",
"Views/Shared/_LoginPartial.cshtml",
"Views/Shared/_ValidationScriptsPartial.cshtml",
"wwwroot/favicon.ico",
@@ -934,6 +944,7 @@
"Views/Home/Privacy.cshtml",
"Views/Shared/Error.cshtml",
"Views/Shared/_Layout.cshtml",
+ "Views/Shared/_Layout.cshtml.css",
"Views/Shared/_ValidationScriptsPartial.cshtml",
"wwwroot/favicon.ico",
"wwwroot/css/site.css",
@@ -1014,6 +1025,7 @@
"Views/Home/Privacy.cshtml",
"Views/Shared/Error.cshtml",
"Views/Shared/_Layout.cshtml",
+ "Views/Shared/_Layout.cshtml.css",
"Views/Shared/_LoginPartial.cshtml",
"Views/Shared/_ValidationScriptsPartial.cshtml",
"wwwroot/favicon.ico",