mourningdove/views/components/icon-button.tt

26 lines
890 B
Text
Raw Permalink Normal View History

2026-05-24 01:03:05 +00:00
[%# views/components/icon-button.tt
Button showing only an icon (with hidden fallback text)
Authors:
Afuna <coder.dw@afunamatata.com>
Copyright (c) 2015 by Dreamwidth Studios, LLC.
This program is free software; you may redistribute it and/or modify it under
the same terms as Perl itself. For a copy of the license, please reference
'perldoc perlartistic' or 'perldoc perlgpl'.
%]
[%- dw.need_res( { group => "foundation" }
"stc/css/components/foundation-icons.css"
) -%]
<button type="[% IF button.type %][% button.type %][% ELSE %]button[% END %]" class="fi-icon--with-fallback [%- button.class -%]" [% IF button.id -%]id="[%- button.id -%]"[%- END -%]>
<span class="fi-icon fi-[%- icon -%]" aria-hidden="true"></span>
[%- IF text -%]
<span class="fi-icon--fallback">[%- text -%]</span>
[%- ELSE -%]
Need fallback text
[%- END -%]
</button>