Skip to content

Commit

Permalink
refactor(core): adopt new color system config
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjavi committed Jun 1, 2024
1 parent 32ce5cb commit f6b380d
Show file tree
Hide file tree
Showing 14 changed files with 989 additions and 432 deletions.
2 changes: 1 addition & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function HeadlineText() {
letterSpacing: 'tighter',
marginX: 'auto',
fontWeight: '300',
color: 'fg.muted',
color: 'muted.100',
}}
>
Create your own unique theme for <strong>Panda CSS</strong> and <strong>Ark UI</strong>.
Expand Down
6 changes: 3 additions & 3 deletions components/layout/bg-gradient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { cn } from '@/lib/utils'
const cls = {
bg: css({
bgGradient: 'to-b',
gradientFrom: 'bg.100',
gradientVia: 'bg.100',
gradientTo: 'bg.200',
gradientFrom: 'background.100',
gradientVia: 'background.100',
gradientTo: 'background.200',
}),
}

Expand Down
2 changes: 1 addition & 1 deletion components/layout/bg-retro-grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const cls = {
// colorPalette: 'gray',
// bg: '#0e1416',
transform: 'rotateX(0deg)',
bg: 'radial-gradient(ellipse at 50% 50%, transparent 0%, {colors.bg.100/90} 60%)',
bg: 'radial-gradient(ellipse at 50% 50%, transparent 0%, {colors.background.100/90} 60%)',
zIndex: 1,
// _dark: {
// // bg: 'radial-gradient(ellipse at 50% 50%, transparent 0%, {colors.colorPalette.900/90} 60%)',
Expand Down
4 changes: 2 additions & 2 deletions modules/color-system/components/color-scale-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function ColorScaleEditor({ fg, config, onChange }: ColorScaleEdi
},
'& .subtitle': {
fontWeight: 'normal',
color: 'fg.muted',
color: 'muted.100',
},
'& .label:not(:first-child)': {
justifyContent: 'center',
Expand All @@ -50,7 +50,7 @@ export default function ColorScaleEditor({ fg, config, onChange }: ColorScaleEdi
// fontSize: 'lg',
// borderRadius: 'sm',
// borderWidth: '1.5px',
// borderColor: 'fg.200',
// borderColor: 'muted.100',
// },
}}
>
Expand Down
2 changes: 1 addition & 1 deletion modules/color-system/components/color-scale-legend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function ColorScaleLegend({ levels }: { levels: Readonly<string[]
},
'& .subtitle': {
fontWeight: 'normal',
color: 'fg.muted',
color: 'muted.100',
},
'& .label:not(:first-child)': {
justifyContent: 'center',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default function ColorScaleLevelEditor({ config, level, fg, scheme, onCha
_dark: {
// background: 'alpha.light.600',
},
// color: 'fg.100',
// color: 'muted.100',
fontSize: 'xs',
textAlign: 'center',
lineHeight: '1',
Expand Down
2 changes: 1 addition & 1 deletion modules/design-system/components/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const buttonStyle = cva({
},
solid: {
background: 'colorPalette.solid1',
color: 'fg.dark',
color: 'contrast.dark',
_hover: {
background: 'colorPalette.solid2',
},
Expand Down
4 changes: 2 additions & 2 deletions modules/design-system/components/oklch-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,12 @@ function ColorSplitPreview({ currentColor, originalColor }: { currentColor: Oklc

'& strong:first-child': {
fontSize: '3xl',
color: 'fg.dark',
color: 'contrast.dark',
},

'& strong:last-child': {
fontSize: '3xl',
color: 'fg.light',
color: 'contrast.light',
},
},
}}
Expand Down
6 changes: 3 additions & 3 deletions modules/design-system/components/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const popoverCss = {
borderWidth: '1px',
borderStyle: 'solid',
borderColor: 'gray.border1',
background: 'bg.base',
background: 'background.100',
borderRadius: 'sm',
boxShadow: 'lg',
display: 'flex',
Expand All @@ -37,11 +37,11 @@ export const popoverCss = {
textStyle: 'sm',
}),
description: css({
color: 'fg.muted',
color: 'muted.100',
textStyle: 'sm',
}),
closeTrigger: css({
color: 'fg.muted',
color: 'muted.100',
}),
arrow: css({
'--arrow-size': 'var(--sizes-3)',
Expand Down
6 changes: 3 additions & 3 deletions modules/design-system/components/typography/heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const heading = cva({
letterSpacing: 'tighter',
color: 'gray.fg2',
// textGradient: 'to-br',
// gradientFrom: 'fg.100',
// gradientVia: 'fg.200',
// gradientTo: 'fg.100',
// gradientFrom: 'contrast.100',
// gradientVia: 'contrast.200',
// gradientTo: 'contrast.100',
},
variants: {
size: {
Expand Down
2 changes: 1 addition & 1 deletion modules/design-system/components/typography/subtitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PandaP } from '../panda'

export default function Subtitle({ children }: { children: React.ReactNode }) {
return (
<PandaP color="fg.muted" fontSize="xl">
<PandaP color="muted.100" fontSize="xl">
{children}
</PandaP>
)
Expand Down
26 changes: 26 additions & 0 deletions modules/design-system/lib/preset-color-aliases.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { definePreset } from '@pandacss/dev'
// import { colorSystemPreset } from './preset-colors'
// const _semanticColors = colorSystemPreset.theme?.extend?.semanticTokens?.colors
// type SemanticColors = typeof _semanticColors
// const semanticColors = _semanticColors as NonNullable<SemanticColors>

export const colorAliasesPreset = definePreset({
theme: {
extend: {
semanticTokens: {
colors: {
// bg: semanticColors.background,
// fg: semanticColors.contrast,
muted: {
100: {
value: '{colors.gray.fg1}',
},
200: {
value: '{colors.gray.fg2}',
},
},
},
},
},
},
})
Loading

0 comments on commit f6b380d

Please sign in to comment.