mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
feat: higher constrast low contrast
This commit is contained in:
1 parent
0bc2d0aaf6
commit
5cd149b2b9
3 files changed
+13
-11
No files matched your search
@@ -1,5 +1,10 @@
|
|||||||
.text {
|
.text {
|
||||||
font-size: var(--font-size-regular);
|
font-size: var(--font-size-regular);
|
||||||
|
color: var(--gray-12);
|
||||||
|
|
||||||
|
&[data-low-contrast="true"] {
|
||||||
|
color: var(--white-a9);
|
||||||
|
}
|
||||||
|
|
||||||
&[data-size="minor"] {
|
&[data-size="minor"] {
|
||||||
font-size: var(--font-size-minor);
|
font-size: var(--font-size-minor);
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import type { ComponentProps } from "react";
|
import type { ComponentProps } from "react";
|
||||||
import { classNames } from "../../core/ui/classNames";
|
import { classNames } from "../../core/ui/classNames";
|
||||||
import type { Color } from "../../core/ui/color";
|
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
export interface TextProps extends ComponentProps<"span"> {
|
export interface TextProps extends ComponentProps<"span"> {
|
||||||
color?: Color | "accent";
|
|
||||||
weight?: "light" | "regular" | "medium" | "bold" | "black";
|
weight?: "light" | "regular" | "medium" | "bold" | "black";
|
||||||
lowContrast?: boolean;
|
lowContrast?: boolean;
|
||||||
size?: "regular" | "minor" | "major";
|
size?: "regular" | "minor" | "major";
|
||||||
@@ -12,7 +10,6 @@ export interface TextProps extends ComponentProps<"span"> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function Text({
|
export function Text({
|
||||||
color = "gray",
|
|
||||||
lowContrast,
|
lowContrast,
|
||||||
className,
|
className,
|
||||||
size = "regular",
|
size = "regular",
|
||||||
@@ -24,7 +21,7 @@ export function Text({
|
|||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
className={classNames("text", className)}
|
className={classNames("text", className)}
|
||||||
style={{ color: `var(--${color}-${lowContrast ? 11 : 12})`, ...style }}
|
data-low-contrast={lowContrast}
|
||||||
data-size={size}
|
data-size={size}
|
||||||
data-weight={weight}
|
data-weight={weight}
|
||||||
data-align={align === "left" ? undefined : align}
|
data-align={align === "left" ? undefined : align}
|
||||||
|
|||||||
@@ -52,13 +52,6 @@ export const tools: Record<string, Tool> = {
|
|||||||
banner_background_position: "bottom",
|
banner_background_position: "bottom",
|
||||||
},
|
},
|
||||||
|
|
||||||
api: {
|
|
||||||
id: "api",
|
|
||||||
|
|
||||||
accent: "brown",
|
|
||||||
banner_background_position: "bottom",
|
|
||||||
},
|
|
||||||
|
|
||||||
playlist: {
|
playlist: {
|
||||||
id: "playlist",
|
id: "playlist",
|
||||||
|
|
||||||
@@ -86,4 +79,11 @@ export const tools: Record<string, Tool> = {
|
|||||||
accent: "blue",
|
accent: "blue",
|
||||||
banner_background_position: "bottom",
|
banner_background_position: "bottom",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
api: {
|
||||||
|
id: "api",
|
||||||
|
|
||||||
|
accent: "brown",
|
||||||
|
banner_background_position: "bottom",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user