-
Notifications
You must be signed in to change notification settings - Fork 50
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
Color of menu buttons should adhere to Main Event Color #210
Conversation
…color should be available for scroll over
Reviewer's Guide by SourceryThis pull request implements changes to the color scheme of menu buttons to adhere to the main event color. It introduces new SCSS functions and mixins to handle color contrast and applies these to the button styles in the agenda view. Sequence DiagramsequenceDiagram
participant U as User
participant B as Button
participant S as SCSS
U->>B: Hover over button
B->>S: Request hover styles
S->>S: Call is-dark() function
S->>S: Determine text color with contrast-color mixin
S-->>B: Apply hover styles (background and text color)
B-->>U: Display updated button appearance
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @lcduong - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider using a standardized method for determining color contrast instead of magic numbers in the brightness calculation.
- Look into extracting common styles for
&:hover
and&.active
states into a separate mixin to reduce code duplication.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -43,20 +43,50 @@ header { | |||
} | |||
} | |||
|
|||
@function is-dark($color) { |
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.
suggestion: Consider using a standardized method for calculating contrast ratios
While the current implementation is a good start, using a method aligned with WCAG guidelines could provide more accurate results across a wider range of colors.
@function is-dark($color) {
$luminance: (0.2126 * red($color) + 0.7152 * green($color) + 0.0722 * blue($color)) / 255;
@return $luminance < 0.5;
}
.btn-outline-success { | ||
color: $brand-primary; | ||
border-color: $brand-primary; | ||
|
||
&:hover { | ||
background-color: $brand-primary; | ||
@include contrast-color($brand-primary); | ||
} |
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.
suggestion: Reduce duplication in hover and active states
Consider using a placeholder selector or a mixin to reduce the repetition of background-color and @include contrast-color for both :hover and .active states. This would improve maintainability and reduce the risk of inconsistencies if these styles need to be updated in the future.
.btn-outline-success {
color: $brand-primary;
border-color: $brand-primary;
@mixin active-state {
background-color: $brand-primary;
@include contrast-color($brand-primary);
}
&:hover, &.active {
@include active-state;
}
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.
When the color is dark we need the font color to switch to white to have a good readable contrast.
Hi @mariobehling, updated to change font color when background color is dard |
…color should be available for scroll over
This PR closes/references issue #206 . It does so by use the main color to set the button color
How has this been tested?
Checklist
Summary by Sourcery
Update the menu button colors to adhere to the main event color, enhancing the visual consistency of the interface. Introduce a function and mixin to dynamically adjust text color based on background brightness for improved readability.
Enhancements: