Skip to content
This repository has been archived by the owner on Jan 16, 2018. It is now read-only.

Commit

Permalink
SF
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Lancha authored and jbalsas committed Dec 27, 2017
1 parent 3179044 commit e6a9dde
Showing 1 changed file with 32 additions and 27 deletions.
59 changes: 32 additions & 27 deletions packages/clay-button/src/ClayButton.soy
Original file line number Diff line number Diff line change
Expand Up @@ -57,42 +57,25 @@
{@param? label: html|string}
{@param? spritemap: string}

{let $classes kind="text"}
inline-item
{if $iconAlignment == 'left'}
{sp}inline-item-before
{elseif $iconAlignment == 'right'}
{sp}inline-item-after
{/if}
{/let}

{let $iconContent kind="html"}
{if $icon and $spritemap}
{call .icon}
{param icon: $icon /}
{param iconAlignment: $iconAlignment /}
{param label: $label /}
{param spritemap: $spritemap /}
{/call}
{/if}
{/let}

{let $iconWrapper kind="html"}
{if $label}
<span class="{$classes}">
{$iconContent}
</span>
{else}
{$iconContent}
{/if}
{/let}

{if $icon and $iconAlignment == 'left' and $spritemap}
{$iconWrapper}
{if $iconContent != '' and $iconAlignment == 'left'}
{$iconContent}
{/if}

{$label ?: ''}

{if $icon and $iconAlignment == 'right' and $spritemap}
{$iconWrapper}
{if $iconContent != '' and $iconAlignment == 'right'}
{$iconContent}
{/if}
{/template}

Expand All @@ -102,11 +85,33 @@
{template .icon}
{@param icon: string}
{@param spritemap: string}
{@param? iconAlignment: string}
{@param? label: html|string}

{let $iconContent kind="html"}
{call ClayIcon.render}
{param spritemap: $spritemap /}
{param symbol: $icon /}
{/call}
{/let}

{if $label}
{let $iconWrapperClasses kind="text"}
inline-item
{if $iconAlignment == 'left'}
{sp}inline-item-before
{elseif $iconAlignment == 'right'}
{sp}inline-item-after
{/if}
{/let}

<span class="{$iconWrapperClasses}">
{$iconContent}
</span>
{else}
{$iconContent}
{/if}

{call ClayIcon.render}
{param spritemap: $spritemap /}
{param symbol: $icon /}
{/call}
{/template}

/**
Expand Down

0 comments on commit e6a9dde

Please sign in to comment.