CSS Hyphenation Polyfill – Hyphenopoly.js

Category: Javascript , Recommended | November 12, 2018
Author:mnater
Views Total:1,187 views
Official Page:Go to website
Last Update:November 12, 2018
License:MIT

Preview:

CSS Hyphenation Polyfill – Hyphenopoly.js

Description:

Hyphenopoly.js is a JavaScript polyfill for those browsers/user agents that don’t support the CSS hyphenation.

Supports multiple languages and easy to implement.

Example use:

Download and import the Hyphenopoly.js into the document.

<script src="Hyphenopoly_Loader.js"></script>

Create a new instance and config the Hyphenopoly.

var Hyphenopoly = {
    require: {
        "la": "honorificabilitudinitas",
        "de": "Silbentrennungsalgorithmus",
        "en-us": "Supercalifragilisticexpialidocious"
    },
    setup: {
        classnames: {
            "container": {}
        }
    }
};
<div class="container">
  <p lang="la">Qua de causa Helvetii quoque reliquos Gallos virtute praecedunt, quod fere cotidianis proeliis cum Germanis contendunt, cum aut suis finibus eos prohibent aut ipsi in eorum finibus bellum gerunt.</p>
  <p lang="en-us">For which reason the Helvetii also surpass the rest of the Gauls in valor, as they contend with the Germans in almost daily battles, when they either repel them from their own territories, or themselves wage war on their frontiers.</p>
  <p lang="de">Aus diesem Grund übertreffen auch die Helvetier die übrigen Gallier an Tapferkeit, weil sie sich in fast täglichen Gefechten mit den Germanen messen, wobei sie diese entweder von ihrem Gebiet fernhalten oder selbst in deren Gebiet kämpfen.</p>
</div>

Changelog:

11/12/2018

  • v2.6.0

You Might Be Interested In:


Leave a Reply