From a48a0be0a4a192ab593fcbe4790ba7ac0fec0bd6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Oct 2021 13:53:23 -0700 Subject: [PATCH] [release/6.0] Accessibility fixes in templates (#37525) * Color contrast changes. Fixes 1412465 * Add "lang" attribute to <html>. Fixes 1411915 * Instruct screen readers to read out server-side validation messages. Fixes 1411027 Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com> --- src/Identity/UI/src/Areas/Identity/Pages/V4/_Layout.cshtml | 2 +- .../UI/src/Areas/Identity/Pages/V5/Account/ExternalLogin.cshtml | 2 +- .../src/Areas/Identity/Pages/V5/Account/ForgotPassword.cshtml | 2 +- .../UI/src/Areas/Identity/Pages/V5/Account/Login.cshtml | 2 +- .../UI/src/Areas/Identity/Pages/V5/Account/LoginWith2fa.cshtml | 2 +- .../Identity/Pages/V5/Account/LoginWithRecoveryCode.cshtml | 2 +- .../Identity/Pages/V5/Account/Manage/ChangePassword.cshtml | 2 +- .../Identity/Pages/V5/Account/Manage/DeletePersonalData.cshtml | 2 +- .../UI/src/Areas/Identity/Pages/V5/Account/Manage/Email.cshtml | 2 +- .../Identity/Pages/V5/Account/Manage/EnableAuthenticator.cshtml | 2 +- .../UI/src/Areas/Identity/Pages/V5/Account/Manage/Index.cshtml | 2 +- .../Areas/Identity/Pages/V5/Account/Manage/SetPassword.cshtml | 2 +- .../UI/src/Areas/Identity/Pages/V5/Account/Register.cshtml | 2 +- .../Identity/Pages/V5/Account/ResendEmailConfirmation.cshtml | 2 +- .../UI/src/Areas/Identity/Pages/V5/Account/ResetPassword.cshtml | 2 +- src/Identity/UI/src/Areas/Identity/Pages/V5/_Layout.cshtml | 2 +- .../content/BlazorServerWeb-CSharp/Pages/Error.cshtml | 2 +- .../content/BlazorServerWeb-CSharp/Shared/SurveyPrompt.razor | 2 +- .../content/BlazorServerWeb-CSharp/wwwroot/css/site.css | 2 +- .../Client/Shared/SurveyPrompt.razor | 2 +- .../ComponentsWebAssembly-CSharp/Client/wwwroot/css/app.css | 2 +- .../ComponentsWebAssembly-CSharp/Client/wwwroot/index.html | 2 +- .../ComponentsWebAssembly-CSharp/Server/Pages/Error.cshtml | 2 +- .../content/StarterWeb-FSharp/Views/Shared/_Layout.cshtml | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V4/_Layout.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V4/_Layout.cshtml index f3af76940bd..ca54b43f377 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V4/_Layout.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V4/_Layout.cshtml @@ -3,7 +3,7 @@ @inject IWebHostEnvironment Environment @inject ICompositeViewEngine Engine <!DOCTYPE html> -<html> +<html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ExternalLogin.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ExternalLogin.cshtml index 9f7537451a1..eb838fc7672 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ExternalLogin.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ExternalLogin.cshtml @@ -17,7 +17,7 @@ <div class="row"> <div class="col-md-4"> <form asp-page-handler="Confirmation" asp-route-returnUrl="@Model.ReturnUrl" method="post"> - <div asp-validation-summary="ModelOnly" class="text-danger"></div> + <div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div> <div class="form-floating"> <input asp-for="Input.Email" class="form-control" autocomplete="email" /> <label asp-for="Input.Email" class="form-label"></label> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ForgotPassword.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ForgotPassword.cshtml index 43aa1120d3a..704576801c2 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ForgotPassword.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ForgotPassword.cshtml @@ -10,7 +10,7 @@ <div class="row"> <div class="col-md-4"> <form method="post"> - <div asp-validation-summary="ModelOnly" class="text-danger"></div> + <div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div> <div class="form-floating"> <input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" /> <label asp-for="Input.Email" class="form-label"></label> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Login.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Login.cshtml index dc4511e7aed..5dc1c572dfe 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Login.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Login.cshtml @@ -12,7 +12,7 @@ <form id="account" method="post"> <h2>Use a local account to log in.</h2> <hr /> - <div asp-validation-summary="ModelOnly" class="text-danger"></div> + <div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div> <div class="form-floating"> <input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" /> <label asp-for="Input.Email" class="form-label"></label> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/LoginWith2fa.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/LoginWith2fa.cshtml index 38088ed8299..f117a6b4e45 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/LoginWith2fa.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/LoginWith2fa.cshtml @@ -11,7 +11,7 @@ <div class="col-md-4"> <form method="post" asp-route-returnUrl="@Model.ReturnUrl"> <input asp-for="RememberMe" type="hidden" /> - <div asp-validation-summary="ModelOnly" class="text-danger"></div> + <div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div> <div class="form-floating"> <input asp-for="Input.TwoFactorCode" class="form-control" autocomplete="off" /> <label asp-for="Input.TwoFactorCode" class="form-label"></label> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/LoginWithRecoveryCode.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/LoginWithRecoveryCode.cshtml index b45cefe3a33..503fbf16166 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/LoginWithRecoveryCode.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/LoginWithRecoveryCode.cshtml @@ -13,7 +13,7 @@ <div class="row"> <div class="col-md-4"> <form method="post"> - <div asp-validation-summary="ModelOnly" class="text-danger"></div> + <div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div> <div class="form-floating"> <input asp-for="Input.RecoveryCode" class="form-control" autocomplete="off" /> <label asp-for="Input.RecoveryCode" class="form-label"></label> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/ChangePassword.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/ChangePassword.cshtml index d130b8e8ae8..3bcae81e716 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/ChangePassword.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/ChangePassword.cshtml @@ -10,7 +10,7 @@ <div class="row"> <div class="col-md-6"> <form id="change-password-form" method="post"> - <div asp-validation-summary="ModelOnly" class="text-danger"></div> + <div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div> <div class="form-floating"> <input asp-for="Input.OldPassword" class="form-control" autocomplete="current-password" aria-required="true" /> <label asp-for="Input.OldPassword" class="form-label"></label> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/DeletePersonalData.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/DeletePersonalData.cshtml index 17f5a30b4bb..cbc1a7a5704 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/DeletePersonalData.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/DeletePersonalData.cshtml @@ -15,7 +15,7 @@ <div> <form id="delete-user" method="post"> - <div asp-validation-summary="ModelOnly" class="text-danger"></div> + <div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div> @if (Model.RequirePassword) { <div class="form-floating"> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/Email.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/Email.cshtml index 9464333256b..8a251c0c296 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/Email.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/Email.cshtml @@ -10,7 +10,7 @@ <div class="row"> <div class="col-md-6"> <form id="email-form" method="post"> - <div asp-validation-summary="All" class="text-danger"></div> + <div asp-validation-summary="All" class="text-danger" role="alert"></div> @if (Model.IsEmailConfirmed) { <div class="form-floating input-group"> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/EnableAuthenticator.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/EnableAuthenticator.cshtml index 5bec220561a..8742fd3fa47 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/EnableAuthenticator.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/EnableAuthenticator.cshtml @@ -40,7 +40,7 @@ <span asp-validation-for="Input.Code" class="text-danger"></span> </div> <button type="submit" class="w-100 btn btn-lg btn-primary">Verify</button> - <div asp-validation-summary="ModelOnly" class="text-danger"></div> + <div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div> </form> </div> </div> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/Index.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/Index.cshtml index 1d0e00f459a..47f9fe22124 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/Index.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/Index.cshtml @@ -10,7 +10,7 @@ <div class="row"> <div class="col-md-6"> <form id="profile-form" method="post"> - <div asp-validation-summary="ModelOnly" class="text-danger"></div> + <div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div> <div class="form-floating"> <input asp-for="Username" class="form-control" disabled /> <label asp-for="Username" class="form-label"></label> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/SetPassword.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/SetPassword.cshtml index dd5827f012a..05af7edb569 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/SetPassword.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/SetPassword.cshtml @@ -14,7 +14,7 @@ <div class="row"> <div class="col-md-6"> <form id="set-password-form" method="post"> - <div asp-validation-summary="ModelOnly" class="text-danger"></div> + <div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div> <div class="form-floating"> <input asp-for="Input.NewPassword" class="form-control" autocomplete="new-password" /> <label asp-for="Input.NewPassword" class="form-label"></label> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Register.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Register.cshtml index e8ff83bc013..578b1a58a10 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Register.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Register.cshtml @@ -11,7 +11,7 @@ <form id="registerForm" asp-route-returnUrl="@Model.ReturnUrl" method="post"> <h2>Create a new account.</h2> <hr /> - <div asp-validation-summary="ModelOnly" class="text-danger"></div> + <div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div> <div class="form-floating"> <input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" /> <label asp-for="Input.Email"></label> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResendEmailConfirmation.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResendEmailConfirmation.cshtml index ccce148ebd2..c9c4dd097ba 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResendEmailConfirmation.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResendEmailConfirmation.cshtml @@ -10,7 +10,7 @@ <div class="row"> <div class="col-md-4"> <form method="post"> - <div asp-validation-summary="All" class="text-danger"></div> + <div asp-validation-summary="All" class="text-danger" role="alert"></div> <div class="form-floating"> <input asp-for="Input.Email" class="form-control" aria-required="true" /> <label asp-for="Input.Email" class="form-label"></label> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResetPassword.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResetPassword.cshtml index d8114b63744..494c0bf5dc0 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResetPassword.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResetPassword.cshtml @@ -10,7 +10,7 @@ <div class="row"> <div class="col-md-4"> <form method="post"> - <div asp-validation-summary="ModelOnly" class="text-danger"></div> + <div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div> <input asp-for="Input.Code" type="hidden" /> <div class="form-floating"> <input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" /> diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/_Layout.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/_Layout.cshtml index 5efab86cc6f..b0cc26fd2fc 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V5/_Layout.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/_Layout.cshtml @@ -3,7 +3,7 @@ @inject IWebHostEnvironment Environment @inject ICompositeViewEngine Engine <!DOCTYPE html> -<html> +<html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/Error.cshtml b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/Error.cshtml index c8647bbda9a..edad5873281 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/Error.cshtml +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/Error.cshtml @@ -2,7 +2,7 @@ @model BlazorServerWeb_CSharp.Pages.ErrorModel <!DOCTYPE html> -<html> +<html lang="en"> <head> <meta charset="utf-8" /> diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Shared/SurveyPrompt.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Shared/SurveyPrompt.razor index 989e27cd160..e3e6429c168 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Shared/SurveyPrompt.razor +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Shared/SurveyPrompt.razor @@ -4,7 +4,7 @@ <span class="text-nowrap"> Please take our - <a target="_blank" class="font-weight-bold" href="https://go.microsoft.com/fwlink/?linkid=2149017">brief survey</a> + <a target="_blank" class="font-weight-bold link-dark" href="https://go.microsoft.com/fwlink/?linkid=2149017">brief survey</a> </span> and tell us what you think. </div> diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/wwwroot/css/site.css b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/wwwroot/css/site.css index 74db5be92e0..1f4b8cf3160 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/wwwroot/css/site.css +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/wwwroot/css/site.css @@ -9,7 +9,7 @@ h1:focus { } a, .btn-link { - color: #0077cc; + color: #0071c1; } .btn-primary { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/Shared/SurveyPrompt.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/Shared/SurveyPrompt.razor index a51711199c9..962027fcc56 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/Shared/SurveyPrompt.razor +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/Shared/SurveyPrompt.razor @@ -4,7 +4,7 @@ <span class="text-nowrap"> Please take our - <a target="_blank" class="font-weight-bold" href="https://go.microsoft.com/fwlink/?linkid=2148851">brief survey</a> + <a target="_blank" class="font-weight-bold link-dark" href="https://go.microsoft.com/fwlink/?linkid=2148851">brief survey</a> </span> and tell us what you think. </div> diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/css/app.css b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/css/app.css index ad8acaed55d..9cd148f7d53 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/css/app.css +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/css/app.css @@ -9,7 +9,7 @@ h1:focus { } a, .btn-link { - color: #0077cc; + color: #0071c1; } .btn-primary { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/index.html b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/index.html index 05ab141a623..fe965c6249d 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/index.html +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/index.html @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html> +<html lang="en"> <head> <meta charset="utf-8" /> diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Pages/Error.cshtml b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Pages/Error.cshtml index 145c1ee8470..ba383d3f8b8 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Pages/Error.cshtml +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Pages/Error.cshtml @@ -2,7 +2,7 @@ @model ComponentsWebAssembly_CSharp.Server.Pages.ErrorModel <!DOCTYPE html> -<html> +<html lang="en"> <head> <meta charset="utf-8" /> diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Views/Shared/_Layout.cshtml b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Views/Shared/_Layout.cshtml index 21a95455c93..54d84c3ee3d 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Views/Shared/_Layout.cshtml +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Views/Shared/_Layout.cshtml @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html> +<html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> -- GitLab