Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: codeblock alignment #2031

Merged
merged 5 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const CopyToClipboardButton: React.FC<CopyToClipboardButton.Props> = ({
copyToClipboard?.();
}) ?? (
<FernButton
className={cn("fern-copy-button group backdrop-blur", className)}
className={cn("fern-copy-button group", className)}
disabled={copyToClipboard == null}
onClickCapture={(e) => {
onClick?.(e);
Expand Down
6 changes: 5 additions & 1 deletion packages/fern-docs/components/src/FernButton.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
@apply px-1;

> .fern-button-content {
@apply w-7 sm:w-6;
@apply h-7 w-7 sm:h-6 sm:w-6;
}
}

Expand Down Expand Up @@ -429,4 +429,8 @@
}
}
}

.fern-copy-button {
@apply backdrop-blur;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`CopyToClipboardButton > renders correctly 1`] = `
<button
aria-disabled={false}
className="fern-copy-button group backdrop-blur fern-button minimal normal rounded square"
className="fern-copy-button group fern-button minimal normal rounded square"
data-state="closed"
data-testid="copy-btn"
onBlur={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const EndpointUrl = React.forwardRef<

<div className={cn("flex items-center")}>
<span
className={`inline-flex shrink items-baseline ${isHovered ? "hover:bg-tag-default" : ""} cursor-default rounded-md px-1 py-0.5`}
className={`inline-flex shrink items-baseline ${isHovered ? "hover:bg-tag-default" : ""} cursor-default rounded-md p-1`}
>
<CopyToClipboardButton
content={() =>
Expand All @@ -127,6 +127,7 @@ export const EndpointUrl = React.forwardRef<
>
{(onClick) => (
<button
className="flex items-center"
onClick={onClick}
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ export const TitledExample = forwardRef<
) : (
<div className="min-w-0 flex-1 shrink">{title}</div>
)}
<div className="flex gap-2">
<div className="flex items-center gap-2">
{actions}
{!disableClipboard && (
<CopyToClipboardButton
content={copyToClipboardText}
className="-m-1"
className="-m-1 size-fit"
/>
)}
</div>
Expand Down
Loading