Unverified Commit edd8011d authored by Sam Selikoff's avatar Sam Selikoff Committed by GitHub

Hide overlay editor button labels on smaller screens (#100266)

Hide "Open in editor" button text on small screens.

Follow-up to #100206.

<!-- NEXT_JS_LLM -->
parent 96f545ae
...@@ -154,7 +154,7 @@ export const CODE_FRAME_STYLES = ` ...@@ -154,7 +154,7 @@ export const CODE_FRAME_STYLES = `
background-color: var(--color-ansi-selection); background-color: var(--color-ansi-selection);
} }
[data-nextjs-codeframe] *:not(a):not(.open-in-editor-button) { [data-nextjs-codeframe] *:not(a):not(.open-in-editor-button):not(.open-in-editor-button *) {
color: inherit; color: inherit;
background-color: transparent; background-color: transparent;
font-family: var(--font-stack-monospace); font-family: var(--font-stack-monospace);
......
...@@ -5,9 +5,14 @@ export function OpenInEditorButton( ...@@ -5,9 +5,14 @@ export function OpenInEditorButton(
props: ButtonHTMLAttributes<HTMLButtonElement> props: ButtonHTMLAttributes<HTMLButtonElement>
) { ) {
return ( return (
<button type="button" {...props} className="open-in-editor-button"> <button
type="button"
{...props}
aria-label={props['aria-label'] ?? 'Open in Editor'}
className="open-in-editor-button"
>
<CodeIcon aria-hidden="true" /> <CodeIcon aria-hidden="true" />
Open in Editor <span className="open-in-editor-button-label">Open in Editor</span>
</button> </button>
) )
} }
...@@ -50,4 +55,16 @@ export const OPEN_IN_EDITOR_BUTTON_STYLES = ` ...@@ -50,4 +55,16 @@ export const OPEN_IN_EDITOR_BUTTON_STYLES = `
background: var(--color-gray-alpha-200); background: var(--color-gray-alpha-200);
} }
} }
@media (max-width: 767px) {
.open-in-editor-button {
width: var(--size-28);
padding: 0;
gap: 0;
}
.open-in-editor-button-label {
display: none;
}
}
` `
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment