Skip to content

Commit

Permalink
feat: custom font
Browse files Browse the repository at this point in the history
  • Loading branch information
abehidek committed Nov 28, 2023
1 parent 01c3154 commit cf97234
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {Socket} from "phoenix"
import {LiveSocket} from "phoenix_live_view"
import topbar from "../vendor/topbar"
import hljs from "highlight.js"
import "@fontsource/zen-kaku-gothic-new/index.css"

window.test = () => {
alert("test 2")
Expand Down
6 changes: 6 additions & 0 deletions assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"dependencies": {
"@fontsource/zen-kaku-gothic-new": "^5.0.16",
"highlight.js": "^11.9.0"
}
}
5 changes: 5 additions & 0 deletions assets/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
const plugin = require("tailwindcss/plugin")
const fs = require("fs")
const path = require("path")
const defaultTheme = require("tailwindcss/defaultTheme")

/** @type {import("tailwindcss").Config} */
module.exports = {
content: [
"./js/**/*.js",
Expand All @@ -14,6 +16,9 @@ module.exports = {
],
theme: {
extend: {
fontFamily: {
sans: ["Zen Kaku Gothic New", ...defaultTheme.fontFamily.sans]
},
colors: {
brand: "#FD4F00",
}
Expand Down
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ config :esbuild,
version: "0.17.11",
default: [
args:
~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
~w(js/app.js --bundle --loader:.woff2=file --loader:.woff=file --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
cd: Path.expand("../assets", __DIR__),
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
]
Expand Down
7 changes: 6 additions & 1 deletion lib/hidek_xyz_web/components/layouts/root.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
<%= assigns[:page_title] || "Page" %>
</.live_title>
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
<link
phx-track-static
rel="stylesheet"
href={~p"/assets/node_modules/@fontsource/zen-kaku-gothic-new/index.css"}
/>
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
</script>
</head>
<body class="bg-[#101414] text-white antialiased mx-auto max-w-2xl px-4 py-6 sm:px-6 lg:px-8">
<body class="bg-[#101414] text-white antialiased mx-auto max-w-2xl px-4 py-6 sm:px-6 lg:px-8 font-sans">
<%= @inner_content %>
</body>
</html>
3 changes: 2 additions & 1 deletion lib/hidek_xyz_web/live/index_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ defmodule HidekXyzWeb.IndexLive do
def render(assigns) do
~H"""
<div>
<h1 class="font-bold text-3xl mb-4">Abe Guilherme Hidek</h1>
<h1 class="font-black text-3xl mb-4">Abe Guilherme Hidek</h1>
<p>あべ</p>
<p>
A generalist working for software development, days off experimenting things with elixir, rust and self-hosting.
</p>
Expand Down

0 comments on commit cf97234

Please sign in to comment.