Skip to content
Closed
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
7 changes: 1 addition & 6 deletions packages/clerk-js/src/ui/elements/Card/CardFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';

import { colors } from '@/ui/utils/colors';

import { useEnvironment } from '../../contexts';
import { descriptors, Flex, Link, localizationKeys, useAppearance } from '../../customizables';
import { useDevMode } from '../../hooks/useDevMode';
Expand Down Expand Up @@ -51,10 +49,7 @@ export const CardFooter = React.forwardRef<HTMLDivElement, CardFooterProps>((pro
t => ({
marginTop: `calc(${t.space.$2} * -1)`,
paddingTop: t.space.$2,
background: common.mergedColorsBackground(
colors.setAlpha(t.colors.$colorBackground, 1),
t.colors.$neutralAlpha50,
),
background: common.secondaryBackground(t),
'&:empty': {
padding: 0,
marginTop: 0,
Expand Down
5 changes: 1 addition & 4 deletions packages/clerk-js/src/ui/elements/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,7 @@ const NavbarContainer = (
width: t.sizes.$57,
position: 'relative',
maxWidth: t.space.$57,
background: common.mergedColorsBackground(
colors.setAlpha(t.colors.$colorBackground, 1),
t.colors.$neutralAlpha50,
),
background: common.secondaryBackground(t),
padding: `${t.space.$6} ${t.space.$5} ${t.space.$4} ${t.space.$3}`,
marginRight: `calc(${t.space.$2} * -1)`,
color: t.colors.$colorText,
Expand Down
13 changes: 13 additions & 0 deletions packages/clerk-js/src/ui/styledSystem/common.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { colors } from '../utils/colors';
import { cssSupports } from '../utils/cssSupports';
import { clerkCssVar } from '../utils/cssVariables';
import type { InternalTheme } from './types';

const textVariants = (t: InternalTheme) => {
Expand Down Expand Up @@ -190,6 +193,15 @@ const mergedColorsBackground = (colorBack: string, colorFront: string) => {
return `linear-gradient(${colorFront},${colorFront}), linear-gradient(${colorBack}, ${colorBack})`;
};

const secondaryBackground = (t: InternalTheme) => {
return cssSupports.colorMix()
? clerkCssVar(
'color-background-secondary',
`color-mix(in srgb, ${t.colors.$colorBackground}, ${t.colors.$neutralAlpha50})`,
)
: mergedColorsBackground(colors.setAlpha(t.colors.$colorBackground, 1), t.colors.$neutralAlpha50);
};

const visuallyHidden = () =>
({
clip: 'rect(0 0 0 0)',
Expand All @@ -212,5 +224,6 @@ export const common = {
maxHeightScroller,
unstyledScrollbar,
mergedColorsBackground,
secondaryBackground,
visuallyHidden,
};