Skip to content

task: Clean-up .card mixin#102

Merged
ianpaschal merged 1 commit intodevelopfrom
task-100-clean-up-card-mixin
Jun 30, 2025
Merged

task: Clean-up .card mixin#102
ianpaschal merged 1 commit intodevelopfrom
task-100-clean-up-card-mixin

Conversation

@ianpaschal
Copy link
Owner

@ianpaschal ianpaschal commented Jun 30, 2025

#100

Summary by CodeRabbit

  • Style
    • Unified and simplified card component styling across the app for improved consistency.
    • Enhanced visual appearance of popovers, menus, and cards with more consistent elevation and corner styles.
    • Reduced redundant background color and border-radius declarations for a cleaner look.

@vercel
Copy link

vercel bot commented Jun 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
combat-command ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2025 7:03am

@coderabbitai
Copy link

coderabbitai bot commented Jun 30, 2025

Walkthrough

Styling across multiple SCSS modules was refactored to consolidate card, corner, and shadow styles by enhancing the variants.card mixin to accept an $elevated parameter. Individual mixin calls for corners and shadows were removed in favor of the updated variants.card, simplifying and unifying component style declarations.

Changes

File(s) Change Summary
src/style/_variants.scss Enhanced card mixin: added $elevated param, now includes corners, shadows, and conditional elevation.
src/components/AccountMenu/AccountMenu.module.scss
src/components/AvatarEditable/AvatarEditable.module.scss
src/components/MatchResultPlayers/MatchResultPlayers.module.scss
src/components/generic/DataTable/DataTable.module.scss
src/components/generic/InputDateTime/InputDateTime.module.scss
src/components/generic/InputLocation/InputLocation.module.scss
src/components/generic/PopoverMenu/PopoverMenu.module.scss
src/pages/TournamentsPage/TournamentsPage.module.scss
Replaced separate mixin calls for corners/shadows with variants.card($elevated: true); removed explicit background and border-radius where present.
src/components/MatchResultCard/MatchResultCard.module.scss
src/components/TournamentCard/TournamentCard.module.scss
src/components/generic/Card/Card.module.scss
Removed shadows.surface and corners.normal mixins; retained or adjusted card variant styling.
src/components/ToastProvider/ToastProvider.module.scss Removed corners.wide mixin; updated variants.card to use $elevated: true.

Sequence Diagram(s)

sequenceDiagram
    participant Component as Any Component
    participant SCSS as SCSS Module
    participant Variants as variants.card Mixin

    Component->>SCSS: Use .class with variants.card($elevated: true/false)
    SCSS->>Variants: Call @mixin card($elevated)
    Variants->>SCSS: Apply corners, shadows, and elevation based on $elevated
    SCSS->>Component: Render styled component
Loading

Poem

🐇✨
A hop, a skip, a style anew,
Card corners round and shadows grew.
One mixin call, less code to sprawl,
With $elevated standing tall.
Now every card, with style combined,
Looks extra sharp—refined, aligned!
—Your rabbit, styling on the line.


🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

@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 (11)
src/style/_variants.scss (1)

3-4: Unreferenced module import – consider dropping @use "/src/style/shadows" unless it produces global CSS

shadows is now only referenced inside this same file, so keeping the @use here is fine.
However, if no other rules from /src/style/shadows emit top-level CSS, you could instead rely on the implicit load that happens when this file itself includes shadows.* mixins later on and remove the explicit @use to keep import noise to a minimum.
Totally optional – feel free to ignore if you prefer explicitness.

src/components/generic/DataTable/DataTable.module.scss (1)

1-8: shadows is no longer used in this file

After migrating to variants.card, the direct @use "/src/style/shadows" on line 4 appears unused.
Removing it will shave a few cycles off the Sass compiler and avoid confusion.

src/components/AvatarEditable/AvatarEditable.module.scss (1)

1-8: Unused imports after refactor

@use "/src/style/shadows"; and @use "/src/style/corners"; are no longer referenced in this module.
Consider deleting them to keep the dependency list lean.

src/components/ToastProvider/ToastProvider.module.scss (1)

1-6: corners namespace appears unused

Since the wide-corner mixin was removed, @use "/src/style/corners"; (line 1) may now be redundant.

src/components/generic/InputDateTime/InputDateTime.module.scss (2)

22-33: Redundant overrides defeat the purpose of the unified mixin

variants.card($elevated: true) already provides background colour and radius.
Re-declaring them (lines 30-31) introduces duplication and a maintenance hotspot.
Unless you need a different radius or colour here, consider deleting those two lines.


1-6: Drop unused shadows import

After switching to the enhanced card mixin, direct calls to shadows.* are gone, so the @use "/src/style/shadows"; on line 4 can likely be removed.

src/pages/TournamentsPage/TournamentsPage.module.scss (1)

1-4: Drop unused shadows import & avoid dead code

After consolidating shadow logic into variants.card($elevated: true) the explicit @use "/src/style/shadows"; is no longer needed and will be flagged by most SCSS linters.

-@use "/src/style/shadows";

Removing it keeps the dependency graph clean and avoids accidental regression if the mixin name changes later.

Also applies to: 14-15

src/components/generic/InputLocation/InputLocation.module.scss (1)

3-5: Duplicate overrides & unused import

  1. variants.card already sets background-color and border-radius; the explicit declarations a few lines below are redundant.
  2. @use "/src/style/shadows"; is now unused.
-@use "/src/style/shadows";-  background-color: var(--card-bg);
-  border-radius: variables.$corner-radius;

Removing these keeps styles DRY and prevents divergence if the token changes in the mixin.

Also applies to: 9-10, 19-21

src/components/generic/PopoverMenu/PopoverMenu.module.scss (1)

1-5: Clean-up after mixin consolidation

variants.card($elevated: true) replaces the need for:

  • The shadows import (nothing in this file references it now).
  • The explicit background-color override.
-@use "/src/style/shadows";-  background-color: var(--card-bg);

This trims the bundle and avoids future inconsistencies.

Also applies to: 13-14, 18-19

src/components/AccountMenu/AccountMenu.module.scss (1)

1-6: Remove stale shadows dependency

variants.card($elevated: true) now encapsulates elevation, so the shadows module is unused in this sheet.

-@use "/src/style/shadows";

Minor tidy-up that avoids superfluous compilation overhead.

Also applies to: 19-21

src/components/MatchResultPlayers/MatchResultPlayers.module.scss (1)

1-4: Unreferenced shadows module

Similar to other modules in this PR, the local file no longer calls any mixins from /src/style/shadows.

-@use "/src/style/shadows";

Pruning it keeps imports minimal and maintainable.

Also applies to: 111-114

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62d1e95 and d001bad.

📒 Files selected for processing (13)
  • src/components/AccountMenu/AccountMenu.module.scss (1 hunks)
  • src/components/AvatarEditable/AvatarEditable.module.scss (1 hunks)
  • src/components/MatchResultCard/MatchResultCard.module.scss (0 hunks)
  • src/components/MatchResultPlayers/MatchResultPlayers.module.scss (1 hunks)
  • src/components/ToastProvider/ToastProvider.module.scss (1 hunks)
  • src/components/TournamentCard/TournamentCard.module.scss (0 hunks)
  • src/components/generic/Card/Card.module.scss (0 hunks)
  • src/components/generic/DataTable/DataTable.module.scss (1 hunks)
  • src/components/generic/InputDateTime/InputDateTime.module.scss (1 hunks)
  • src/components/generic/InputLocation/InputLocation.module.scss (1 hunks)
  • src/components/generic/PopoverMenu/PopoverMenu.module.scss (1 hunks)
  • src/pages/TournamentsPage/TournamentsPage.module.scss (1 hunks)
  • src/style/_variants.scss (2 hunks)
💤 Files with no reviewable changes (3)
  • src/components/TournamentCard/TournamentCard.module.scss
  • src/components/MatchResultCard/MatchResultCard.module.scss
  • src/components/generic/Card/Card.module.scss
🔇 Additional comments (3)
src/components/generic/DataTable/DataTable.module.scss (1)

30-33: Great consolidation – one mixin call does it all
Replacing three separate includes with variants.card($elevated: true) improves clarity and keeps the pop-over styling consistent with the new design system.
✅ No issues spotted here.

src/components/AvatarEditable/AvatarEditable.module.scss (1)

26-34: Mixin upgrade looks good

variants.card($elevated: true) is the right call here – it removes several redundant declarations and keeps the menu styling in sync with other components.

src/components/ToastProvider/ToastProvider.module.scss (1)

27-38: Potentially duplicated styling

variants.card($elevated: true) already sets background-color: var(--card-bg) and an elevated shadow.
Lines 37-40 re-declare both, which will override whatever the mixin emits.
If the intention is to customise the toast’s shadow, leave as-is; otherwise you can drop the extra declarations to rely on the centralised mixin.

Comment on lines +195 to 205
@mixin card($elevated: false) {
@include borders.normal;
@include corners.normal;
@include shadows.surface;

background-color: var(--card-bg);
border-color: var(--border-color-default);

@if $elevated {
@include shadows.elevated;
}
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

card() applies both surface and elevated shadows – likely unintended

Because @include shadows.surface; is unconditional and @include shadows.elevated; is appended when $elevated is true, the elevated version overrides the surface box-shadow only if the shadows.* mixins both set box-shadow.
If either mixin appends to box-shadow (comma-separated shadows) you’ll end up with two shadows instead of one, which wasn’t the behaviour of the previous code.

A safer pattern is to choose exactly one shadow set:

  @include borders.normal;
  @include corners.normal;

- @include shadows.surface;
-
- @if $elevated {
-   @include shadows.elevated;
- }
+ @if $elevated {
+   @include shadows.elevated;
+ } @else {
+   @include shadows.surface;
+ }

This preserves the original visual intent and avoids accidental double shadows.

📝 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
@mixin card($elevated: false) {
@include borders.normal;
@include corners.normal;
@include shadows.surface;
background-color: var(--card-bg);
border-color: var(--border-color-default);
@if $elevated {
@include shadows.elevated;
}
}
@mixin card($elevated: false) {
@include borders.normal;
@include corners.normal;
@if $elevated {
@include shadows.elevated;
} @else {
@include shadows.surface;
}
background-color: var(--card-bg);
}
🤖 Prompt for AI Agents
In src/style/_variants.scss around lines 195 to 205, the card mixin currently
includes both surface and elevated shadows when $elevated is true, causing
double shadows if shadows.* mixins append rather than override box-shadow. To
fix this, remove the unconditional @include shadows.surface and instead use a
conditional to include either shadows.surface or shadows.elevated based on the
$elevated flag, ensuring only one shadow style is applied at a time.

@ianpaschal ianpaschal merged commit 89594e9 into develop Jun 30, 2025
4 checks passed
@ianpaschal ianpaschal deleted the task-100-clean-up-card-mixin branch June 30, 2025 20:02
@coderabbitai coderabbitai bot mentioned this pull request Jun 30, 2025
ianpaschal added a commit that referenced this pull request Jul 1, 2025
* Update update-project-status.yml

* Update updateProjectStatus.js

* fix: Toast text does not wrap (#87)

* fix: #86 Sanitize sign in/sign up inputs (#91)

* feat: #32 Auto generate avatars & refactor users (#90)

* feat: Improve <TournamentDetailPage/> default tab

* feat: Improve <TournamentCard/> styling

* Update mockData.ts

* feat: Improve <AccordionItem/> disabled state (#97)

#94

* feat: Hide completed pairings from match check-in (#96)

#95

* bug: Preserve <TournamentPairingsGrid/> internal state (#98)

#93

* feat: #101 Add player count to roster (#103)

* feat: Show full player names when tournaments require it

* feat: Add activePlayerCount to deep tournaments

* feat: Sort tournament competitors by name

* task: #100 Clean-up .card mixin (#102)

* feat: #99 Improve tournament competitor edit dialog (#104)

* feat: #106 Improve signIn error handling (#107)

* Update convex/_model/tournamentCompetitors/queries/getTournamentCompetitorsByTournament.ts

* Update convex/_model/users/_helpers/checkUserTournamentForcedName.ts

* feat: Hide players with 0 matches from rankings
ianpaschal added a commit that referenced this pull request Jul 18, 2025
* Update update-project-status.yml

* Update updateProjectStatus.js

* fix: Toast text does not wrap (#87)

* fix: #86 Sanitize sign in/sign up inputs (#91)

* feat: #32 Auto generate avatars & refactor users (#90)

* feat: Improve <TournamentDetailPage/> default tab

* feat: Improve <TournamentCard/> styling

* Update mockData.ts

* feat: #94 Improve <AccordionItem/> disabled state (#97)

* feat: #95 Hide completed pairings from match check-in (#96)

* bug: #93 Preserve <TournamentPairingsGrid/> internal state (#98)

* feat: #101 Add player count to roster (#103)

* feat: Show full player names when tournaments require it

* feat: Add activePlayerCount to deep tournaments

* feat: Sort tournament competitors by name

* task: #100 Clean-up .card mixin (#102)

* feat: #99 Improve tournament competitor edit dialog (#104)

* feat: #106 Improve signIn error handling (#107)

* Update convex/_model/tournamentCompetitors/queries/getTournamentCompetitorsByTournament.ts

* Update convex/_model/users/_helpers/checkUserTournamentForcedName.ts

* feat: Hide players with 0 matches from rankings

* feat: #112 Add more mercenary team options (#113)

* feat: #110 Add manual table assignments (#111)

* fix: Ensure round 0 rankings can be included

* Refactor tournament actions (#114)

* refactor: Improve tournament actions

* chore: Clean-up Convex errors

* fix: Do not try to clean up current round timer on tournament end

* fix: Don't allow players to be removed from tournament

* chore: Update test tournament banner image

* Update TournamentCard.tsx

* fix: Ensure round 0 rankings can be included

* fix: Fix end tournament round context menu behavior

* chore: Improve mock match result creation

* feat: Allow matchResult.playedAt to be date string or number

* feat: #115 Hide match result battle plans (#116)

* feat: Set page title based on <PageWrapper/> title prop

* fix: Use <IdentityBadge/> to fix player name spacing on match results

* fix: Correctly include match results relevant to a tournament
ianpaschal added a commit that referenced this pull request Jul 24, 2025
* Update update-project-status.yml

* Update updateProjectStatus.js

* fix: Toast text does not wrap (#87)

* fix: Sanitize sign in/sign up inputs (#91)

#86

* feat: #32 Auto generate avatars & refactor users (#90)

* feat: Improve <TournamentDetailPage/> default tab

* feat: Improve <TournamentCard/> styling

* Update mockData.ts

* feat: Improve <AccordionItem/> disabled state (#97)

#94

* feat: Hide completed pairings from match check-in (#96)

#95

* bug: Preserve <TournamentPairingsGrid/> internal state (#98)

#93

* feat: #101 Add player count to roster (#103)

* feat: Show full player names when tournaments require it

* feat: Add activePlayerCount to deep tournaments

* feat: Sort tournament competitors by name

* task: Clean-up .card mixin (#102)

#100

* feat: #99 Improve tournament competitor edit dialog (#104)

* feat: #106 Improve signIn error handling (#107)

* Update convex/_model/tournamentCompetitors/queries/getTournamentCompetitorsByTournament.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update convex/_model/users/_helpers/checkUserTournamentForcedName.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: Hide players with 0 matches from rankings

* feat: #112 Add more mercenary team options (#113)

* feat: #110 Add manual table assignments (#111)

* fix: Ensure round 0 rankings can be included

* Refactor tournament actions (#114)

* refactor: Improve tournament actions

* chore: Clean-up Convex errors

* fix: Do not try to clean up current round timer on tournament end

* fix: Don't allow players to be removed from tournament

* chore: Update test tournament banner image

* Update TournamentCard.tsx

* fix: Ensure round 0 rankings can be included

* fix: Fix end tournament round context menu behavior

* chore: Improve mock match result creation

* feat: Allow matchResult.playedAt to be date string or number

* feat: #115 Hide match result battle plans (#116)

* feat: Set page title based on <PageWrapper/> title prop

* fix: Use <IdentityBadge/> to fix player name spacing on match results

* fix: Correctly include match results relevant to a tournament

* feat: #57 Implement basic dashboard (#119)

* fix: Remove double border on dashboard sections

* fix: Add key to dashboard tournaments

* feat: Improve <TournamentPairingRow/> styling

* fix: Remove extraneous error message

* fix: Improve <Form/> isDirty calculation

* fix: Render all competitors in <TournamentCompetitorForm/>

* fix: Also show empty state if rankings are empty

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.

1 participant