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

Add help icon #90

Merged
merged 2 commits into from
Mar 17, 2024
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
14 changes: 12 additions & 2 deletions docs/components/window/titlebar.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<p>
We make use of <code>aria-label</code> to render the Close button, to let
assistive technologies know the intent of this button. You may also use
"Minimize" and "Maximize" like so:
"Minimize", "Maximize", "Restore" and "Help" like so:
</p>

<%- example(`
Expand All @@ -62,11 +62,21 @@
<button aria-label="Close"></button>
</div>
</div>

<br>

<div class="title-bar">
<div class="title-bar-text">A help Title Bar</div>
<div class="title-bar-controls">
<button aria-label="Help"></button>
<button aria-label="Close"></button>
</div>
</div>
`) %>

<p>
Alternatively, you can use the <code>is-close</code>, <code>is-minimize</code>,
<code>is-maximize</code>, <code>is-restore</code> classes to target the respective
<code>is-maximize</code>, <code>is-restore</code>, <code>is-help</code> classes to target the respective
controls for your styling preference.
</p>

Expand Down
32 changes: 32 additions & 0 deletions gui/_window.scss
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,13 @@
}
}

&[aria-label="Help"],
&.is-help {
&::before {
background: url("./icon/help.png") no-repeat center;
}
}

&[aria-label="Restore"],
&.is-restore {
&::before {
Expand Down Expand Up @@ -431,6 +438,31 @@
}
}

&[aria-label="Help"],
&.is-help {
background: url("./icon/help.png") no-repeat center,
var(--control-background);
&::before {
content: "";
box-shadow: 0 0 7px 3px #5dc4f0, var(--control-inset-shadow);
background: url("./icon/help.png") no-repeat center,
var(--control-background-hovered);
opacity: 0;
transition: opacity 0.3s linear;
}

&:hover::before,
&:focus-visible::before {
opacity: 1;
transition: opacity 0.1s linear;
}

&:active::before {
background: url("./icon/help.png") no-repeat center,
var(--control-background-active);
}
}

&[aria-label="Restore"],
&.is-restore {
background: url("./icon/restore.png") no-repeat center,
Expand Down
Binary file added gui/icon/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.