Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/coingaming/moon-icons

Moon Design System icons
https://github.com/coingaming/moon-icons

Last synced: about 15 hours ago
JSON representation

Moon Design System icons

Awesome Lists containing this project

README

        

# MoonIcons

Svg-icons containing library for Moon Design System

## Elixir Installation

Add to your mix.exs

```elixir
def deps do
[
{:moon_icons, git: "[email protected]:coingaming/moon-icons.git", branch: "main"}
]
end
```

Than add folowing to your enpoint.ex

```elixir
plug Plug.Static,
at: "/moon_icons/",
from: :moon_icons,
gzip: true,
cache_control_for_etags: "public, max-age=86400"
```

To check run your app and open e.g. http://localhost:/moon_icons/icons_new/controls-chevron-up.svg

For development purposes (e.g running bin/icons-importer.ts)

```
asdf install
npm i -g ts-node
```

Now, for icons importing (from /svg folder)

## Importing icons from moom-react
```bash
rm priv/static/svgs/icons_new/*.svg
cp ../moon-icons-react/svg/*.svg priv/static/svgs/icons_new/
cd priv/static/svgs/icons_new/
# linux
# for file in ./* ; do mv "$file" "$(echo $file|sed -e 's/\([A-Z]\)/_\L\1/g' -e 's/^.\/_//')" ; done
# macos
for file in ./*.svg ; do mv "$file" "$(echo $file | sed 's/[[:upper:]]/-&/g;s/^-//' | tr '[:upper:]' '[:lower:]' | sed -e 's/^.\/-//')" ; done
cd -
rm lib_ex/moon/icons/*.ex
ts-node bin/icons-importer.ts # please note should be runned in two modes
```

`ts-node bin/icons-importer.ts`