ponychicken
Hello!
Hero Icons are nice, but sometimes you might need an icon set with a larger set.
Material Design Icons are visually quite compatible (imo).
To add them efficiently to your Phoenix project without loading the whole icon font:
Add to mix.exs:
{:materialdesignicons,
github: "Templarian/MaterialDesign", sparse: "svg", app: false, compile: false, depth: 1},
Add to tailwindconfig.js
// Embeds Material Desing Icons into your main.css bundle
// See your `CoreComponents.icon/1` for more information.
plugin(function ({ matchComponents, theme }) {
let iconsDir = path.join(__dirname, "../deps/materialdesignicons/svg");
let values = {};
fs.readdirSync(iconsDir).forEach((file) => {
let name = path.basename(file, ".svg");
values[name] = { name, fullPath: path.join(iconsDir, file) };
});
matchComponents(
{
mdi: ({ name, fullPath }) => {
let content = fs
.readFileSync(fullPath)
.toString()
.replace(/\r?\n|\r/g, "");
let size = theme("spacing.6");
return {
[`--mdi-${name}`]: `url('data:image/svg+xml;utf8,${content}')`,
"-webkit-mask": `var(--mdi-${name})`,
mask: `var(--mdi-${name})`,
"mask-repeat": "no-repeat",
"background-color": "currentColor",
"vertical-align": "middle",
display: "inline-block",
width: size,
height: size,
};
},
},
{ values }
);
}),
That’s it! Use them with the classes mdi-ICONAME
Trending in Guides/Tuts
I’ve spent some time understanding how to do hot code reloading with releases built using mix release, and here I’d like to detail the st...
New
# ~/src/livebook/.iex.exs
System.cmd("xdg-open", [ LivebookWeb.Endpoint.access_url() ] )
Because Livebook requires a unique passcode on ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










