Skip to content

Commit 8953b6f

Browse files
authored
Upgrades Heroicons to v2.1.1, and adds support for the new -micro variant (#5669)
The `-micro` variant is a new set of 16x16px icons. To support the smaller size correctly, changes are made in `tailwind.config.js`.
1 parent 2840697 commit 8953b6f

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

installer/templates/phx_assets/tailwind.config.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ module.exports = {
3939
let icons = [
4040
["", "/24/outline"],
4141
["-solid", "/24/solid"],
42-
["-mini", "/20/solid"]
42+
["-mini", "/20/solid"],
43+
["-micro", "/16/solid"]
4344
]
4445
icons.forEach(([suffix, dir]) => {
4546
fs.readdirSync(path.join(iconsDir, dir)).forEach(file => {
@@ -50,6 +51,7 @@ module.exports = {
5051
matchComponents({
5152
"hero": ({name, fullPath}) => {
5253
let content = fs.readFileSync(fullPath).toString().replace(/\r?\n|\r/g, "")
54+
let spacing = name.endsWith("-micro") ? theme("spacing.4") : theme("spacing.5")
5355
return {
5456
[`--hero-${name}`]: `url('data:image/svg+xml;utf8,${content}')`,
5557
"-webkit-mask": `var(--hero-${name})`,
@@ -58,8 +60,8 @@ module.exports = {
5860
"background-color": "currentColor",
5961
"vertical-align": "middle",
6062
"display": "inline-block",
61-
"width": theme("spacing.5"),
62-
"height": theme("spacing.5")
63+
"width": spacing,
64+
"height": spacing
6365
}
6466
}
6567
}, {values})

installer/templates/phx_single/mix.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ defmodule <%= @app_module %>.MixProject do
4949
{:tailwind, "~> 0.2", runtime: Mix.env() == :dev},
5050
{:heroicons,
5151
github: "tailwindlabs/heroicons",
52-
tag: "v2.0.18",
52+
tag: "v2.1.1",
5353
app: false,
5454
compile: false,
5555
sparse: "optimized"},<% end %><%= if @mailer do %>

installer/templates/phx_umbrella/apps/app_name_web/mix.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ defmodule <%= @web_namespace %>.MixProject do
4747
{:tailwind, "~> 0.2", runtime: Mix.env() == :dev},
4848
{:heroicons,
4949
github: "tailwindlabs/heroicons",
50-
tag: "v2.0.18",
50+
tag: "v2.1.1",
5151
app: false,
5252
compile: false,
5353
sparse: "optimized"},<% end %>

integration_test/mix.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ defmodule Phoenix.Integration.MixProject do
5858
{:tailwind, "~> 0.2"},
5959
{:heroicons,
6060
github: "tailwindlabs/heroicons",
61-
tag: "v2.0.18",
61+
tag: "v2.1.1",
6262
app: false,
6363
compile: false,
6464
sparse: "optimized"},

0 commit comments

Comments
 (0)