DEV: Make breadcrumb separators unclickable icons (#29817)

The current breadcrumb separators are ">" characters that are added as pseudo-elements. These become part of the clickable area for the links, which causes mis-clicks.

This PR does two things:

- Replace the pseudo-element with a DIcon.
- Make sure the separator is not clickable.
This commit is contained in:
Ted Johansson 2024-11-19 16:42:43 +08:00 committed by GitHub
parent d96b8d1001
commit c3367c329c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 6 deletions

View File

@ -1,5 +1,6 @@
import Component from "@glimmer/component";
import { service } from "@ember/service";
import icon from "discourse-common/helpers/d-icon";
import getURL from "discourse-common/lib/get-url";
export default class DBreadcrumbsItem extends Component {
@ -26,6 +27,9 @@ export default class DBreadcrumbsItem extends Component {
<a href={{getURL path}} class={{@linkClass}}>
{{label}}
</a>
<span class="separator">
{{~icon "angle-right"~}}
</span>
</li>
</template>;
}

View File

@ -11,11 +11,20 @@
color: var(--primary-medium);
}
li:not(:last-child) a::after {
display: inline;
padding: 0 var(--space-1);
li {
.separator {
margin-right: var(--space-1);
.d-icon {
color: var(--primary-medium);
font-size: var(--font-down-1);
content: ">";
}
}
}
li:last-child {
.separator {
display: none;
}
}
}