Skip to content
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

Flyout: initial idea to show caret on flyout #394

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
14 changes: 7 additions & 7 deletions dist/readthedocs-addons.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/readthedocs-addons.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/flyout.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ header > span {
);
}

header > span.caret {
margin-left: 10px;
}

header > span svg.icon {
color: rgb(128, 128, 128);
height: var(
Expand Down
7 changes: 6 additions & 1 deletion src/flyout.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ajv } from "./data-validation";
import READTHEDOCS_LOGO from "./images/logo-wordmark-light.svg";
import { library, icon } from "@fortawesome/fontawesome-svg-core";
import { faCodeBranch } from "@fortawesome/free-solid-svg-icons";
import { faCodeBranch, faCaretDown } from "@fortawesome/free-solid-svg-icons";
import { html, nothing, render, LitElement } from "lit";
import { classMap } from "lit/directives/class-map.js";
import { default as objectPath } from "object-path";
Expand Down Expand Up @@ -70,10 +70,15 @@ export class FlyoutElement extends LitElement {
>`;
}

const iconCaretDown = icon(faCaretDown, {
classes: ["icon"],
});

return html`
<header @click="${this._toggleOpen}">
<img class="logo" src="${READTHEDOCS_LOGO}" alt="Read the Docs" />
${version}
<span class="caret">${iconCaretDown.node[0]}</span>
</header>
`;
}
Expand Down