Skip to content
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

Remove Hardcoded Color for Button Hover State in QuizStatus.vue #12645

Merged
merged 6 commits into from
Sep 12, 2024

Conversation

shivam-daksh
Copy link
Contributor

Summary

This PR removes the hardcoded hover background color in the QuizStatus.vue component and replaces it with a dynamic color using the new $darken utility functions provided by the Kolibri Design System.

...

Context:

The hover background color for buttons in the QuizStatus.vue component was previously hardcoded (#A81700). This approach reduces flexibility and maintainability, especially when applying theme variations. To address this, the newly implemented $darken utilities ($darken1, $darken2, $darken3) will be used to generate a darker shade of the base red color, ensuring consistent theming throughout the UI.

Code Changes:

  1. Removed the hardcoded hover color #A81700.
  2. Applied the $darken1 utility to derive the hover color dynamically based on the existing red color ($themePalette.red.v_1100).

Example of the changes made:

// Before: Hardcoded color
':hover': { 'background-color': '#A81700' },

// After: Using the $darken utility
':hover': { 'background-color': $darken1($themePalette.red.v_1100) },

References

#12553

Reviewer guidance


Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Sep 6, 2024
@shivam-daksh
Copy link
Contributor Author

Hi @MisRob, please review this PR referenced to #12553 .

Copy link
Member

@nucleogenesis nucleogenesis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it locally and the hover color works & looks great! Thanks for this!

@@ -349,7 +349,7 @@
// palette.red.v_1100 is the darkest available red
// in the palette. Using this hardcoded color was
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you remove this whole comment before we merge? It's not needed anymore, as $darken is now supported and documented technique.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MisRob , please check it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, all good :)!

@shivam-daksh shivam-daksh requested a review from MisRob September 11, 2024 14:57
@MisRob
Copy link
Member

MisRob commented Sep 12, 2024

Thanks @shivam-daksh and @nucleogenesis!

@MisRob MisRob merged commit 16b0baf into learningequality:develop Sep 12, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants