Merge pull request #321 from josefaidt/320-add-rel-all-links

chore(links): add rel="" to all links
This commit is contained in:
Eric Liu 2020-10-13 13:09:13 -07:00 committed by GitHub
commit e382038850
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 2 deletions

View file

@ -15,6 +15,7 @@
{#if href} {#if href}
<a <a
href="{href}" href="{href}"
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
role="button" role="button"
class:bx--skeleton="{true}" class:bx--skeleton="{true}"
class:bx--btn="{true}" class:bx--btn="{true}"

View file

@ -54,7 +54,7 @@
class:bx--link--inline="{inline}" class:bx--link--inline="{inline}"
class:bx--link--visited="{visited}" class:bx--link--visited="{visited}"
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}" rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
{href} href="{href}"
{...$$restProps} {...$$restProps}
on:click on:click
on:mouseover on:mouseover

View file

@ -24,6 +24,7 @@
class:bx--tile--clickable="{true}" class:bx--tile--clickable="{true}"
class:bx--tile--is-clicked="{clicked}" class:bx--tile--is-clicked="{clicked}"
class:bx--tile--light="{light}" class:bx--tile--light="{light}"
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
{...$$restProps} {...$$restProps}
href="{href}" href="{href}"
on:click on:click

View file

@ -41,8 +41,9 @@
class:bx--header__action="{true}" class:bx--header__action="{true}"
class:bx--header__action--active="{linkIsActive}" class:bx--header__action--active="{linkIsActive}"
class:action-link="{true}" class:action-link="{true}"
{...$$restProps}
href="{href}" href="{href}"
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
{...$$restProps}
> >
<Icon {...icon} /> <Icon {...icon} />
</a> </a>

View file

@ -24,6 +24,7 @@
role="menuitem" role="menuitem"
tabindex="0" tabindex="0"
href="{href}" href="{href}"
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
class:bx--header__menu-item="{true}" class:bx--header__menu-item="{true}"
{...$$restProps} {...$$restProps}
on:click on:click

View file

@ -16,6 +16,7 @@
<a <a
bind:this="{ref}" bind:this="{ref}"
href="{href}" href="{href}"
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
class:bx--switcher__item-link="{true}" class:bx--switcher__item-link="{true}"
{...$$restProps} {...$$restProps}
on:click on:click

View file

@ -37,6 +37,7 @@
bind:this="{ref}" bind:this="{ref}"
aria-current="{isSelected ? 'page' : undefined}" aria-current="{isSelected ? 'page' : undefined}"
href="{href}" href="{href}"
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
class:bx--side-nav__link="{true}" class:bx--side-nav__link="{true}"
class:bx--side-nav__link--current="{isSelected}" class:bx--side-nav__link--current="{isSelected}"
{...$$restProps} {...$$restProps}