Last active
April 22, 2019 05:19
-
-
Save kimihito/2a97675699e472cb6b69f18adddca120 to your computer and use it in GitHub Desktop.
twemoji + Stimulus.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! | |
%html | |
%head | |
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ | |
%title Idone.today | |
= csrf_meta_tags | |
= csp_meta_tag | |
= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' | |
= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' | |
%body.bg-gray{ data: { controller: 'emoji-parser'} } | |
= render 'layouts/header' | |
.container-lg.clearfix.p-2 | |
= render 'layouts/messages' | |
= yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Controller } from 'stimulus' | |
import twemoji from 'twemoji' | |
export default class extends Controller { | |
connect() { | |
twemoji.parse(this.element, { folder: 'svg', ext: '.svg'}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment