From c037a577b00a4ef7fcb0b8a1b7cc736afa1d4b02 Mon Sep 17 00:00:00 2001 From: Andy Edinborough Date: Mon, 12 Sep 2016 13:03:18 -0500 Subject: [PATCH] Set background color for ErrorPage * Set background color for ErrorPage When using various browser developer tools with a dark theme, the text for the page is unreadable, because the background color has not been set, while the foreground color has. * update Designer files --- .../Views/CompilationErrorPage.Designer.cs | 129 ++++----- .../Views/ErrorPage.Designer.cs | 271 +++++++++--------- .../Views/ErrorPage.css | 1 + 3 files changed, 202 insertions(+), 199 deletions(-) diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.Designer.cs b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.Designer.cs index 4e3629dae8..da6c949507 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.Designer.cs +++ b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.Designer.cs @@ -75,6 +75,7 @@ using Microsoft.AspNetCore.Diagnostics.RazorViews font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: .813em; color: #222; + background-color: #fff; } h1, h2, h3, h4, h5 { @@ -127,9 +128,9 @@ body .location { cursor: pointer; } - #header .selected { - ba"); - WriteLiteral(@"ckground: #44c5f2; + #h"); + WriteLiteral(@"eader .selected { + background: #44c5f2; color: #fff; } @@ -186,9 +187,9 @@ body .location { .page table { border-collapse: separate; - border-spacing: 0; - margin:"); - WriteLiteral(@" 0 0 20px; + bo"); + WriteLiteral(@"rder-spacing: 0; + margin: 0 0 20px; } .page th { @@ -243,11 +244,11 @@ a { .rawExceptionStackTrace { font-size: 1.2em; -} +"); + WriteLiteral(@"} .rawExceptionBlock { - "); - WriteLiteral(@" border-top: 1px #ddd solid; + border-top: 1px #ddd solid; border-bottom: 1px #ddd solid; } @@ -274,19 +275,19 @@ a {

"); -#line 221 "CompilationErrorPage.cshtml" +#line 222 "CompilationErrorPage.cshtml" Write(Resources.ErrorPageHtml_CompilationException); #line default #line hidden WriteLiteral("

\r\n"); -#line 222 "CompilationErrorPage.cshtml" +#line 223 "CompilationErrorPage.cshtml" #line default #line hidden -#line 222 "CompilationErrorPage.cshtml" +#line 223 "CompilationErrorPage.cshtml" foreach (var errorDetail in Model.ErrorDetails) { @@ -294,13 +295,13 @@ a { #line hidden WriteLiteral("
\r\n"); -#line 225 "CompilationErrorPage.cshtml" +#line 226 "CompilationErrorPage.cshtml" #line default #line hidden -#line 225 "CompilationErrorPage.cshtml" +#line 226 "CompilationErrorPage.cshtml" var stackFrameCount = 0; var frameId = ""; @@ -310,7 +311,7 @@ a { #line hidden WriteLiteral(" "); -#line 229 "CompilationErrorPage.cshtml" +#line 230 "CompilationErrorPage.cshtml" var fileName = errorDetail.StackFrames.FirstOrDefault()?.File; if (!string.IsNullOrEmpty(fileName)) @@ -320,13 +321,13 @@ a { #line hidden WriteLiteral("
"); -#line 233 "CompilationErrorPage.cshtml" +#line 234 "CompilationErrorPage.cshtml" Write(fileName); #line default #line hidden WriteLiteral("
\r\n"); -#line 234 "CompilationErrorPage.cshtml" +#line 235 "CompilationErrorPage.cshtml" } @@ -334,7 +335,7 @@ a { #line hidden WriteLiteral(" "); -#line 236 "CompilationErrorPage.cshtml" +#line 237 "CompilationErrorPage.cshtml" if (!string.IsNullOrEmpty(errorDetail.ErrorMessage)) { @@ -342,26 +343,26 @@ a { #line hidden WriteLiteral("
"); -#line 238 "CompilationErrorPage.cshtml" +#line 239 "CompilationErrorPage.cshtml" Write(errorDetail.ErrorMessage); #line default #line hidden WriteLiteral("
\r\n"); -#line 239 "CompilationErrorPage.cshtml" +#line 240 "CompilationErrorPage.cshtml" } #line default #line hidden WriteLiteral("
\r\n
\r\n"); -#line 283 "CompilationErrorPage.cshtml" +#line 284 "CompilationErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); -#line 285 "CompilationErrorPage.cshtml" +#line 286 "CompilationErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n
\r\n \r\n"); -#line 289 "CompilationErrorPage.cshtml" +#line 290 "CompilationErrorPage.cshtml" } #line default diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.Designer.cs b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.Designer.cs index 03c05faa8d..3b50340dbf 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.Designer.cs +++ b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.Designer.cs @@ -94,6 +94,7 @@ WriteAttributeValue("", 543, CultureInfo.CurrentUICulture.TwoLetterISOLanguageNa font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: .813em; color: #222; + background-color: #fff; } h1, h2, h3, h4, h5 { @@ -146,9 +147,9 @@ body .location { cursor: pointer; } - #header .selected { - ba"); - WriteLiteral(@"ckground: #44c5f2; + #h"); + WriteLiteral(@"eader .selected { + background: #44c5f2; color: #fff; } @@ -205,9 +206,9 @@ body .location { .page table { border-collapse: separate; - border-spacing: 0; - margin:"); - WriteLiteral(@" 0 0 20px; + bo"); + WriteLiteral(@"rder-spacing: 0; + margin: 0 0 20px; } .page th { @@ -262,11 +263,11 @@ a { .rawExceptionStackTrace { font-size: 1.2em; -} +"); + WriteLiteral(@"} .rawExceptionBlock { - "); - WriteLiteral(@" border-top: 1px #ddd solid; + border-top: 1px #ddd solid; border-bottom: 1px #ddd solid; } @@ -293,19 +294,19 @@ a {

"); -#line 227 "ErrorPage.cshtml" +#line 228 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_UnhandledException); #line default #line hidden WriteLiteral("

\r\n"); -#line 228 "ErrorPage.cshtml" +#line 229 "ErrorPage.cshtml" #line default #line hidden -#line 228 "ErrorPage.cshtml" +#line 229 "ErrorPage.cshtml" foreach (var errorDetail in Model.ErrorDetails) { @@ -313,26 +314,26 @@ a { #line hidden WriteLiteral("
"); -#line 230 "ErrorPage.cshtml" +#line 231 "ErrorPage.cshtml" Write(errorDetail.Error.GetType().Name); #line default #line hidden WriteLiteral(": "); -#line 230 "ErrorPage.cshtml" +#line 231 "ErrorPage.cshtml" Output.Write(HtmlEncodeAndReplaceLineBreaks(errorDetail.Error.Message)); #line default #line hidden WriteLiteral("
\r\n"); -#line 231 "ErrorPage.cshtml" +#line 232 "ErrorPage.cshtml" #line default #line hidden -#line 231 "ErrorPage.cshtml" +#line 232 "ErrorPage.cshtml" var firstFrame = errorDetail.StackFrames.FirstOrDefault(); if (firstFrame != null) @@ -344,7 +345,7 @@ a { #line default #line hidden -#line 237 "ErrorPage.cshtml" +#line 238 "ErrorPage.cshtml" if (!string.IsNullOrEmpty(location) && firstFrame != null && !string.IsNullOrEmpty(firstFrame.File)) { @@ -353,33 +354,33 @@ a { #line hidden WriteLiteral("

"); -#line 240 "ErrorPage.cshtml" +#line 241 "ErrorPage.cshtml" Write(location); #line default #line hidden WriteLiteral(" in

\r\n"); -#line 241 "ErrorPage.cshtml" +#line 242 "ErrorPage.cshtml" } else if (!string.IsNullOrEmpty(location)) { @@ -388,13 +389,13 @@ WriteAttributeValue("", 4966, firstFrame.File, 4966, 16, false); #line hidden WriteLiteral("

"); -#line 244 "ErrorPage.cshtml" +#line 245 "ErrorPage.cshtml" Write(location); #line default #line hidden WriteLiteral("

\r\n"); -#line 245 "ErrorPage.cshtml" +#line 246 "ErrorPage.cshtml" } else { @@ -403,13 +404,13 @@ WriteAttributeValue("", 4966, firstFrame.File, 4966, 16, false); #line hidden WriteLiteral("

"); -#line 248 "ErrorPage.cshtml" +#line 249 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_UnknownLocation); #line default #line hidden WriteLiteral("

\r\n"); -#line 249 "ErrorPage.cshtml" +#line 250 "ErrorPage.cshtml" } var reflectionTypeLoadException = errorDetail.Error as ReflectionTypeLoadException; @@ -422,13 +423,13 @@ WriteAttributeValue("", 4966, firstFrame.File, 4966, 16, false); #line hidden WriteLiteral("

Loader Exceptions:

\r\n \r\n"); -#line 263 "ErrorPage.cshtml" +#line 264 "ErrorPage.cshtml" } } } @@ -458,37 +459,37 @@ WriteAttributeValue("", 4966, firstFrame.File, 4966, 16, false); #line hidden WriteLiteral(" \r\n\r\n
\r\n
\r\n"); -#line 345 "ErrorPage.cshtml" +#line 346 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); -#line 347 "ErrorPage.cshtml" +#line 348 "ErrorPage.cshtml" } #line default @@ -817,40 +818,40 @@ WriteAttributeValue("", 9421, frame.Line + 1, 9421, 17, false);
\r\n
\r\n
\r\n \r\n \r\n"); -#line 361 "ErrorPage.cshtml" +#line 362 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n\r\n
\r\n"); -#line 366 "ErrorPage.cshtml" +#line 367 "ErrorPage.cshtml" #line default #line hidden -#line 366 "ErrorPage.cshtml" +#line 367 "ErrorPage.cshtml" if (Model.Query.Any()) { @@ -858,25 +859,25 @@ WriteAttributeValue("", 10434, exceptionDetailId, 10434, 18, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n"); -#line 376 "ErrorPage.cshtml" +#line 377 "ErrorPage.cshtml" #line default #line hidden -#line 376 "ErrorPage.cshtml" +#line 377 "ErrorPage.cshtml" foreach (var kv in Model.Query.OrderBy(kv => kv.Key)) { foreach (var v in kv.Value) @@ -886,19 +887,19 @@ WriteAttributeValue("", 10434, exceptionDetailId, 10434, 18, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 384 "ErrorPage.cshtml" +#line 385 "ErrorPage.cshtml" } } @@ -906,7 +907,7 @@ WriteAttributeValue("", 10434, exceptionDetailId, 10434, 18, false); #line hidden WriteLiteral(" \r\n
"); -#line 371 "ErrorPage.cshtml" +#line 372 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_VariableColumn); #line default #line hidden WriteLiteral(""); -#line 372 "ErrorPage.cshtml" +#line 373 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_ValueColumn); #line default #line hidden WriteLiteral("
"); -#line 381 "ErrorPage.cshtml" +#line 382 "ErrorPage.cshtml" Write(kv.Key); #line default #line hidden WriteLiteral(""); -#line 382 "ErrorPage.cshtml" +#line 383 "ErrorPage.cshtml" Write(v); #line default #line hidden WriteLiteral("
\r\n"); -#line 388 "ErrorPage.cshtml" +#line 389 "ErrorPage.cshtml" } else { @@ -915,26 +916,26 @@ WriteAttributeValue("", 10434, exceptionDetailId, 10434, 18, false); #line hidden WriteLiteral("

"); -#line 391 "ErrorPage.cshtml" +#line 392 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_NoQueryStringData); #line default #line hidden WriteLiteral("

\r\n"); -#line 392 "ErrorPage.cshtml" +#line 393 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral("
\r\n\r\n
\r\n"); -#line 396 "ErrorPage.cshtml" +#line 397 "ErrorPage.cshtml" #line default #line hidden -#line 396 "ErrorPage.cshtml" +#line 397 "ErrorPage.cshtml" if (Model.Cookies.Any()) { @@ -942,25 +943,25 @@ WriteAttributeValue("", 10434, exceptionDetailId, 10434, 18, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n"); -#line 406 "ErrorPage.cshtml" +#line 407 "ErrorPage.cshtml" #line default #line hidden -#line 406 "ErrorPage.cshtml" +#line 407 "ErrorPage.cshtml" foreach (var kv in Model.Cookies.OrderBy(kv => kv.Key)) { @@ -968,26 +969,26 @@ WriteAttributeValue("", 10434, exceptionDetailId, 10434, 18, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 412 "ErrorPage.cshtml" +#line 413 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n
"); -#line 401 "ErrorPage.cshtml" +#line 402 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_VariableColumn); #line default #line hidden WriteLiteral(""); -#line 402 "ErrorPage.cshtml" +#line 403 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_ValueColumn); #line default #line hidden WriteLiteral("
"); -#line 409 "ErrorPage.cshtml" +#line 410 "ErrorPage.cshtml" Write(kv.Key); #line default #line hidden WriteLiteral(""); -#line 410 "ErrorPage.cshtml" +#line 411 "ErrorPage.cshtml" Write(kv.Value); #line default #line hidden WriteLiteral("
\r\n"); -#line 415 "ErrorPage.cshtml" +#line 416 "ErrorPage.cshtml" } else { @@ -996,26 +997,26 @@ WriteAttributeValue("", 10434, exceptionDetailId, 10434, 18, false); #line hidden WriteLiteral("

"); -#line 418 "ErrorPage.cshtml" +#line 419 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_NoCookieData); #line default #line hidden WriteLiteral("

\r\n"); -#line 419 "ErrorPage.cshtml" +#line 420 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral("
\r\n
\r\n"); -#line 422 "ErrorPage.cshtml" +#line 423 "ErrorPage.cshtml" #line default #line hidden -#line 422 "ErrorPage.cshtml" +#line 423 "ErrorPage.cshtml" if (Model.Headers.Any()) { @@ -1023,25 +1024,25 @@ WriteAttributeValue("", 10434, exceptionDetailId, 10434, 18, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n"); -#line 432 "ErrorPage.cshtml" +#line 433 "ErrorPage.cshtml" #line default #line hidden -#line 432 "ErrorPage.cshtml" +#line 433 "ErrorPage.cshtml" foreach (var kv in Model.Headers.OrderBy(kv => kv.Key)) { foreach (var v in kv.Value) @@ -1051,19 +1052,19 @@ WriteAttributeValue("", 10434, exceptionDetailId, 10434, 18, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 440 "ErrorPage.cshtml" +#line 441 "ErrorPage.cshtml" } } @@ -1071,7 +1072,7 @@ WriteAttributeValue("", 10434, exceptionDetailId, 10434, 18, false); #line hidden WriteLiteral(" \r\n
"); -#line 427 "ErrorPage.cshtml" +#line 428 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_VariableColumn); #line default #line hidden WriteLiteral(""); -#line 428 "ErrorPage.cshtml" +#line 429 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_ValueColumn); #line default #line hidden WriteLiteral("
"); -#line 437 "ErrorPage.cshtml" +#line 438 "ErrorPage.cshtml" Write(kv.Key); #line default #line hidden WriteLiteral(""); -#line 438 "ErrorPage.cshtml" +#line 439 "ErrorPage.cshtml" Write(v); #line default #line hidden WriteLiteral("
\r\n"); -#line 444 "ErrorPage.cshtml" +#line 445 "ErrorPage.cshtml" } else { @@ -1080,13 +1081,13 @@ WriteAttributeValue("", 10434, exceptionDetailId, 10434, 18, false); #line hidden WriteLiteral("

"); -#line 447 "ErrorPage.cshtml" +#line 448 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_NoHeaderData); #line default #line hidden WriteLiteral("

\r\n"); -#line 448 "ErrorPage.cshtml" +#line 449 "ErrorPage.cshtml" } #line default diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.css b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.css index 4d3287c12d..7fd48c1258 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.css +++ b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.css @@ -2,6 +2,7 @@ font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: .813em; color: #222; + background-color: #fff; } h1, h2, h3, h4, h5 {