jonnybarnes/emoji-a11y
Composer 安装命令:
composer require jonnybarnes/emoji-a11y
包简介
Make emoji more accessible
关键字:
README 文档
README
Make emoji more accessible.
Install
Add this package with composer:
composer require jonnybarnes/emoji-a11y
Usage
Anywhere you have some text with emoji use the makeEmojiAccessible method.
$emoji = new Jonnybarnes\EmojiA11y\EmojiModifier();
$text = 'I’m 😀';
$emoji->makeEmojiAccessible($text); // I’m <span role="img" aria-label="grinning face">😀</span>
Customise HTML
You can pass in a string to the constructor that will be used in the
makeEmojiAccessible method. We use PHP’s sprinf
function.
Three variables are passed into the function. The desired output form, then the
text of the emoji, then the matched emoji character. Thankfully sprintf allows
you to swap variable order if you need to, see example 3 in the manual.
Of course you need to provide your own CSS for presentation.
Inspired by http://adrianroselli.com/2016/12/accessible-emoji-tweaked.html
统计信息
- 总下载量: 1.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: CC0-1.0
- 更新时间: 2017-02-02