Openstatus www.openstatus.dev

fix: add rehype-pretty-code dark mode support #930 (#973)

* fix Styling issue with copy to clipboard button on single code lines [CSS] #947

* make right-2 #947

* refactor: add rehype-pretty-code dark mode support #930

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

authored by

Ratnadeep
autofix-ci[bot]
and committed by
GitHub
8986eb92 e49d19ce

+5 -3
+1 -2
apps/web/src/components/content/pre.tsx
··· 3 3 import { Button } from "@openstatus/ui/src/components/button"; 4 4 import { Clipboard, ClipboardCopy } from "lucide-react"; 5 5 import React from "react"; 6 - 7 6 export interface PreProps extends React.HTMLAttributes<HTMLPreElement> {} 8 7 9 8 export default function Pre({ children, ...props }: PreProps) { ··· 31 30 }; 32 31 33 32 return ( 34 - <div className="relative overflow-hidden"> 33 + <div className="relative hidden overflow-hidden dark:[&:has([data-theme='dark'])]:block [&:has([data-theme='light'])]:block dark:[&:has([data-theme='light'])]:hidden"> 35 34 <Button 36 35 variant="outline" 37 36 size="icon"
+4 -1
apps/web/src/contentlayer/plugins/pretty-code.ts
··· 7 7 const prettyCode: unified.Pluggable<any[]> = [ 8 8 rehypePrettyCode, 9 9 { 10 - theme: "github-light", 10 + theme: { 11 + dark: "github-dark-dimmed", 12 + light: "github-light", 13 + }, 11 14 // biome-ignore lint/suspicious/noExplicitAny: <explanation> 12 15 onVisitLine(node: any) { 13 16 // Prevent lines from collapsing in `display: grid` mode, and