-
Notifications
You must be signed in to change notification settings - Fork 437
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
fixing accesibility issues in the cookie setting #2715
fixing accesibility issues in the cookie setting #2715
Conversation
Hello @tdonohue i will fix the bug |
src/styles/_global-styles.scss
Outdated
@@ -1,3 +1,7 @@ | |||
:root { | |||
--green1: #4de0b4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this is specific to Klaro, we should add a comment here to say something like:
// Specify a different green color for for Klaro cookie notice. ONLY used for Klaro.
Either that, or we see if there's a way to move this color into the .klaro
classes below... that may mean not using the variable though and just overriding the CSS colors directly.
Basically though, we need to document why this --green1
exists, so that other developers do NOT use it in other areas of DSpace.
Hello @tdonohue I already moved the variable to the classes. I had to set !important for the styles to be applied. |
@@ -1,3 +1,7 @@ | |||
// :root { | |||
// --green1: #4de0b4; | |||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this commented out code? It doesn't appear to have a purpose any longer.
Hi @tdonohue, could you assign me here as a reviewer? My team contributed some accessibility issues so we can go through this |
@michdyk : To add you as an assignee, you have to be a "developer" in the DSpace github. I've just sent you an invite. That said, you do not need to be assigned in order to do a review/test of a PR. You are welcome to review/test any PR you want without being assigned...all reviews are welcome. |
.klaro | ||
.cookie-notice | ||
.cm-btn.cm-btn-success { | ||
color: #333333 !important; | ||
background-color: #4de0b4 !important; | ||
} | ||
|
||
.klaro | ||
.cookie-notice | ||
a{ | ||
color: #4de0b4 !important; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In your code, the usage of !important is unnecessary. Instead, you can enhance the specificity of your selectors and leverage SCSS's features to avoid duplicating selectors. Here's an example of how your code can be refactored to eliminate the need for !important:
.klaro,
.cookie-notice,
.cn-buttons {
.cm-btn.cm-btn-success {
color: #333333;
background-color: #4de0b4;
}
a {
color: #4de0b4;
}
}
Additionally, it seems you've deviated from the approach of using new variables. The variable --green1
is used in the Klaro class and it works perfectly. I believe the original intention was to use this variable for maintainability and consistency. Here's how the code should look with the variable:
:root {
--green1: #4de0b4; // This variable represents the success color for the Klaro cookie banner
--button-text-color: #333; // This variable represents the text color for buttons in the Klaro cookie banner
}
.klaro,
.cookie-notice,
.cn-buttons {
.cm-btn.cm-btn-success {
color: var(--button-text-color);
background-color: var(--green1);
}
a {
color: var(--green1);
}
}
I do not know what is the hexadecimal code of --green1, but please use WebAIMs ContrastChecker to check the accessibility of the colors you intend to use. |
Closing as this was replaced by #3039 |
References
Description
Cookie setting menu accesibility bug fixed.
Instructions for Reviewers
i have fixed the issues about contrast in the cookie settings.
According to the klaro documentation i needed to add a :root variable.
List of changes in this PR:
Include guidance for how to test or review your PR. This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
yarn lint
yarn check-circ-deps
)