Skip to content

Commit

Permalink
switched from using <a> to <button> and added a component class
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchadwick committed Jul 24, 2024
1 parent 5f344ae commit b75ebf0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 23 deletions.
14 changes: 8 additions & 6 deletions packages/frontend/app/components/user-guide-link.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<div class="user-guide-link" data-test-user-guide-link>
<a
href="https://iliosproject.gitbook.io/ilios-user-guide"
target="_blank"
rel="noopener noreferrer"
<button
type="button"
aria-haspopup="false"
aria-labelledby="user-guide-link-icon"
{{on "click" this.openUserGuide}}
>
<FaIcon
@icon="circle-question"
@icon="question"
@title={{t "general.iliosUserGuide"}}
id="user-guide-link-icon"
data-test-user-guide-link-icon
/>
</a>
</button>
</div>
9 changes: 9 additions & 0 deletions packages/frontend/app/components/user-guide-link.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Component from '@glimmer/component';
import { action } from '@ember/object';

export default class UserGuideLinkComponent extends Component {
@action
openUserGuide() {
window.open('https://iliosproject.gitbook.io/ilios-user-guide', '_blank');
}
}
41 changes: 24 additions & 17 deletions packages/frontend/app/styles/components/user-guide-link.scss
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
@use "../ilios-common/mixins" as cm;
@use "../ilios-common/colors" as c;

@use "sass:color";

$header-menu-background-color: color.adjust(c.$slightWhite, $lightness: -3%);

.user-guide-link {
margin-left: 0.5rem;
margin-right: 0.5rem;

@include cm.for-tablet-and-up {
margin-left: 0.25rem;
margin-right: 0.5rem;
}
button {
background-color: $header-menu-background-color;
border: 1px solid $header-menu-background-color;
border-radius: 0.2rem;
color: c.$raisinBlack;
font-weight: normal;
margin-left: 0.5rem;
padding: 0.25em;

a {
svg {
align-items: center;
color: c.$white;
display: flex;
height: 30px;
width: 30px;
&:hover,
&:focus {
background-color: c.$white;
}

@include cm.for-tablet-and-up {
display: inline;
margin-left: 0;
}
}

@include cm.for-phone-only {
a {
@include cm.for-phone-only {
svg {
height: 24px;
width: 24px;
height: 4.25vw;
width: 4.25vw;
}
}
}
Expand Down

0 comments on commit b75ebf0

Please sign in to comment.