mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
fix(header-action-link): align icon with HeaderAction
(#1161)
This commit is contained in:
parent
e2c980e23a
commit
5d153601b3
2 changed files with 37 additions and 40 deletions
|
@ -54,8 +54,7 @@
|
||||||
}}"
|
}}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div>
|
<button
|
||||||
<button
|
|
||||||
bind:this="{ref}"
|
bind:this="{ref}"
|
||||||
type="button"
|
type="button"
|
||||||
class:bx--header__action="{true}"
|
class:bx--header__action="{true}"
|
||||||
|
@ -67,7 +66,7 @@
|
||||||
isOpen = !isOpen;
|
isOpen = !isOpen;
|
||||||
dispatch(isOpen ? 'open' : 'close');
|
dispatch(isOpen ? 'open' : 'close');
|
||||||
}}"
|
}}"
|
||||||
>
|
>
|
||||||
<svelte:component this="{icon}" style="{isOpen ? 'display: none' : ''}" />
|
<svelte:component this="{icon}" style="{isOpen ? 'display: none' : ''}" />
|
||||||
<svelte:component
|
<svelte:component
|
||||||
this="{closeIcon}"
|
this="{closeIcon}"
|
||||||
|
@ -76,8 +75,8 @@
|
||||||
<slot name="text">
|
<slot name="text">
|
||||||
{#if text}<span>{text}</span>{/if}
|
{#if text}<span>{text}</span>{/if}
|
||||||
</slot>
|
</slot>
|
||||||
</button>
|
</button>
|
||||||
{#if isOpen}
|
{#if isOpen}
|
||||||
<div
|
<div
|
||||||
bind:this="{refPanel}"
|
bind:this="{refPanel}"
|
||||||
class:bx--header-panel="{true}"
|
class:bx--header-panel="{true}"
|
||||||
|
@ -89,8 +88,7 @@
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.action-text {
|
.action-text {
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
bind:this="{ref}"
|
bind:this="{ref}"
|
||||||
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}"
|
|
||||||
href="{href}"
|
href="{href}"
|
||||||
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
|
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
|
@ -31,11 +30,11 @@
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.action-link {
|
.bx--header__action {
|
||||||
text-align: center;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
vertical-align: middle;
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding-top: 10px;
|
/** Hot fix to align icon with `HeaderAction` */
|
||||||
|
padding-bottom: 2px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue