chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import React, { type ReactNode } from 'react';
|
||||
import clsx from 'clsx';
|
||||
import Buttons from '@theme/CodeBlock/Buttons';
|
||||
import styles from './styles.module.css';
|
||||
|
||||
export interface ContentHeaderProps {
|
||||
language?: string;
|
||||
}
|
||||
|
||||
export default function ContentHeader({ language }: ContentHeaderProps): ReactNode {
|
||||
return (
|
||||
<div
|
||||
className={clsx(styles.codeBlockHeader)}
|
||||
aria-label={`Code block header for ${language} code with copy and toggle buttons`}
|
||||
>
|
||||
<span className={styles.languageLabel}>{language}</span>
|
||||
<Buttons />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
.codeBlockHeader {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0.25rem 0.5rem;
|
||||
background: var(--prism-background-color);
|
||||
position: sticky;
|
||||
top: var(--ifm-navbar-height, 3.125rem); /* Stick below the Docusaurus navbar; fallback for safety */
|
||||
}
|
||||
|
||||
.languageLabel {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
color: var(--ifm-color-emphasis-600);
|
||||
padding: 0.3125rem;
|
||||
}
|
||||
Reference in New Issue
Block a user