Skip to content

Commit

Permalink
build css ahead of time
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Nov 26, 2024
1 parent 82fa9c1 commit 5589cfd
Show file tree
Hide file tree
Showing 13 changed files with 137 additions and 76 deletions.
17 changes: 2 additions & 15 deletions kitsune-fe/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import forms from '@tailwindcss/forms';
import typography from '@tailwindcss/typography';
import { extendTheme } from '../kitsune/theme';

import type { Config } from 'tailwindcss';

Expand All @@ -8,21 +9,7 @@ export default {

theme: {
extend: {
colors: {
dark: {
'1': '#1c1626',
'2': '#2b233a',
'3': '#042f40'
},
shade1: {
dark: '#ff9e55',
light: '#afd7fa'
},
shade2: {
dark: '#935d7e',
light: '#d68fbc'
}
}
...extendTheme
}
},

Expand Down
1 change: 1 addition & 0 deletions kitsune/assets/app.css

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

18 changes: 18 additions & 0 deletions kitsune/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "kitsune",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "tailwindcss -i styles/app.css -o assets/app.css --minify",
"dev": "tailwindcss -i styles/tailwind.css -o assets/app.css --watch",
"fmt": "prettier --write --ignore-unknown --cache ."
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"prettier": "^3.4.1",
"prettier-plugin-tailwindcss": "^0.6.9",
"tailwindcss": "^3.4.15"
}
}
3 changes: 3 additions & 0 deletions kitsune/styles/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
17 changes: 17 additions & 0 deletions kitsune/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import forms from "@tailwindcss/forms";
import typography from "@tailwindcss/typography";
import { extendTheme } from "./theme";

import type { Config } from "tailwindcss";

export default {
content: ["./templates/**/*.{html,js,ts}"],

theme: {
extend: {
...extendTheme,
},
},

plugins: [typography, forms],
} as Config;
33 changes: 13 additions & 20 deletions kitsune/templates/base.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/public/app.css" />

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/public/template.css">
{% block head %} {% endblock %}

{% block head %}
{% endblock %}
<title>{% block title %} {% endblock %}</title>
</head>

<title>
{% block title %}
{% endblock %}
</title>
</head>

<body>
{% block body %}
{% endblock %}
</body>

</html>
<body>
{% block body %} {% endblock %}
</body>
</html>
2 changes: 1 addition & 1 deletion kitsune/templates/fallback-fallback.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<title>Welcome to Kitsune!</title>
Expand Down
51 changes: 28 additions & 23 deletions kitsune/templates/oauth/login.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
{% extends "../base.html" %}
{% extends "../base.html" %} {% block title %}OAuth Login{% endblock %} {% block
body %}
<p class="header">Kitsune</p>

{% block title %}
OAuth Login
{% endblock %}

{% block body %}
<p class="header">Kitsune</p>
{% for (_level, msg) in flash_messages %}
<div class="message">{{ msg }}</div>
{% endfor %}

{% for (_level, msg) in flash_messages %}
<div class="message">
{{ msg }}
</div>
{% endfor %}

<form method="post">
<div>
<label class="label" for="username">Username</label><br />
<input class="field" type="text" id="username" name="username" value="" /><br />
<label class="label" for="password">Password</label><br />
<input class="field" type="password" id="password" name="password" value="" /><br /><br />
</div>
<input class="formButton" type="submit" value="Submit" />
</form>
{% endblock %}
<form method="post">
<div>
<label class="label" for="username">Username</label><br />
<input
class="field"
type="text"
id="username"
name="username"
value=""
/><br />
<label class="label" for="password">Password</label><br />
<input
class="field"
type="password"
id="password"
name="password"
value=""
/><br /><br />
</div>
<input class="formButton" type="submit" value="Submit" />
</form>
{% endblock %}
21 changes: 7 additions & 14 deletions kitsune/templates/oauth/token.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
{% extends "../base.html" %}
{% extends "../base.html" %} {% block title %} OAuth Token {% endblock %} {%
block body %}
<p class="header">{{domain}}</p>

{% block title %}
OAuth Token
<div class="tokenContainer">
<p>Copy & Paste this token into <span class="appName">{{app_name}}</span></p>
<code class="token">{{token}}</code>
</div>
{% endblock %}

{% block body %}
<p class="header">
{{domain}}
</p>

<div class="tokenContainer">
<p>Copy & Paste this token into <span class="appName">{{app_name}}</span></p>
<code class="token">{{token}}</code>
</div>
{% endblock %}
19 changes: 19 additions & 0 deletions kitsune/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const extendTheme = {
colors: {
dark: {
"1": "#1c1626",
"2": "#2b233a",
"3": "#042f40",
},
shade1: {
dark: "#ff9e55",
light: "#afd7fa",
},
shade2: {
dark: "#935d7e",
light: "#d68fbc",
},
},
};

export { extendTheme };
26 changes: 25 additions & 1 deletion pnpm-lock.yaml

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

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
packages:
- kitsune/
- kitsune-fe/
- website/
4 changes: 2 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro",
"format": "prettier -w . --cache"
"fmt": "prettier -w . --cache"
},
"dependencies": {
"@astrojs/check": "^0.9.4",
Expand All @@ -23,4 +23,4 @@
"prettier-plugin-astro": "^0.14.1",
"sass": "^1.81.0"
}
}
}

0 comments on commit 5589cfd

Please sign in to comment.