1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +01:00

Allow any {icon} to spin

Summary: We are greedily hoarding this for ourselves, when we could enrich the world.

Test Plan: Used `{icon cog spin}`.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D14369
This commit is contained in:
epriestley 2015-10-30 16:02:19 +00:00 committed by epriestley
parent 2c3dbc48ee
commit 096117aacd
2 changed files with 16 additions and 1 deletions

View file

@ -41,6 +41,7 @@ final class PhabricatorIconRemarkupRule extends PhutilRemarkupRule {
$defaults = array(
'color' => null,
'spin' => false,
);
$options = idx($extra, 1, '');
@ -70,8 +71,16 @@ final class PhabricatorIconRemarkupRule extends PhutilRemarkupRule {
$color = null;
}
$classes = array();
$classes[] = $color;
$spin = $options['spin'];
if ($spin) {
$classes[] = 'ph-spin';
}
$icon_view = id(new PHUIIconView())
->setIconFont('fa-'.$icon, $color);
->setIconFont('fa-'.$icon, implode(' ', $classes));
return $this->getEngine()->storeText($icon_view);
}

View file

@ -496,6 +496,12 @@ For a list of available icons and colors, check the UIExamples application.
[[ http://fortawesome.github.io/Font-Awesome/ | FontAwesome ]], so you can also
browse the collection there.)
You can add `spin` to make the icon spin:
{icon cog spin}
This renders: {icon cog spin}
= Phriction Documents =