Skip to content

Commit

Permalink
Small contrast adjustments (#9690)
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncid authored and overmode committed Jan 6, 2025
1 parent 6bdde6a commit 564453c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
2 changes: 1 addition & 1 deletion sparkle/src/components/markdown/BlockquoteBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function BlockquoteBlock({ children }: BlockquoteBlockProps) {
<blockquote
className={cn(
"s-w-full s-text-base s-italic s-text-foreground",
"s-rounded-2xl s-border s-border-border s-bg-white s-py-3 s-pl-5 s-pr-12"
"s-rounded-2xl s-bg-muted-background s-py-3 s-pl-5 s-pr-12"
)}
>
{children}
Expand Down
6 changes: 4 additions & 2 deletions sparkle/src/components/markdown/ContentBlockWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function ContentBlockWrapper({
className
)}
>
<div className="s-sticky s-top-0 s-z-50 s-w-full">
<div className="s-sticky s-top-0 s-z-[1] s-w-full">
<div
id="BlockActions"
className="s-flex s-w-full s-justify-end s-gap-1 s-p-2"
Expand All @@ -124,7 +124,9 @@ export function ContentBlockWrapper({
)}
</div>
</div>
<div className={cn("-s-mt-11 s-w-full", innerClassName)}>{children}</div>
<div className={cn("s-z-0 -s-mt-11 s-w-full", innerClassName)}>
{children}
</div>
</div>
);
}
32 changes: 25 additions & 7 deletions sparkle/src/components/markdown/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ function PreBlock({ children }: { children: React.ReactNode }) {
return (
<pre
className={cn(
"s-my-2 s-w-full s-break-all s-rounded-2xl s-border s-border-border s-bg-muted-background"
"s-my-2 s-w-full s-break-all s-rounded-2xl s-border s-border-border-dark s-bg-muted-background"
)}
>
{validChildrenContent ? children : fallbackData || children}
Expand Down Expand Up @@ -341,20 +341,38 @@ function ParagraphBlock({
);
}

type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'ref'> & ReactMarkdownProps & {
ref?: React.Ref<HTMLInputElement>;
};
type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "ref"> &
ReactMarkdownProps & {
ref?: React.Ref<HTMLInputElement>;
};

function Input({ type, checked, className, onChange, ref, ...props }: InputProps) {
function Input({
type,
checked,
className,
onChange,
ref,
...props
}: InputProps) {
const inputRef = React.useRef<HTMLInputElement>(null);
React.useImperativeHandle(ref, () => inputRef.current!);

if (type !== "checkbox") {
return <input ref={inputRef} type={type} checked={checked} className={className} {...props} />;
return (
<input
ref={inputRef}
type={type}
checked={checked}
className={className}
{...props}
/>
);
}

const handleCheckedChange = (isChecked: boolean) => {
onChange?.({ target: { type: "checkbox", checked: isChecked } } as React.ChangeEvent<HTMLInputElement>);
onChange?.({
target: { type: "checkbox", checked: isChecked },
} as React.ChangeEvent<HTMLInputElement>);
};

return (
Expand Down
4 changes: 2 additions & 2 deletions sparkle/src/components/markdown/TableBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ export function TableBlock({ children }: { children: React.ReactNode }) {

return (
<ContentBlockWrapper
innerClassName="s-relative s-my-2 s-w-full s-border s-border-border s-rounded-2xl"
innerClassName="s-relative s-my-2 s-w-full s-border s-border-border-dark s-rounded-2xl"
content={tableData}
>
<ScrollArea className="s-z-0 s-w-full s-rounded-2xl">
<ScrollArea className="s-w-full s-rounded-2xl">
<table className="s-w-full">{children}</table>
<ScrollBar orientation="horizontal" />
</ScrollArea>
Expand Down

0 comments on commit 564453c

Please sign in to comment.