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

fix: switch back link to use link icon #156

Merged
merged 2 commits into from
Jul 11, 2022

Conversation

dlockhart
Copy link
Contributor

A pretty simple swap here -- now that <d2l-navigation-link-icon> exists, <d2l-navigation-link-back> can just use it directly.

Had to fix this sequences usage, which was reaching into the shadow DOM:
https://github.com/BrightspaceHypermediaComponents/sequences/pull/442

I'm expecting a 1px width increase as the spacing between the icon and text will go from 5px to 6px.

@github-actions
Copy link
Contributor

Visual diff tests failed - pull request #157 has been opened with the updated goldens.

@@ -133,10 +133,6 @@ class D2LNavigationImmsersive extends DirMixin(PolymerElement) {
visibility: hidden;
}

d2l-navigation-link-back {
--d2l-navigation-link-back-left-padding: 12px;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the only place overriding this padding value -- I checked with Jeff and he saw no need to do this.

@@ -179,10 +175,6 @@ class D2LNavigationImmsersive extends DirMixin(PolymerElement) {
margin: 0 18px;
padding: 0 18px;
}
d2l-navigation-link-back {
--d2l-navigation-link-back-left-padding: 6px;
margin: 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No margin was set, so this was doing nothing.

:host {
display: inline-block;
height: 100%;
white-space: nowrap;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nowrap is set in d2l-navigation-link-icon, so not needed.

}

render() {
const href = this.href ? this.href : 'javascript:void(0);'; // backwards-compatible for uses before missing "href" threw exception
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hoping to avoid this, but there are quite a few places (including the LMS) that are abusing it.

@@ -30,6 +30,7 @@ export const highlightLinkStyles = css`
position: relative;
text-decoration: none;
vertical-align: middle;
white-space: nowrap;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have always been here, to avoid text/icon wrapping onto separate lines.

Co-authored-by: github-actions <github-actions@github.com>
Copy link
Contributor

@svanherk svanherk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@dlockhart dlockhart merged commit b8d991f into main Jul 11, 2022
@dlockhart dlockhart deleted the dlockhart/link-back-use-link-icon branch July 11, 2022 21:23
@ghost
Copy link

ghost commented Jul 11, 2022

🎉 This PR is included in version 5.5.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ghost ghost added the released label Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants