Daicon

Daicon (Digital Agency ICONs for javascript) is a js library that makes it easier for front-end developers to handle the icon materials provided by the Digital Agency. It is based on the "Illustration Icon"(Japan Digital Agency), and provides an icon system with its own additions. The library is provided by adding its own icon system, like the bootstrap icon system.


icons

Quick Start

<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>daicon simple sample</title>
</head>

<body>
    <i data-dc-id="me_fill"></i>
    <script src="https://cdn.jsdelivr.net/gh/TetsuakiBaba/daicon@61541d7/daicon.js" crossorigin="anonymous" type="text/javascript"></script>
</body>

</html>

CDN

<script src="https://cdn.jsdelivr.net/gh/TetsuakiBaba/daicon@61541d7/daicon.js" crossorigin="anonymous" type="text/javascript"></script>

Customize: Size and Color

Daicon itself has no methods to set color or size. Use css to specify size and color. A simple example is shown below.

<div style="font-size:3em;color:coral">
<i data-dc-id="medicine_fill" ></i> Capsule Corp.
</div>
Result
Capsule Corp.

Via JavaScript

Daicon can be created via JavaScript. The following is an example of creating a daicon with JavaScript.

new daicon('#svg', 'me_fill'); 
Result

for (let j of json_daicons) {
    let element = document.createElement('span');
    document.querySelector('#all_daicons_placeholder').appendChild(element);
    new daicon(element, j.id);
}
Result

React

If you are a React user, please use this repository by @kurohune538.

License

This software is released under the MIT License, except for the Japan Digital Agency icon data.