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

update link usage #115

Merged
merged 2 commits into from
Sep 23, 2020
Merged

Conversation

indirectlylit
Copy link
Contributor

This PR changes nearly all instances of internal and external links to use props instead of slots, from this form:

Follow the <DocsExternalLink href="https://material.io/design">
  Material design guidelines
</DocsExternalLink>.

to this form

Follow the <DocsExternalLink text="Material design guidelines" href="https://material.io/design" />.

This has two advantages:

A) the previous form causes undesirable underline behaviors:

before after
image image

B) The code is more concise.

Note while possibly desirable for consistency with <a href="...">...</a>, it is not possible to write this form:

Follow the <DocsExternalLink href="https://material.io/design">Material design guidelines</DocsExternalLink>.

It appears that Vue-ESLint always inserts additional whitespace, and I can't determine any way of disabling this behavior.

@indirectlylit
Copy link
Contributor Author

self-merge

@indirectlylit indirectlylit merged commit 3e56c3f into learningequality:v0.2.x Sep 23, 2020
@indirectlylit
Copy link
Contributor Author

also relevant - here is how we eslint from messing up whitespace internally within the component:

<!-- eslint-disable -->
<!-- prevent line from wrapping so that icon displays correctly -->
<a :href="href" target="_blank"><template v-if="text">{{ text }}</template><template v-else><slot></slot></template><KIcon icon="openNewTab" class="pop" disableColor /></a>
<!-- eslint-enable -->

@indirectlylit indirectlylit deleted the links branch September 23, 2020 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant