Skip to content
Open
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
13 changes: 13 additions & 0 deletions components/playground/element.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
}

&.playground__runner-console {
position: relative;

grid-area: runner;

overflow: hidden;
Expand Down Expand Up @@ -168,3 +170,14 @@ mdn-modal {
justify-content: flex-end;
}
}

.overlay-run-button {
position: absolute;
inset: 4rem 1rem 9rem;
z-index: 1;

font-size: clamp(1.5rem, 3vw, 3rem);

background-color: var(--color-border-primary);
border-radius: 0.5rem;
}
12 changes: 12 additions & 0 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 circlePlay from "../icon/circle-play.svg?lit";
import { globalUser } from "../user/context.js";

import styles from "./element.css?lit";
Expand Down Expand Up @@ -65,6 +66,7 @@ export class MDNPlayground extends L10nMixin(LitElement) {
this._autoRun = true;
controller.runOnChange = true;
this._storeSession();
this.requestUpdate();
}
}
}
Expand Down Expand Up @@ -361,6 +363,16 @@ ${"```"}`,
Seeing something inappropriate?
</mdn-button>`
: nothing}
${this._autoRun
? nothing
: html`<mdn-button
class="overlay-run-button"
@click=${this._run}
.icon=${circlePlay}
variant="plain"
>
Run
</mdn-button>`}
<mdn-play-runner></mdn-play-runner>
<div class="playground__console">
<div>${this.l10n`Console`}</div>
Expand Down