Skip to content

Commit 64101a3

Browse files
Add tailwind
1 parent 74e6a6a commit 64101a3

File tree

9 files changed

+940
-61
lines changed

9 files changed

+940
-61
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
*.ez
33
/build
44
/priv
5+
/node_modules
56
erl_crash.dump

build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
gleam run -m build
2+
npx tailwindcss -i ./static/main.css -o ./priv/style.css

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"devDependencies": {
3+
"tailwindcss": "^3.4.16"
4+
}
5+
}

pnpm-lock.yaml

Lines changed: 836 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/website/components.gleam

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ pub fn head(page: String) -> Element(a) {
3131
])
3232
}
3333

34-
pub fn page(name: String, body: List(Element(a))) -> Element(a) {
35-
html.html([attribute("lang", "en")], [head(name), html.body([], body)])
34+
pub fn page(name: String, content: List(Element(a))) -> Element(a) {
35+
html.html([attribute("lang", "en")], [
36+
head(name),
37+
html.body([attribute.class("min-h-screen bg-slate-800 text-white")], [
38+
html.main([attribute.class("py-24")], content),
39+
]),
40+
])
3641
}

src/website/page/index.gleam

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,56 @@ import website/components
44

55
pub fn view() {
66
components.page("Home", [
7-
html.main([], [
8-
html.div([], [
9-
html.h1([], [html.text("Hello and welcome to my website!")]),
10-
]),
11-
html.div([], [
12-
html.p([], [
7+
html.div([attribute.class("mx-auto max-w-3xl px-4 sm:px-6 lg:px-8")], [
8+
html.h1(
9+
[attribute.class("text-3xl font-bold leading-tight text-center")],
10+
[html.text("Hello and welcome to my website!")],
11+
),
12+
]),
13+
html.div(
14+
[attribute.class("mx-auto max-w-3xl px-4 sm:px-6 lg:px-8 py-8 leading-8")],
15+
[
16+
html.p([attribute.class("text-xl")], [
1317
html.text("I am Gears, a software developer and Minecraft YouTuber."),
1418
html.br([]),
1519
html.text("More about me in the "),
16-
html.a([attribute.href("/about/")], [html.text("about")]),
20+
html.a(
21+
[attribute.href("/about/"), attribute.class("underline font-bold")],
22+
[html.text("about")],
23+
),
1724
html.text(" section."),
1825
html.br([]),
1926
html.text("You can check out my finished and ongoing projects in "),
20-
html.a([attribute.href("/projects/")], [html.text("projects")]),
27+
html.a(
28+
[
29+
attribute.href("/projects/"),
30+
attribute.class("underline font-bold"),
31+
],
32+
[html.text("projects")],
33+
),
2134
html.text("."),
2235
html.br([]),
2336
html.text("For information on Minecraft datapack commissions, see "),
24-
html.a([attribute.href("/commissions/")], [html.text("commissions")]),
37+
html.a(
38+
[
39+
attribute.href("/commissions/"),
40+
attribute.class("underline font-bold"),
41+
],
42+
[html.text("commissions")],
43+
),
2544
html.text("."),
2645
html.br([]),
2746
html.text("If you have more questions, you can "),
28-
html.a([attribute.href("/contact/")], [html.text("contact me")]),
47+
html.a(
48+
[
49+
attribute.href("/contact/"),
50+
attribute.class("underline font-bold"),
51+
],
52+
[html.text("contact me")],
53+
),
2954
html.text("."),
3055
]),
31-
]),
32-
]),
56+
],
57+
),
3358
])
3459
}

static/main.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

static/style.css

Lines changed: 0 additions & 47 deletions
This file was deleted.

tailwind.config.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
const defaultTheme = require('tailwindcss/defaultTheme');
2+
3+
module.exports = {
4+
content:["./src/**/*.gleam"],
5+
theme: {
6+
screens: {
7+
xs: '375px',
8+
mob: '450px',
9+
sm: '640px',
10+
md: '768px',
11+
tab: '860px',
12+
lg: '1024px',
13+
xl: '1280px',
14+
'2xl': '1536px',
15+
hd: '1920px',
16+
},
17+
extend: {
18+
fontFamily: {
19+
sans: ['Inter var', ...defaultTheme.fontFamily.sans],
20+
celandine: ['Celandine', ...defaultTheme.fontFamily.sans],
21+
},
22+
width: {
23+
icon: '48px',
24+
},
25+
height: {
26+
icon: '48px',
27+
},
28+
maxWidth: {
29+
icon: '48px',
30+
icon_padding: '72px',
31+
},
32+
animation: {
33+
write: 'write 3s linear forwards',
34+
},
35+
keyframes: {
36+
write: {
37+
'90%': { 'stroke-dashoffset': '0', fill: 'rgba(255,255,255,0)' },
38+
'100%': { fill: 'rgba(255,255,255,255)' },
39+
},
40+
},
41+
scale: {
42+
105: '105%',
43+
},
44+
},
45+
},
46+
variants: {},
47+
plugins: [],
48+
};
49+

0 commit comments

Comments
 (0)