Skip to content
Open
29 changes: 20 additions & 9 deletions components/playground/element.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
grid-template-columns: 1fr 1fr;

gap: 1rem;
align-items: stretch;

height: 100%;

Expand All @@ -29,10 +30,7 @@
gap: 0.5rem;
align-items: center;

padding: 0.5rem;

border: var(--border);
border-radius: 0.25rem;
padding: 0.57rem;

h1 {
margin: 0;
Expand Down Expand Up @@ -92,21 +90,34 @@
}
}

.playground__runner-menu {
align-self: flex-end;
padding: 0.5rem 0;

mdn-button {
border: var(--border);
border-radius: 0.25rem;
}

@media (--screen-medium-and-narrower) {
align-self: center;
}
}

&.playground__runner-console {
grid-area: runner;

overflow: hidden;

border: var(--border);
border-radius: 0.25rem;

mdn-play-runner {
flex-grow: 1;
border: var(--border);
border-radius: 0.25rem;
}

.playground__console {
background-color: var(--color-background-secondary);
border-top: var(--border);
border: var(--border);
border-radius: 0.25rem;

div {
font-size: var(--font-size-small);
Expand Down
15 changes: 12 additions & 3 deletions components/playground/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { createRef, ref } from "lit/directives/ref.js";

import { L10nMixin } from "../../l10n/mixin.js";
import { gleanClick } from "../../utils/glean.js";
import warningIcon from "../icon/triangle-alert.svg?lit";
import { globalUser } from "../user/context.js";

import styles from "./element.css?lit";
Expand Down Expand Up @@ -357,9 +358,17 @@ ${"```"}`,
</section>
<section class="playground__runner-console">
${this._gistId
? html`<mdn-button @click=${this._reportOpen} variant="plain">
${this.l10n`Seeing something inappropriate?`}
</mdn-button>`
? html`<aside class="playground__runner-menu">
<menu>
<mdn-button
@click=${this._reportOpen}
variant="plain"
.icon=${warningIcon}
>
${this.l10n`Seeing something inappropriate?`}
</mdn-button>
</menu>
</aside>`
: nothing}
<mdn-play-runner></mdn-play-runner>
<div class="playground__console">
Expand Down
Loading