Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/mosaic-menu-dark-mode-outline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
6 changes: 3 additions & 3 deletions packages/ui/src/mosaic/components/menu/menu.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export const styles = stylex.create({
paddingBlock: space['0.5'],
paddingInline: space['0.5'],
backgroundColor: colorVars['--cl-color-card'],
boxShadow: `0 12px 12px -7px oklch(0.2046 0 0 / 12%),
0 24px 24px -10px oklch(0.2046 0 0 / 4%),
0 0 0 1px oklch(0.2046 0 0 / 4%)`,
boxShadow: `0 12px 12px -7px light-dark(oklch(0.2046 0 0 / 12%), transparent),
0 24px 24px -10px light-dark(oklch(0.2046 0 0 / 4%), transparent),
0 0 0 1px light-dark(oklch(0.2046 0 0 / 4%), oklch(1 0 0 / 10%))`,
Comment on lines +20 to +22

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use lightDark instead of raw light-dark().

The declaration bypasses the repository’s support-aware helper. Browsers without light-dark() support can ignore the entire boxShadow declaration. Apply lightDark to each color value so the style keeps the supported fallback.

As per coding guidelines: “Use CSS light-dark() function via the lightDark utility ... for automatic light/dark mode support with fallbacks.” Repository context identifies packages/ui/src/utils/lightDark.ts:14-18 as the support-aware implementation.

Proposed fix
+import { lightDark } from '../../../utils/lightDark';
+
...
-    boxShadow: `0 12px 12px -7px light-dark(oklch(0.2046 0 0 / 12%), transparent),
-                0 24px 24px -10px light-dark(oklch(0.2046 0 0 / 4%), transparent),
-                0 0 0 1px light-dark(oklch(0.2046 0 0 / 4%), oklch(1 0 0 / 10%))`,
+    boxShadow: `0 12px 12px -7px ${lightDark('oklch(0.2046 0 0 / 12%)', 'transparent')},
+                0 24px 24px -10px ${lightDark('oklch(0.2046 0 0 / 4%)', 'transparent')},
+                0 0 0 1px ${lightDark('oklch(0.2046 0 0 / 4%)', 'oklch(1 0 0 / 10%)')}`,
📝 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
boxShadow: `0 12px 12px -7px light-dark(oklch(0.2046 0 0 / 12%), transparent),
0 24px 24px -10px light-dark(oklch(0.2046 0 0 / 4%), transparent),
0 0 0 1px light-dark(oklch(0.2046 0 0 / 4%), oklch(1 0 0 / 10%))`,
import { lightDark } from '../../../utils/lightDark';
boxShadow: `0 12px 12px -7px ${lightDark('oklch(0.2046 0 0 / 12%)', 'transparent')},
0 24px 24px -10px ${lightDark('oklch(0.2046 0 0 / 4%)', 'transparent')},
0 0 0 1px ${lightDark('oklch(0.2046 0 0 / 4%)', 'oklch(1 0 0 / 10%)')}`,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/mosaic/components/menu/menu.styles.ts` around lines 20 - 22,
Update the boxShadow declaration in the menu styles to use the repository’s
lightDark utility for each light/dark color pair instead of raw CSS light-dark()
calls, preserving the existing colors and fallback behavior.

Source: Coding guidelines

color: colorVars['--cl-color-card-foreground'],
display: 'flex',
flexDirection: 'column',
Expand Down
Loading