mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-06 08:13:09 +01:00
feat: glow
This commit is contained in:
1 parent
79b4f05809
commit
dda63830ec
7 files changed
+110
-46
No files matched your search
@@ -1,7 +1,8 @@
|
||||
import type { ComponentProps } from "react";
|
||||
import { classNames } from "../../core/ui/classNames";
|
||||
import type { Color } from "../../core/ui/color";
|
||||
import "./index.css";
|
||||
import { LIGHT_TEXT_COLORS } from "../Button";
|
||||
import styles from "./index.module.css";
|
||||
|
||||
export interface BadgeProps extends ComponentProps<"div"> {
|
||||
color?: Color | "accent";
|
||||
@@ -15,13 +16,14 @@ export function Badge({
|
||||
highContrast,
|
||||
...props
|
||||
}: BadgeProps) {
|
||||
const lightText = LIGHT_TEXT_COLORS.has(color as Color);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={classNames("badge", className)}
|
||||
className={classNames(styles.badge, className)}
|
||||
style={{
|
||||
backgroundColor: `var(--${color}-${highContrast ? 12 : 9})`,
|
||||
color: `var(--gray-${highContrast ? 1 : 12})`,
|
||||
|
||||
color: `var(--gray-${highContrast || lightText ? 1 : 12})`,
|
||||
...style,
|
||||
}}
|
||||
{...props}
|
||||
|
||||
Reference in new issue
Block a user