Skip to content

Improve paragraph accessibility in limits reached modals #7161

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

Closed
gtsiolis opened this issue Dec 9, 2021 · 1 comment · Fixed by #7187
Closed

Improve paragraph accessibility in limits reached modals #7161

gtsiolis opened this issue Dec 9, 2021 · 1 comment · Fixed by #7187
Assignees
Labels
team: webapp Issue belongs to the WebApp team type: improvement Improves an existing feature or existing code user experience

Comments

@gtsiolis
Copy link
Contributor

gtsiolis commented Dec 9, 2021

Problem to solve

Text accessibility in limits reached modals fails to pass WCAG AA for normal text which is the WCAG 2.0 level we're aiming for.

<p className="mt-1 mb-2 text-base">You have reached the limit of parallel running workspaces for your account. Please, upgrade or stop one of the running workspaces.</p>

<p className="mt-1 mb-2 text-base">You have reached the limit of monthly workspace hours for your account. Please upgrade to get more hours for your workspaces.</p>

While the current text-base colors for the dark theme in most case passes WCAG AA for normal text when used with the default dark background, it fails when used inside a modal which is using a different background color (dark:bg-gray-900).

<div className={"relative bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-xl p-6 max-w-lg mx-auto text-left text-gray-600 " + (props.className || '')} onClick={e => e.stopPropagation()}>

Proposal

Change the paragraph text color inside modals for the dark theme. 🌔

BEFORE AFTER
modal-before modal-after

The following fix could suffice:

diff --git a/components/dashboard/src/start/CreateWorkspace.tsx b/components/dashboard/src/start/CreateWorkspace.tsx
index b2274168..7b870ba5 100644
--- a/components/dashboard/src/start/CreateWorkspace.tsx
+++ b/components/dashboard/src/start/CreateWorkspace.tsx
@@ -221,13 +221,13 @@ function LimitReachedModal(p: { children: React.ReactNode }) {
 
 function LimitReachedParallelWorkspacesModal() {
   return <LimitReachedModal>
-    <p className="mt-1 mb-2 text-base">You have reached the limit of parallel running workspaces for your account. Please, upgrade or stop one of the running workspaces.</p>
+    <p className="mt-1 mb-2 text-base dark:text-gray-400">You have reached the limit of parallel running workspaces for your account. Please, upgrade or stop one of the running workspaces.</p>
   </LimitReachedModal>;
 }
 
 function LimitReachedOutOfHours() {
   return <LimitReachedModal>
-    <p className="mt-1 mb-2 text-base">You have reached the limit of monthly workspace hours for your account. Please upgrade to get more hours for your workspaces.</p>
+    <p className="mt-1 mb-2 text-base dark:text-gray-400">You have reached the limit of monthly workspace hours for your account. Please upgrade to get more hours for your workspaces.</p>
   </LimitReachedModal>;
 }
 
@championshuttler
Copy link
Contributor

ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: webapp Issue belongs to the WebApp team type: improvement Improves an existing feature or existing code user experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants