Skip to content

Commit ed5150b

Browse files
authored
settings/tokens/new: Add help button to "Scopes" section (#6431)
1 parent 5408fec commit ed5150b

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

app/styles/settings/tokens/new.module.css

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,32 @@
44
}
55

66
.form-group-name {
7-
display: block;
7+
display: flex;
8+
gap: var(--space-2xs);
89
margin-bottom: var(--space-2xs);
910
font-weight: 600;
1011
}
1112

13+
.help-link {
14+
flex-shrink: 0;
15+
color: var(--grey600);
16+
padding: var(--space-3xs);
17+
margin: calc(-1 * var(--space-3xs));
18+
19+
&:hover {
20+
color: var(--grey700);
21+
}
22+
23+
svg {
24+
width: 1em;
25+
height: 1em;
26+
}
27+
}
28+
29+
.hidden-label {
30+
composes: sr-only from '../../shared/a11y.module.css';
31+
}
32+
1233
.form-group-error {
1334
display: block;
1435
color: red;

app/templates/settings/tokens/new.hbs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,19 @@
2727
</div>
2828

2929
<div local-class="form-group" data-test-scopes-group>
30-
<div local-class="form-group-name">Scopes</div>
30+
<div local-class="form-group-name">
31+
Scopes
32+
33+
<a
34+
href="https://rust-lang.github.io/rfcs/2947-crates-io-token-scopes.html"
35+
target="_blank"
36+
rel="noopener noreferrer"
37+
local-class="help-link"
38+
>
39+
<span local-class="hidden-label">Help</span>
40+
{{svg-jar "circle-question"}}
41+
</a>
42+
</div>
3143

3244
<ul role="list" local-class="scopes-list {{if this.scopesInvalid "invalid"}}">
3345
{{#each this.ENDPOINT_SCOPES as |scope|}}

public/assets/circle-question.svg

Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)