Skip to content

Commit

Permalink
primitives no longer purple
Browse files Browse the repository at this point in the history
  • Loading branch information
snorrekim authored Feb 4, 2025
1 parent f7cff43 commit 947724e
Showing 1 changed file with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,18 @@ const StyledTable = styled(Table)`
}
`

const colorValue = 'var(--color-success-green)'
const colorString = 'var(--color-fire-red)'
const colorType = 'var(--color-violet)'
const colorPrimitive = 'var(--color-success-green)'
const colorUndefined = 'var(--color-black-55)'
const colors = {
type: {
default: 'var(--color-success-green)',
primitive: 'var(--color-success-green)',
string: 'var(--color-fire-red)',
},
value: {
default: 'var(--color-success-green)',
undefined: 'var(--color-black-55)',
string: 'var(--color-fire-red)',
},
}

export const FormattedCode = ({
variant,
Expand All @@ -44,20 +51,20 @@ export const FormattedCode = ({
}
case 'type': {
style.color = isString(children)
? colorString
? colors.type.string
: isPrimitive(children)
? colorPrimitive
: colorType
? colors.type.primitive
: colors.type.default
style.background = 'none'
style.boxShadow = 'none'
break
}
case 'value': {
style.color = isString(children)
? colorString
? colors.value.string
: children === 'undefined' || children === 'null'
? colorUndefined
: colorValue
? colors.value.undefined
: colors.value.default
style.background = 'none'
style.boxShadow = 'none'
break
Expand Down

0 comments on commit 947724e

Please sign in to comment.