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

Refactored CSS for LeftDrawerOrg #2996

Conversation

dhruuvarora
Copy link

@dhruuvarora dhruuvarora commented Dec 28, 2024

Pull Request Details
Type of Change:
Refactoring

Issue Reference:
Fixes #2900

Description:
This PR improves the UI/UX of the Talawa-Admin by:

Making the application more accessible to color-blind users.
Streamlining all CSS into a single global file: src/style/app.module.css.
Summary of Changes:
Removed all embedded CSS from the relevant file.
Merged embedded CSS into the global app.module.css file.
Used pre-existing CSS patterns for consistency.

Summary by CodeRabbit

Summary by CodeRabbit

  • Refactor

    • Updated styling for left drawer component.
    • Simplified component rendering logic.
    • Migrated from local to global CSS styles.
  • Style

    • Added new CSS classes and variables for improved UI layout and interactivity.
    • Enhanced visual design for buttons, containers, and text elements.
    • Improved animations for drawer visibility.
  • Chores

    • Removed documentation comments to streamline code structure.
    • Deleted obsolete CSS file for left drawer styles.

Copy link
Contributor

coderabbitai bot commented Dec 28, 2024

Walkthrough

The pull request focuses on refactoring the CSS for the LeftDrawerOrg component by moving its styles from a local module CSS file to the global app.module.css. The changes involve deleting the local CSS module, updating the component's styling references, and consolidating styles into a single global CSS file. This refactoring aims to streamline the application's styling approach and improve maintainability.

Changes

File Change Summary
src/components/LeftDrawerOrg/LeftDrawerOrg.module.css Deleted local CSS module file
src/components/LeftDrawerOrg/LeftDrawerOrg.tsx Updated CSS import to use global styles, removed documentation comments
src/style/app.module.css Added new classes for left drawer, organization containers, buttons, and text styles

Assessment against linked issues

Objective Addressed Explanation
Refactor CSS in LeftDrawerOrg.tsx [#2900]
Move embedded CSS to global file
Remove local CSS module

Possibly related issues

Possibly related PRs

Suggested reviewers

  • palisadoes

Poem

🐰 Hop, hop, CSS on the move!
Styles dancing to a global groove
Local modules, now goodbye
One stylesheet reaching for the sky
Refactoring with rabbit delight! 🎨✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
src/components/LeftDrawerOrg/LeftDrawerOrg.tsx (3)

14-14: Use absolute path imports for consistency (optional).
While this relative path import works, converting it to an absolute path (e.g., import styles from 'src/style/app.module.css';) can often improve clarity, especially in larger projects where directory structures can become complex.


108-111: Consider adding accessibility attributes for loading states.
Using a “shimmer” styling is a great approach for placeholders during loading. For the sake of accessibility, consider adding an aria-busy="true" or using a ARIA role to communicate that the content is loading.


115-115: Avoid mixing inline color classes with external classes.
You’re mixing styles.bgDanger, text-start, and text-white in one class list. Ensure these remain consistent with your theming approach and naming conventions. If you plan on theming repeatedly, consider adding a specialized CSS class for this exact style combination.

src/style/app.module.css (1)

3484-3595: Unify with existing drawer transitions and naming practices.
This block introduces new styles for the left drawer transitions (.inactiveDrawer, .activeDrawer, etc.). Ensure that these are consistent with existing transition durations, if any, elsewhere in the codebase. Also, confirm the naming scheme (e.g., hideElemByDefault) is aligned with your typical BEM or utility-class approach for future maintainability.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c5a3000 and 9755f36.

📒 Files selected for processing (3)
  • src/components/LeftDrawerOrg/LeftDrawerOrg.module.css (0 hunks)
  • src/components/LeftDrawerOrg/LeftDrawerOrg.tsx (4 hunks)
  • src/style/app.module.css (1 hunks)
💤 Files with no reviewable changes (1)
  • src/components/LeftDrawerOrg/LeftDrawerOrg.module.css
🔇 Additional comments (2)
src/components/LeftDrawerOrg/LeftDrawerOrg.tsx (2)

62-62: No substantial change detected.
This line appears to be blank or unchanged in a functional sense. No concerns here.


159-168: Align variant and color usage to ensure consistent theming.
While toggling the variant prop and linking activeButton / inactiveButton classes works, double-check that using variant={isActive ? 'success' : ''} aligns with your global theming. If you rely heavily on custom CSS classes, you may not need to specify the Bootstrap variant.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 28, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/components/LeftDrawerOrg/LeftDrawerOrg.tsx (2)

34-34: Consider restoring component documentation

The removed JSDoc comments provided valuable context about the component's purpose and props. While cleaning up styles, it's important to maintain good documentation practices.

Consider restoring the following documentation:

/**
 * LeftDrawerOrg component for displaying organization details and navigation options.
 *
 * @param orgId - ID of the current organization
 * @param targets - List of navigation targets
 * @param hideDrawer - Determines if the drawer should be hidden or shown
 * @param setHideDrawer - Function to update the visibility state of the drawer
 * @returns JSX element for the left navigation drawer with organization details
 */

71-72: Remove extra whitespace lines

Extra whitespace lines were detected. While they don't affect functionality, they should be removed for consistency.

- 
-    // Get the ID from the current path
+ // Get the ID from the current path

- 
-    // Check if the current page is admin profile page
+ // Check if the current page is admin profile page

Also applies to: 77-78

🧰 Tools
🪛 eslint

[error] 71-71: Delete ··

(prettier/prettier)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9755f36 and 8e92e68.

📒 Files selected for processing (1)
  • src/components/LeftDrawerOrg/LeftDrawerOrg.tsx (6 hunks)
🧰 Additional context used
🪛 eslint
src/components/LeftDrawerOrg/LeftDrawerOrg.tsx

[error] 71-71: Delete ··

(prettier/prettier)


[error] 77-77: Delete ··

(prettier/prettier)

🔇 Additional comments (4)
src/components/LeftDrawerOrg/LeftDrawerOrg.tsx (4)

14-14: LGTM: CSS import change aligns with refactoring goals

The change from local to global CSS module import aligns with the PR objective of consolidating styles into app.module.css.


128-131: LGTM: Loading state implementation

The loading state button implementation is clean and uses appropriate CSS classes from the global stylesheet.


179-182: LGTM: Button styling implementation

The button styling implementation correctly uses the global CSS classes and maintains the active/inactive state visual feedback.


Line range hint 1-207: Verify complete CSS migration

The component has been successfully refactored to use global CSS. To ensure no styles were missed:

✅ Verification successful

Let me check the actual content of the CSS classes to ensure they were properly migrated.


CSS migration successfully verified

The verification confirms that:

  • No CSS module files remain in the LeftDrawerOrg component directory
  • All relevant styles have been properly migrated to src/style/app.module.css, including:
    • Layout styles (.leftDrawer)
    • Branding styles (.brandingContainer)
    • Organization section styles (.organizationContainer, .profileContainer)
    • All nested styles for images, text, and responsive behavior
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any remaining CSS module files in the LeftDrawerOrg directory
fd -e css "LeftDrawerOrg\.module\.css$" src/components/LeftDrawerOrg

# Verify all styles were moved to app.module.css
rg -l "leftDrawer|brandingContainer|organizationContainer|profileContainer" src/style/app.module.css

Length of output: 198


Script:

#!/bin/bash
# Check the content of app.module.css for the migrated styles
rg "leftDrawer|brandingContainer|organizationContainer|profileContainer" src/style/app.module.css -A 2

Length of output: 1561

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 28, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 28, 2024
Copy link

codecov bot commented Dec 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.93%. Comparing base (1bc3c5e) to head (bb4f645).

Additional details and impacted files
@@                  Coverage Diff                  @@
##           develop-postgres    #2996       +/-   ##
=====================================================
+ Coverage             26.46%   88.93%   +62.47%     
=====================================================
  Files                   300      321       +21     
  Lines                  7568     8408      +840     
  Branches               1652     1893      +241     
=====================================================
+ Hits                   2003     7478     +5475     
+ Misses                 5434      688     -4746     
- Partials                131      242      +111     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

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

See comment

src/style/app.module.css Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/style/app.module.css (2)

3577-3579: Use CSS variables for consistent theming.

Replace hardcoded color values with CSS variables for better maintainability and consistent theming.

.activeButton {
  background-color: var(--grey-bg-color);
-  color: black;
+  color: var(--bs-black);
}

3576-3584: Add hover and focus states for buttons.

Interactive elements like buttons should have hover and focus states for better accessibility and user experience.

.activeButton {
  background-color: var(--grey-bg-color);
  color: var(--bs-black);
+  transition: background-color 0.2s ease;
}

+.activeButton:hover,
+.activeButton:focus {
+  background-color: var(--grey-border-box-color);
+  outline: 2px solid var(--highlight-color, #a8c7fa);
+}

.inactiveButton {
  background-color: transparent;
  color: var(--bs-secondary);
+  transition: background-color 0.2s ease;
}

+.inactiveButton:hover,
+.inactiveButton:focus {
+  background-color: var(--dropdown-hover-color);
+  outline: 2px solid var(--highlight-color, #a8c7fa);
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c5f3cc7 and 38fedea.

📒 Files selected for processing (1)
  • src/style/app.module.css (2 hunks)
🔇 Additional comments (2)
src/style/app.module.css (2)

3484-3491: LGTM! Core drawer styles follow best practices.

The core drawer styles are well-implemented with:

  • Full viewport height coverage
  • Smooth transitions
  • Proper overflow handling
  • Appropriate padding to prevent content clipping

3493-3503: Great use of transform for animations!

Using transform instead of position properties for drawer animations is excellent for performance as it:

  • Triggers GPU acceleration
  • Reduces layout recalculation
  • Provides smoother animations

src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/style/app.module.css (1)

3519-3564: Enhance maintainability with CSS variables.

Consider the following improvements:

  1. Use CSS variables for padding values
  2. Make image dimensions configurable
 .organizationContainer {
-  padding-right: 3rem;
+  padding-right: var(--drawer-padding-right, 3rem);
 }

 .imageContainer img {
-  width: 40px;
-  height: 40px;
+  width: var(--profile-image-size, 40px);
+  height: var(--profile-image-size, 40px);
   border-radius: 50%;
 }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 38fedea and 5377445.

📒 Files selected for processing (1)
  • src/style/app.module.css (2 hunks)
🔇 Additional comments (3)
src/style/app.module.css (3)

3485-3505: Well-implemented drawer layout and transitions!

Good use of transform for animations and proper overflow handling. The implementation follows performance best practices.


3506-3517: Remove empty rulesets or add documentation.

Several empty CSS rulesets should either be removed if unused or documented if they are intentional placeholders for future use.


3565-3599: ⚠️ Potential issue

Enhance button states and accessibility.

The current implementation has several issues:

  1. Missing hover/focus states for buttons
  2. Lacks non-color indicators for active/inactive states
  3. Uses hardcoded colors instead of CSS variables

Apply these changes to improve the implementation:

 .activeButton {
-  background-color: var(--grey-bg-color);
+  background-color: var(--drawer-active-bg, var(--grey-bg-color));
   color: black;
+  position: relative;
+  border-left: 3px solid var(--drawer-active-border, var(--bs-primary));
+  transition: background-color 0.2s ease;
 }

+.activeButton::before {
+  content: "▶";
+  position: absolute;
+  left: 8px;
+  color: var(--drawer-active-border, var(--bs-primary));
+}

 .inactiveButton {
   background-color: transparent;
   color: var(--bs-secondary);
+  transition: background-color 0.2s ease;
 }

+.activeButton:hover,
+.inactiveButton:hover {
+  background-color: var(--drawer-hover-bg, var(--dropdown-hover-color));
+}

+.activeButton:focus,
+.inactiveButton:focus {
+  outline: 2px solid var(--drawer-focus-color, var(--bs-primary));
+  outline-offset: -2px;
+}

Likely invalid or redundant comment.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 28, 2024
palisadoes
palisadoes previously approved these changes Dec 28, 2024
@palisadoes
Copy link
Contributor

Please fix the conflicting file(s)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/style/app.module.css (2)

3761-3768: LGTM! Consider performance optimization.

The core LeftDrawer styles are well-structured with proper handling of scrolling and positioning. For better performance, consider using transform with will-change property to optimize hardware acceleration.

.leftDrawer {
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.3s ease;
  position: fixed;
  padding-bottom: 1rem;
+ will-change: transform;
}

3795-3840: Enhance accessibility for organization section.

While the implementation is solid, consider adding the following accessibility improvements:

.profileContainer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
+ role: "button";
+ aria-label: "Organization profile";
+ &:focus-visible {
+   outline: 2px solid var(--bs-primary);
+   outline-offset: 2px;
+ }
}

.primaryText {
  font-weight: bold;
+ color: var(--bs-emphasis-color, #000);
}

.secondaryText {
  font-size: 0.9rem;
  color: var(--grey-bg-color);
+ color: var(--bs-secondary-color, #6c757d);
+ @media (prefers-contrast: more) {
+   color: var(--bs-emphasis-color, #000);
+ }
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5377445 and 98268ca.

📒 Files selected for processing (1)
  • src/style/app.module.css (2 hunks)
🔇 Additional comments (3)
src/style/app.module.css (3)

3770-3780: LGTM! Clean implementation of drawer states.

The visibility control classes use transform-based animations which is the recommended approach for performance. The state management is clean and follows best practices.


3782-3793: Remove empty rulesets in branding section.

These empty rulesets should either be removed or populated with actual styles.


3842-3845: Remove empty ruleset for optionList.

The empty ruleset should either be removed or populated with actual styles.

src/style/app.module.css Outdated Show resolved Hide resolved
@palisadoes
Copy link
Contributor

Please make coderabbit.ai approve your changes

@palisadoes
Copy link
Contributor

Please merge your local branch with the latest upstream, commit and then push to your origin.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
src/style/app.module.css (3)

10-10: Enhance color variable naming and accessibility.

The background color should be defined as a semantic variable for better maintainability and accessibility.

- background-color: #f6f8fc;
+ --background-color-primary: #f6f8fc;
+ background-color: var(--background-color-primary);

Consider adding these accessibility-focused variables:

:root {
  /* High-contrast theme colors */
  --color-primary-contrast: #0056b3;
  --color-text-on-primary: #ffffff;
  --color-background-contrast: #f6f8fc;
  
  /* Color-blind safe palette */
  --color-status-success: #2e7d32;
  --color-status-error: #d32f2f;
  --color-status-warning: #ed6c02;
  
  /* Focus indicators */
  --focus-ring-color: #1976d2;
  --focus-ring-width: 2px;
}

4059-4065: Optimize drawer transitions for performance.

The drawer layout is well-structured, but the transitions could be optimized.

 .leftDrawer {
   height: 100vh;
   overflow-y: auto;
-  transition: transform 0.3s ease;
+  transition: transform 0.3s ease-out;
+  will-change: transform;
   position: fixed;
   padding-bottom: 1rem;
+  overscroll-behavior: contain;
 }

These changes will:

  1. Use will-change to optimize transform animations
  2. Add overscroll-behavior to prevent scroll chaining
  3. Use ease-out timing for smoother transitions

4071-4077: Optimize drawer state transitions.

The drawer state transitions could be optimized for better performance.

 .inactiveDrawer {
   transform: translateX(-100%);
+  visibility: hidden;
+  transform: translate3d(-100%, 0, 0);
 }

 .activeDrawer {
   transform: translateX(0);
+  visibility: visible;
+  transform: translate3d(0, 0, 0);
 }

These changes will:

  1. Use translate3d to trigger GPU acceleration
  2. Add visibility for better accessibility
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 98268ca and addb063.

📒 Files selected for processing (1)
  • src/style/app.module.css (3 hunks)
🔇 Additional comments (1)
src/style/app.module.css (1)

4130-4193: 🛠️ Refactor suggestion

Enhance button states and keyboard navigation.

The button states and keyboard navigation could be improved for better accessibility.

 .activeButton {
   background-color: var(--grey-bg-color);
   color: black;
   position: relative;
+  /* Add ARIA state indicator */
+  &[aria-current="true"]::before {
+    content: '';
+    position: absolute;
+    left: 0;
+    top: 0;
+    bottom: 0;
+    width: 3px;
+    background-color: var(--bs-primary);
+  }
+  /* Add focus ring for keyboard navigation */
   &:focus-visible {
     outline: 2px solid var(--bs-primary);
     outline-offset: 2px;
+    box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.25);
   }
+  /* Add pressed state */
+  &:active {
+    transform: translateY(1px);
+  }
 }

 .iconWrapper {
   &[aria-label]:not([aria-label='']) {
     &::after {
       content: attr(aria-label);
+      /* Improve tooltip positioning */
+      transform: translateY(-50%);
+      top: 50%;
+      z-index: 1000;
+      /* Add animation */
+      transition: opacity 0.2s, visibility 0.2s;
     }
   }
 }

These changes will:

  1. Add ARIA state indicators for screen readers
  2. Improve focus styles for keyboard navigation
  3. Add pressed states for better interaction feedback
  4. Enhance tooltip positioning and animation

Likely invalid or redundant comment.

src/style/app.module.css Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (5)
src/style/app.module.css (5)

10-10: Convert hardcoded color to CSS variable.

The background color should use a CSS variable for consistency and maintainability.

-  background-color: #f6f8fc;
+  --app-bg-color: #f6f8fc;
+  background-color: var(--app-bg-color);

4060-4066: Enhance drawer transition properties.

The drawer transition could be more specific to improve performance.

 .leftDrawer {
   height: 100vh;
   overflow-y: auto;
-  transition: transform 0.3s ease;
+  transition: transform 0.3s ease, visibility 0.3s ease;
   position: fixed;
   padding-bottom: 1rem;
 }

4072-4078: Use CSS variables for transform values.

Extract transform values into CSS variables for better maintainability and consistency.

+:root {
+  --drawer-offset: -100%;
+}

 .inactiveDrawer {
-  transform: translateX(-100%);
+  transform: translateX(var(--drawer-offset));
 }

 .activeDrawer {
   transform: translateX(0);
 }

4081-4084: Standardize padding values.

Use consistent padding values through CSS variables.

+:root {
+  --drawer-padding: 3rem;
+}

 .organizationContainer {
-  padding-right: 3rem;
+  padding-right: var(--drawer-padding);
 }

4183-4207: Extract tooltip styles into a reusable class.

The tooltip implementation could be more maintainable by extracting it into a separate class.

+.tooltip {
+  position: relative;
+}
+
+.tooltip::after {
+  content: attr(aria-label);
+  position: absolute;
+  left: 100%;
+  background: var(--bs-dark);
+  color: var(--bs-white);
+  padding: 0.25rem 0.5rem;
+  border-radius: 4px;
+  font-size: 0.875rem;
+  opacity: 0;
+  visibility: hidden;
+}
+
+.tooltip:hover::after {
+  opacity: 1;
+  visibility: visible;
+}

 .iconWrapper {
   display: flex;
   align-items: center;
   margin-right: 8px;
   /* Add tooltip for icon-only buttons */
   &[aria-label]:not([aria-label='']) {
-    position: relative;
-    &::after {
-      content: attr(aria-label);
-      position: absolute;
-      left: 100%;
-      background: var(--bs-dark);
-      color: var(--bs-white);
-      padding: 0.25rem 0.5rem;
-      border-radius: 4px;
-      font-size: 0.875rem;
-      opacity: 0;
-      visibility: hidden;
-    }
-    &:hover::after {
-      opacity: 1;
-      visibility: visible;
-    }
+    @extend .tooltip;
   }
 }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between addb063 and fb2b699.

📒 Files selected for processing (1)
  • src/style/app.module.css (3 hunks)
🔇 Additional comments (1)
src/style/app.module.css (1)

4058-4207: LGTM! The LeftDrawer styles are well-implemented.

The changes successfully:

  • Consolidate styles into the global CSS file
  • Enhance accessibility with proper contrast, focus states, and tooltips
  • Maintain consistent styling through semantic colors and variables

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 29, 2024
@AVtheking
Copy link
Contributor

Please make sure you do not duplicate the css in the app.module.css , do a final check remove any duplications which you have added.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/style/app.module.css (3)

3569-3588: Enhance keyboard navigation and screen reader support.

While the drawer implementation is solid, it could benefit from improved accessibility:

 .leftDrawer {
   height: 100vh;
   overflow-y: auto;
   transition: transform 0.3s ease;
   position: fixed;
   padding-bottom: 1rem;
+  /* Improve keyboard navigation */
+  &:focus-within {
+    outline: 2px solid var(--bs-primary);
+    outline-offset: -2px;
+  }
+  /* Add screen reader support */
+  &[aria-hidden="true"] {
+    display: none;
+  }
 }

3589-3643: Add responsive design improvements for mobile devices.

The organization section could benefit from better mobile support:

 .organizationContainer {
   padding-right: 3rem;
+  /* Add responsive padding */
+  @media (max-width: 768px) {
+    padding-right: 1rem;
+  }
 }

 .profileContainer {
   display: flex;
   align-items: center;
   justify-content: space-between;
   width: 100%;
+  /* Improve mobile layout */
+  @media (max-width: 480px) {
+    flex-direction: column;
+    gap: 0.5rem;
+    text-align: center;
+  }
 }

 .imageContainer img {
   width: 40px;
   height: 40px;
+  /* Adjust image size on small screens */
+  @media (max-width: 480px) {
+    width: 48px;
+    height: 48px;
+  }
 }

3652-3723: Improve CSS organization and reduce specificity.

The button and icon styles could be better organized:

-/* Button specific styles */
+/* Component: Button
+ * Contains styles for active and inactive states,
+ * focus management, and hover effects
+ */

 .button {
+  /* Common button styles */
+  position: relative;
+  transition: background-color 0.2s ease;
+  
+  /* Focus management */
+  &:focus-visible {
+    outline: 2px solid var(--bs-primary);
+    outline-offset: 2px;
+  }
+ }

 .activeButton {
+  composes: button;
   background-color: var(--grey-bg-color);
   color: black;
-  position: relative;
   &::before {
     content: '';
     position: absolute;
     left: 0;
     top: 0;
     bottom: 0;
     width: 3px;
     background-color: var(--bs-primary);
   }
 }

 .inactiveButton {
+  composes: button;
   background-color: transparent;
   color: var(--bs-emphasis-color, #000);
   &:hover {
     background-color: var(--grey-bg-color);
   }
 }

-/* Common focus-visible styles */
-.focus-visible {
-  outline: 2px solid var(--bs-primary);
-  outline-offset: 2px;
-}

-/* Applying the focus-visible class to both buttons */
-.activeButton,
-.inactiveButton {
-  &.focus-visible {
-    outline: 2px solid var(--bs-primary);
-    outline-offset: 2px;
-  }
-}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb2b699 and dafdbe9.

📒 Files selected for processing (1)
  • src/style/app.module.css (3 hunks)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/style/app.module.css (3)

3582-3589: Add keyboard focus management for drawer states.

While the animation implementation is performant using transform, consider adding focus management for better accessibility:

 .activeDrawer {
   transform: translateX(0);
+  /* Ensure drawer content is focusable when visible */
+  &:focus-within {
+    outline: none;
+  }
+  /* Restore focus to first interactive element when opened */
+  &[aria-expanded="true"] {
+    animation: focusFirst 0.1s ease-out;
+  }
 }

 .inactiveDrawer {
   transform: translateX(-100%);
+  /* Prevent focusing hidden elements */
+  &[aria-hidden="true"] {
+    visibility: hidden;
+  }
 }

3590-3644: Enhance color contrast for better accessibility.

While the implementation is good overall, the secondary text color could have better contrast:

 .secondaryText {
   font-size: 0.9rem;
-  color: var(--bs-secondary-text);
+  /* Ensure WCAG 2.1 AA contrast ratio of at least 4.5:1 */
+  color: var(--bs-gray-700, #495057);
 }

3700-3724: Enhance tooltip accessibility.

While the tooltip implementation is good, it could be more accessible:

 .iconWrapper {
   display: flex;
   align-items: center;
   margin-right: 8px;
   /* Add tooltip for icon-only buttons */
   &[aria-label]:not([aria-label='']) {
     position: relative;
+    /* Use aria-describedby for screen readers */
+    &::before {
+      content: '';
+      position: absolute;
+      width: 1px;
+      height: 1px;
+      padding: 0;
+      margin: -1px;
+      overflow: hidden;
+      clip: rect(0, 0, 0, 0);
+      white-space: nowrap;
+      border: 0;
+    }
     &::after {
       content: attr(aria-label);
       position: absolute;
       left: 100%;
       background: var(--bs-dark);
       color: var(--bs-white);
       padding: 0.25rem 0.5rem;
       border-radius: 4px;
       font-size: 0.875rem;
       opacity: 0;
       visibility: hidden;
+      /* Improve tooltip positioning */
+      transform: translateX(8px);
+      transition: all 0.2s ease;
     }
     &:hover::after {
       opacity: 1;
       visibility: visible;
+      transform: translateX(0);
     }
   }
 }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dafdbe9 and 7d8349e.

📒 Files selected for processing (1)
  • src/style/app.module.css (3 hunks)
🔇 Additional comments (2)
src/style/app.module.css (2)

3569-3581: LGTM! Well-structured base styles for the drawer.

The implementation follows best practices with proper positioning, scrolling, and smooth transitions.


3654-3690: 🛠️ Refactor suggestion

Add non-color indicators for active state.

To better support color-blind users and align with the PR objectives:

 .activeButton {
   background-color: var(--grey-bg-color);
   color: black;
   position: relative;
+  /* Add left border and arrow indicator */
   &::before {
     content: '';
     position: absolute;
     left: 0;
     top: 0;
     bottom: 0;
     width: 3px;
     background-color: var(--bs-primary);
   }
+  /* Add arrow indicator */
+  &::after {
+    content: '▶';
+    position: absolute;
+    right: 1rem;
+    top: 50%;
+    transform: translateY(-50%);
+    font-size: 0.8rem;
+  }
 }

Likely invalid or redundant comment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (6)
src/style/app.module.css (6)

3569-3588: Enhance drawer performance and accessibility.

Consider these improvements for the drawer implementation:

  1. Add will-change: transform to optimize animation performance
  2. Add aria-hidden attribute handling for better accessibility
.leftDrawer {
  height: 100vh;
  overflow-y: auto;
-  transition: transform 0.3s ease;
+  transition: transform 0.3s ease;
+  will-change: transform;
  position: fixed;
  padding-bottom: 1rem;
}

.inactiveDrawer {
  transform: translateX(-100%);
+  aria-hidden: true;
}

.activeDrawer {
  transform: translateX(0);
+  aria-hidden: false;
}

3589-3643: Add text overflow handling for profile text.

The profile text containers should handle overflow gracefully to prevent layout issues with long names or descriptions.

.primaryText {
  font-weight: bold;
  color: var(--bs-emphasis-color, #000);
+  max-width: 200px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
}

.secondaryText {
  font-size: 0.9rem;
  color: var(--bs-secondary-text);
+  max-width: 200px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
}

3644-3650: Improve typography for better readability.

Enhance the title header's readability by adding proper spacing and line height.

.titleHeader {
  font-size: 1.2rem;
  color: var(--bs-secondary);
+  line-height: 1.5;
+  margin: var(--spacing-md, 1rem) 0;
}

3651-3674: Enhance visual feedback for indicators.

Improve the visibility and interaction feedback of indicators.

.indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--bs-primary);
+  transition: opacity 0.2s ease;
+  opacity: 0.8;
}

.arrow-indicator {
  content: '▶';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
+  color: var(--bs-emphasis-color, #000);
+  transition: transform 0.2s ease;
}

+.arrow-indicator:hover {
+  transform: translateY(-50%) scale(1.1);
+  opacity: 1;
+}

3675-3703: Improve button state transitions.

Enhance the button states with smooth transitions and better interaction feedback.

.activeButton {
  background-color: var(--grey-bg-color);
  color: black;
  position: relative;
+  transition: all 0.2s ease;

  &::before {
    @extend .indicator;
  }

  &::after {
    @extend .arrow-indicator;
  }
+  
+  &:active {
+    transform: scale(0.98);
+  }
}

.inactiveButton {
  background-color: transparent;
  color: var(--bs-emphasis-color, #000);
+  transition: all 0.2s ease;
  
  &:hover {
    background-color: var(--grey-bg-color);
  }
  
  &.focus-visible {
    @extend .focus-visible;
  }
+  
+  &:active {
+    transform: scale(0.98);
+  }
}

3704-3743: Add motion preferences and RTL support.

Enhance accessibility by respecting user motion preferences and supporting RTL layouts.

.iconWrapper {
  display: flex;
  align-items: center;
  margin-right: 8px;
+  margin-inline-end: 8px;
+  margin-inline-start: 0;
  
  &[aria-label]:not([aria-label='']) {
    position: relative;
    &::after {
      content: attr(aria-label);
      position: absolute;
-      left: 100%;
+      inset-inline-end: auto;
+      inset-inline-start: 100%;
      background: var(--bs-dark);
      color: var(--bs-white);
      padding: 0.25rem 0.5rem;
      border-radius: 4px;
      font-size: 0.875rem;
      opacity: 0;
      visibility: hidden;
-      transform: translateX(8px);
+      transform: translateX(var(--transform-direction, 8px));
      transition: all 0.2s ease;
    }
    
    &:hover::after {
      opacity: 1;
      visibility: visible;
      transform: translateX(0);
    }
  }
}

+@media (prefers-reduced-motion: reduce) {
+  .iconWrapper[aria-label]:not([aria-label=''])::after {
+    transition: none;
+  }
+}

+[dir="rtl"] {
+  .iconWrapper {
+    --transform-direction: -8px;
+  }
+}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d8349e and bb4f645.

📒 Files selected for processing (1)
  • src/style/app.module.css (3 hunks)

@palisadoes
Copy link
Contributor

Please get coderabbit.ai to approve your PR

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
src/style/app.module.css (1)

2-100: Enhance CSS variable organization and documentation.

The CSS variables section could benefit from better organization and documentation:

  1. Some color variables have duplicate definitions (e.g., --grey-bg-color and --table-bg)
  2. Several variables lack clear purpose or usage documentation

Consider reorganizing the variables section:

 :root {
+  /* Theme Colors - Primary */
   --bs-primary: #0056b3;
   --blue-primary: #0056b3;  /* Consider consolidating with bs-primary */
   
+  /* Theme Colors - Secondary */
   --bs-secondary: #6c757d;
   
+  /* Background Colors */
   --grey-bg-color: #eaebef;
   --table-bg: #eaebef;  /* Use --grey-bg-color instead */
   
+  /* Documentation */
+  /* @use: Primary button backgrounds */
   --blue-primary: #0056b3;
+  /* @use: Table backgrounds and hover states */
   --grey-bg-color: #eaebef;
 }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb4f645 and 6d66b23.

📒 Files selected for processing (1)
  • src/style/app.module.css (77 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
src/style/app.module.css

[error] 3747-3747: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)


[error] 3752-3752: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)

🔇 Additional comments (1)
src/style/app.module.css (1)

3634-3891: LGTM! Well-structured reusable classes.

The new reusable classes are well-organized and follow best practices:

  • Text ellipsis handling
  • Consistent focus indicators
  • RTL support
  • Reduced motion preferences
🧰 Tools
🪛 Biome (1.9.4)

[error] 3747-3747: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)


[error] 3752-3752: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)


.inactiveDrawer {
transform: translateX(-100%);
aria-hidden: true; /* NEW */
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix invalid aria-hidden CSS properties.

The static analysis correctly identified invalid CSS properties.

Replace the invalid aria-hidden CSS properties with proper ARIA attributes in the HTML:

- .inactiveDrawer {
-   aria-hidden: true;
- }
+ /* In the HTML/JSX */
+ <div 
+   className="inactiveDrawer"
+   aria-hidden="true"
+ >

Also applies to: 3752-3752

🧰 Tools
🪛 Biome (1.9.4)

[error] 3747-3747: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)

Comment on lines +3731 to +3891
}

.profileText {
margin-left: 1rem;
}

.primaryText {
font-weight: bold;
color: var(--bs-emphasis-color, #000);
@extend .reusable-text-ellipsis; /* NEW */
}

.secondaryText {
font-size: 0.9rem;
color: var(--bs-secondary-text);
@extend .reusable-text-ellipsis; /* NEW */
}

/* Dropdown and options list */
.titleHeader {
font-size: 1.2rem;
color: var(--bs-secondary);
line-height: 1.5; /* NEW */
margin: var(--spacing-md, 1rem) 0; /* NEW */
}

/* Active and inactive buttons */
.activeButton,
.inactiveButton {
position: relative;
transition: all 0.2s ease;

&:active {
transform: scale(0.98);
}

&.focus-visible {
@extend .reusable-focus-visible;
}
}

.activeButton {
background-color: var(--grey-bg-color);
color: black;

&::before {
@extend .reusable-indicator; /* NEW */
}

&::after {
@extend .reusable-arrow-indicator; /* NEW */
}
}

.activeButton:hover .arrow-indicator {
transform: translateY(-50%) scale(1.1);
opacity: 1;
}

.inactiveButton {
background-color: transparent;
color: var(--bs-emphasis-color, #000);

&:hover {
background-color: var(--grey-bg-color);
}
}

/* Icon wrapper styles */
.iconWrapper {
display: flex;
align-items: center;
margin-inline-end: 8px;
margin-inline-start: 0;

&[aria-label]:not([aria-label='']) {
position: relative;

&::after {
content: attr(aria-label);
position: absolute;
inset-inline-start: 100%;
background: var(--bs-dark);
color: var(--bs-white);
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.875rem;
opacity: 0;
visibility: hidden;
transform: translateX(var(--transform-direction, 8px));
transition: all 0.2s ease;
}

&:hover::after {
opacity: 1;
visibility: visible;
transform: translateX(0);
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve accessibility and performance of the LeftDrawer component.

The LeftDrawer implementation has some accessibility and performance concerns:

Apply these improvements:

 .leftDrawer {
   height: 100vh;
   overflow-y: auto;
   transition: transform 0.3s ease;
   will-change: transform;
   position: fixed;
   padding-bottom: 1rem;
+  /* Add overscroll behavior to prevent page scroll bleeding */
+  overscroll-behavior: contain;
+  /* Improve scroll performance */
+  -webkit-overflow-scrolling: touch;
 }

 .inactiveDrawer {
   transform: translateX(-100%);
-  aria-hidden: true;  /* Invalid attribute */
+  /* Use data attribute for aria hidden state */
+  &[data-hidden="true"] {
+    visibility: hidden;
+  }
 }

 .activeDrawer {
   transform: translateX(0);
-  aria-hidden: false;  /* Invalid attribute */
+  /* Use data attribute for aria hidden state */
+  &[data-hidden="false"] {
+    visibility: visible;
+  }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/* LeftDrawer general styles */
.leftDrawer {
height: 100vh; /* Ensure it spans the full height */
overflow-y: auto; /* Enable vertical scrolling */
transition: transform 0.3s ease;
will-change: transform; /* NEW */
position: fixed; /* Ensure it's positioned properly */
padding-bottom: 1rem; /* Prevent last item clipping */
}
.hideElemByDefault {
display: none;
}
.inactiveDrawer {
transform: translateX(-100%);
aria-hidden: true; /* NEW */
}
.activeDrawer {
transform: translateX(0);
aria-hidden: false; /* NEW */
}
/* Organization Section */
.organizationContainer {
padding-right: 3rem;
}
.profileContainer {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
/* Add focus styles for keyboard navigation */
&:focus-within {
@extend .reusable-focus-visible;
}
}
.bg-danger {
background-color: var(--delete-button-color);
}
.text-start {
text-align: start;
}
.text-white {
color: var(--bs-white);
}
.imageContainer img {
width: 40px;
height: 40px;
border-radius: 50%;
/* Add alt text styles */
&[alt] {
font-size: 0.875rem;
color: var(--bs-emphasis-color);
}
}
.profileText {
margin-left: 1rem;
}
.primaryText {
font-weight: bold;
color: var(--bs-emphasis-color, #000);
@extend .reusable-text-ellipsis; /* NEW */
}
.secondaryText {
font-size: 0.9rem;
color: var(--bs-secondary-text);
@extend .reusable-text-ellipsis; /* NEW */
}
/* Dropdown and options list */
.titleHeader {
font-size: 1.2rem;
color: var(--bs-secondary);
line-height: 1.5; /* NEW */
margin: var(--spacing-md, 1rem) 0; /* NEW */
}
/* Active and inactive buttons */
.activeButton,
.inactiveButton {
position: relative;
transition: all 0.2s ease;
&:active {
transform: scale(0.98);
}
&.focus-visible {
@extend .reusable-focus-visible;
}
}
.activeButton {
background-color: var(--grey-bg-color);
color: black;
&::before {
@extend .reusable-indicator; /* NEW */
}
&::after {
@extend .reusable-arrow-indicator; /* NEW */
}
}
.activeButton:hover .arrow-indicator {
transform: translateY(-50%) scale(1.1);
opacity: 1;
}
.inactiveButton {
background-color: transparent;
color: var(--bs-emphasis-color, #000);
&:hover {
background-color: var(--grey-bg-color);
}
}
/* Icon wrapper styles */
.iconWrapper {
display: flex;
align-items: center;
margin-inline-end: 8px;
margin-inline-start: 0;
&[aria-label]:not([aria-label='']) {
position: relative;
&::after {
content: attr(aria-label);
position: absolute;
inset-inline-start: 100%;
background: var(--bs-dark);
color: var(--bs-white);
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.875rem;
opacity: 0;
visibility: hidden;
transform: translateX(var(--transform-direction, 8px));
transition: all 0.2s ease;
}
&:hover::after {
opacity: 1;
visibility: visible;
transform: translateX(0);
}
}
}
/* LeftDrawer general styles */
.leftDrawer {
height: 100vh; /* Ensure it spans the full height */
overflow-y: auto; /* Enable vertical scrolling */
transition: transform 0.3s ease;
will-change: transform; /* NEW */
position: fixed; /* Ensure it's positioned properly */
padding-bottom: 1rem; /* Prevent last item clipping */
/* Add overscroll behavior to prevent page scroll bleeding */
overscroll-behavior: contain;
/* Improve scroll performance */
-webkit-overflow-scrolling: touch;
}
.hideElemByDefault {
display: none;
}
.inactiveDrawer {
transform: translateX(-100%);
/* Use data attribute for aria hidden state */
&[data-hidden="true"] {
visibility: hidden;
}
}
.activeDrawer {
transform: translateX(0);
/* Use data attribute for aria hidden state */
&[data-hidden="false"] {
visibility: visible;
}
}
/* Rest of the CSS remains unchanged */
🧰 Tools
🪛 Biome (1.9.4)

[error] 3747-3747: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)


[error] 3752-3752: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)

src/style/app.module.css Show resolved Hide resolved
Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

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

Replace --light-green with an equivalent blue/grey color
Use the color scheme here as a guide:

  1. https://www.figma.com/design/dmKt00m9GVSeA1nebnkxql/Untitled?node-id=0-1&node-type=canvas&t=TPzfh1DE9IxjzsEe-0
  2. Chore/css changes #2466

Also this is not a light green. You'll need to find a pre-existing blue color of a similar tone in the stylesheet

image

font-weight: 600;
font-size: 20px;
margin-bottom: 30px;
padding-bottom: 5px;
border-bottom: 3px solid #31bb6b;
border-bottom: 3px solid var(--light-green);
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. We are migrating away from the green theme as part of our support for color blind users.
  2. Take cues from other similar elements in this file and the PR mentioned in the issue.
    1. Chore/css changes #2466
    2. https://www.figma.com/design/dmKt00m9GVSeA1nebnkxql/Untitled?node-id=0-1&node-type=canvas&t=TPzfh1DE9IxjzsEe-0

font-weight: 600;
font-size: 18px;
margin-bottom: 20px;
padding-bottom: 5px;
border-bottom: 3px solid #31bb6b;
border-bottom: 3px solid var(--light-green);
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. We are migrating away from the green theme as part of our support for color blind users.
  2. Take cues from other similar elements in this file and the PR mentioned in the issue.
    1. Chore/css changes #2466
    2. https://www.figma.com/design/dmKt00m9GVSeA1nebnkxql/Untitled?node-id=0-1&node-type=canvas&t=TPzfh1DE9IxjzsEe-0

@@ -615,7 +682,7 @@ hr {
.pageNotFound h1.head {
font-size: 250px;
font-weight: 900;
color: #31bb6b;
color: var(--light-green);
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. We are migrating away from the green theme as part of our support for color blind users.
  2. Take cues from other similar elements in this file and the PR mentioned in the issue.
    1. Chore/css changes #2466
    2. https://www.figma.com/design/dmKt00m9GVSeA1nebnkxql/Untitled?node-id=0-1&node-type=canvas&t=TPzfh1DE9IxjzsEe-0

@@ -695,7 +762,7 @@ hr {

.inputFieldPledge {
background-color: var(--bs-white);
box-shadow: 0 1px 1px #31bb6b;
box-shadow: 0 1px 1px var(--light-green);
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. We are migrating away from the green theme as part of our support for color blind users.
  2. Take cues from other similar elements in this file and the PR mentioned in the issue.
    1. Chore/css changes #2466
    2. https://www.figma.com/design/dmKt00m9GVSeA1nebnkxql/Untitled?node-id=0-1&node-type=canvas&t=TPzfh1DE9IxjzsEe-0

@@ -861,7 +928,7 @@ hr {
}

.toggleBtnPledge:hover {
color: #31bb6b !important;
color: var(--light-green) !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. We are migrating away from the green theme as part of our support for color blind users.
  2. Take cues from other similar elements in this file and the PR mentioned in the issue.
    1. Chore/css changes #2466
    2. https://www.figma.com/design/dmKt00m9GVSeA1nebnkxql/Untitled?node-id=0-1&node-type=canvas&t=TPzfh1DE9IxjzsEe-0

@@ -1102,7 +1169,7 @@ hr {
}

.customcell {
background-color: #31bb6b !important;
background-color: var(--light-green) !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. We are migrating away from the green theme as part of our support for color blind users.
  2. Take cues from other similar elements in this file and the PR mentioned in the issue.
    1. Chore/css changes #2466
    2. https://www.figma.com/design/dmKt00m9GVSeA1nebnkxql/Untitled?node-id=0-1&node-type=canvas&t=TPzfh1DE9IxjzsEe-0

@@ -1564,15 +1631,15 @@ hr {
}

.toggleBtn:hover {
color: #31bb6b !important;
color: var(--light-green) !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. We are migrating away from the green theme as part of our support for color blind users.
  2. Take cues from other similar elements in this file and the PR mentioned in the issue.
    1. Chore/css changes #2466
    2. https://www.figma.com/design/dmKt00m9GVSeA1nebnkxql/Untitled?node-id=0-1&node-type=canvas&t=TPzfh1DE9IxjzsEe-0

@@ -1675,10 +1742,10 @@ input[type='radio']:checked + label:hover {

.dropdowns {
background-color: var(--bs-white);
border: 1px solid #31bb6b;
border: 1px solid var(--light-green);
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. We are migrating away from the green theme as part of our support for color blind users.
  2. Take cues from other similar elements in this file and the PR mentioned in the issue.
    1. Chore/css changes #2466
    2. https://www.figma.com/design/dmKt00m9GVSeA1nebnkxql/Untitled?node-id=0-1&node-type=canvas&t=TPzfh1DE9IxjzsEe-0

position: relative;
display: inline-block;
color: #31bb6b;
color: var(--light-green);
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. We are migrating away from the green theme as part of our support for color blind users.
  2. Take cues from other similar elements in this file and the PR mentioned in the issue.
    1. Chore/css changes #2466
    2. https://www.figma.com/design/dmKt00m9GVSeA1nebnkxql/Untitled?node-id=0-1&node-type=canvas&t=TPzfh1DE9IxjzsEe-0

@@ -3314,7 +3381,7 @@ button[data-testid='createPostBtn'] {
display: flex !important;
align-items: center;
background-color: transparent;
color: #31bb6b;
color: var(--light-green);
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. We are migrating away from the green theme as part of our support for color blind users.
  2. Take cues from other similar elements in this file and the PR mentioned in the issue.
    1. Chore/css changes #2466
    2. https://www.figma.com/design/dmKt00m9GVSeA1nebnkxql/Untitled?node-id=0-1&node-type=canvas&t=TPzfh1DE9IxjzsEe-0

@palisadoes
Copy link
Contributor

  1. Closing. Please reopen without refactoring all of src/style/app.module.css
  2. Just what is required for LeftDrawerOrg

@palisadoes palisadoes closed this Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants