polished#mix TypeScript Examples
The following examples show how to use
polished#mix.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DAGContent.tsx From metaflow-ui with Apache License 2.0 | 6 votes |
StatusColorStyles = css<{ state: TaskStatus }>`
border: 1px solid
${(p) =>
p.state === 'completed'
? p.theme.notification.success.text
: p.state === 'running'
? p.theme.notification.warning.text
: p.state === 'failed'
? p.theme.notification.danger.text
: p.theme.color.border.mid};
background: ${(p) =>
p.state === 'completed'
? mix(0.05, p.theme.notification.success.text, '#fff')
: p.state === 'running'
? mix(0.05, p.theme.notification.warning.text, '#fff')
: p.state === 'failed'
? mix(0.05, p.theme.notification.danger.text, '#fff')
: '#fff'};
`
Example #2
Source File: ResultsTableRowResult.tsx From nextclade with MIT License | 6 votes |
export function TableRowColored({
index,
overallStatus,
children,
...restProps
}: {
index: number
overallStatus: QcStatus
children?: ReactNode
}) {
const backgroundColor = useMemo(() => {
const even = index % 2 === 0
const baseRowColor = even ? '#ededed' : '#fcfcfc'
const qcRowColor = getQcRowColor(overallStatus)
return mix(0.5, baseRowColor, qcRowColor)
}, [index, overallStatus])
return (
<TableRow {...restProps} backgroundColor={backgroundColor}>
{children}
</TableRow>
)
}