Skip to content

New playground design #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 13, 2021
Merged
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
27 changes: 27 additions & 0 deletions packages/lit-dev-content/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/lit-dev-content/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"@material/mwc-button": "^0.20.0",
"@material/mwc-drawer": "^0.20.0",
"@material/mwc-icon-button": "^0.20.0",
"@material/mwc-icon-button-toggle": "^0.20.0",
"@material/mwc-snackbar": "^0.20.0",
"lit": "^2.0.0-pre.1",
"lit-element": "^2.3.1",
Expand Down
1 change: 1 addition & 0 deletions packages/lit-dev-content/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default [
{
input: [
'lib/components/copy-button.js',
'lib/components/litdev-drawer.js',
'lib/components/litdev-example.js',
'lib/components/litdev-tutorial.js',
'lib/components/playground-elements.js',
Expand Down
2 changes: 1 addition & 1 deletion packages/lit-dev-content/site/_includes/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{% set toc = content | toc %}


<div id="docsNavWrapper">
<div id="docsNavWrapper" class="minimalScroller">
<nav id="docsNav">
<ol>{% include 'docs-nav.html' %}</ol>
</nav>
Expand Down
41 changes: 41 additions & 0 deletions packages/lit-dev-content/site/_includes/post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% extends 'default.html' %}

{% block head %}
{% inlinecss "docs.css" %}
{% inlinejs "docs.js" %}
{% if '/api/' in page.url %}
{% inlinecss "docs-api.css" %}
{% endif %}
{% endblock %}

{% block drawer %}
{% include 'eleventy-nav.html' %}
{% endblock %}

{% block content %}
<div id="docsNavWrapper">
<nav id="docsNav" class="minimalScroller">
<ol>{% include 'eleventy-nav.html' %}</ol>
</nav>
</div>

<div id="rhsTocWrapper">
<nav id="rhsToc">
<h2>Contents</h2>
{{ content | toc | safe }}
</nav>
</div>

<article>
<h1>{{ title }}</h1>

<nav id="inlineToc">
<details>
<summary><h2>Contents</h2></summary>
{{ content | toc | safe }}
</details>
</nav>

{{ content | safe }}
</article>
{% endblock %}
36 changes: 34 additions & 2 deletions packages/lit-dev-content/site/css/code.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
html {
--playground-code-font-family: "Roboto Mono", monospace;
--playground-code-font-family: 'Roboto Mono', monospace;
--playground-code-font-size: 14px;
--playground-code-line-height: 1.8em;
--playground-code-padding: 0.5em 0 0.5em 1em;
--playground-highlight-color: #005cc5;
--playground-bar-height: 2.5rem;
--playground-code-gutter-background: white;
--playground-code-gutter-border-right: none;

--playground-highlight-color: var(--color-blue);
--playground-code-keyword-color: #d73a49;
--playground-code-atom-color: #005cc5;
--playground-code-number-color: #005cc5;
Expand All @@ -28,3 +32,31 @@ html {
.CodeMirror {
overflow-y: auto;
}

playground-preview,
playground-ide::part(preview) {
background: var(--color-light-gray);
}

playground-ide::part(preview-toolbar),
playground-preview::part(preview-toolbar) {
background: var(--color-light-gray);
border-bottom: 1.5px solid #ccc;
font-family: 'Open Sans', sans-serif;
font-size: 0.9rem;
box-sizing: border-box;
}

playground-ide::part(tab-bar),
playground-tab-bar {
background: white;
--mdc-typography-button-font-family: 'Open Sans', sans-serif;
}

playground-file-editor,
playground-ide::part(editor) {
background: white;
border-top: 1.5px solid #ccc;
/* Align border with active tab highlight */
margin-top: -1.5px;
}
9 changes: 0 additions & 9 deletions packages/lit-dev-content/site/css/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -452,17 +452,8 @@ td {
text-decoration: underline;
}

/* On some platforms like Linux, a traditional scrollbar will be always visible
on the nav, which is quite distracting. This reproduces something similar to
macOS style on all platforms. */
#docsNavWrapper::-webkit-scrollbar {
width: 15px;
}
#docsNavWrapper:hover::-webkit-scrollbar-thumb {
background: #d6d6d6;
background-clip: content-box;
border: 4px solid transparent;
border-radius: 10px;
}

/* ------------------------------------
Expand Down
13 changes: 13 additions & 0 deletions packages/lit-dev-content/site/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ a {
color: #1879cd;
}

/* On some platforms like Linux, a traditional scrollbar will be always visible
on the nav, which is quite distracting. This reproduces something similar to
macOS style on all platforms. */
.minimalScroller::-webkit-scrollbar {
width: 15px;
}
.minimalScroller:hover::-webkit-scrollbar-thumb {
background: rgb(255 255 255 / 0.3);
background-clip: content-box !important;
border: 4px solid transparent;
border-radius: 10px;
}

/* Hide something visually in a way that screen readers will read. */
.offscreen {
position: absolute;
Expand Down
Loading