2024-10-20 23:25:59 -04:00
|
|
|
// See the Tailwind configuration guide for advanced usage
|
|
|
|
|
// https://tailwindcss.com/docs/configuration
|
|
|
|
|
|
2024-10-21 19:20:35 -04:00
|
|
|
const plugin = require("tailwindcss/plugin");
|
|
|
|
|
const fs = require("fs");
|
|
|
|
|
const path = require("path");
|
2024-10-20 23:25:59 -04:00
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
content: [
|
|
|
|
|
"./js/**/*.js",
|
|
|
|
|
"../lib/zoeyscomputer_web.ex",
|
2024-10-21 19:20:35 -04:00
|
|
|
"../lib/zoeyscomputer_web/**/*.*ex",
|
2024-10-20 23:25:59 -04:00
|
|
|
],
|
|
|
|
|
theme: {
|
2024-10-26 15:01:33 -04:00
|
|
|
fontSize: {
|
|
|
|
|
sm: "1rem",
|
|
|
|
|
base: "1.2rem",
|
|
|
|
|
xl: "1.45rem",
|
|
|
|
|
"2xl": "1.563rem",
|
|
|
|
|
"3xl": "1.953rem",
|
|
|
|
|
"4xl": "2.441rem",
|
|
|
|
|
"5xl": "3.052rem",
|
|
|
|
|
},
|
|
|
|
|
fontFamily: {
|
|
|
|
|
sans: ["Iosevka Web", "monospace"],
|
|
|
|
|
},
|
2024-10-20 23:25:59 -04:00
|
|
|
extend: {
|
2024-10-26 15:01:33 -04:00
|
|
|
keyframes: {
|
|
|
|
|
"fade-in": {
|
|
|
|
|
"0%": { opacity: 0 },
|
|
|
|
|
"100%": { opacity: 1 },
|
|
|
|
|
},
|
|
|
|
|
"fade-out": {
|
|
|
|
|
"0%": { opacity: 1 },
|
|
|
|
|
"100%": { opacity: 0 },
|
|
|
|
|
},
|
|
|
|
|
"zoom-in": {
|
|
|
|
|
"0%": { transform: "scale(0.95)" },
|
|
|
|
|
"100%": { transform: "scale(1)" },
|
|
|
|
|
},
|
|
|
|
|
"zoom-out": {
|
|
|
|
|
"0%": { transform: "scale(1)" },
|
|
|
|
|
"100%": { transform: "scale(0.95)" },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
animation: {
|
|
|
|
|
"fade-in-0": "fade-in 0.2s ease-in-out",
|
|
|
|
|
"fade-in": "fade-in 0.3s ease-in-out",
|
|
|
|
|
"fade-out-0": "fade-out 0.2s ease-in-out",
|
|
|
|
|
"fade-out": "fade-out 0.3s ease-in-out",
|
|
|
|
|
"zoom-in-95": "zoom-in 0.2s ease-in-out",
|
|
|
|
|
"zoom-out-95": "zoom-out 0.2s ease-in-out",
|
|
|
|
|
},
|
2024-10-20 23:25:59 -04:00
|
|
|
colors: {
|
|
|
|
|
brand: "#FD4F00",
|
2024-10-21 19:20:35 -04:00
|
|
|
},
|
2024-10-20 23:25:59 -04:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
plugins: [
|
|
|
|
|
require("@tailwindcss/forms"),
|
|
|
|
|
// Allows prefixing tailwind classes with LiveView classes to add rules
|
|
|
|
|
// only when LiveView classes are applied, for example:
|
|
|
|
|
//
|
|
|
|
|
// <div class="phx-click-loading:animate-ping">
|
|
|
|
|
//
|
2024-10-26 15:01:33 -04:00
|
|
|
require("tailwindcss-animate"),
|
2024-10-21 19:20:35 -04:00
|
|
|
require("@catppuccin/tailwindcss")({
|
|
|
|
|
prefix: "ctp",
|
|
|
|
|
defaultFlavor: "mocha",
|
|
|
|
|
}),
|
2024-11-14 13:05:48 -05:00
|
|
|
require("tailwind-scrollbar"),
|
2024-10-21 19:20:35 -04:00
|
|
|
plugin(({ addVariant }) =>
|
|
|
|
|
addVariant("phx-click-loading", [
|
|
|
|
|
".phx-click-loading&",
|
|
|
|
|
".phx-click-loading &",
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
plugin(({ addVariant }) =>
|
|
|
|
|
addVariant("phx-submit-loading", [
|
|
|
|
|
".phx-submit-loading&",
|
|
|
|
|
".phx-submit-loading &",
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
plugin(({ addVariant }) =>
|
|
|
|
|
addVariant("phx-change-loading", [
|
|
|
|
|
".phx-change-loading&",
|
|
|
|
|
".phx-change-loading &",
|
|
|
|
|
]),
|
|
|
|
|
),
|
2024-10-20 23:25:59 -04:00
|
|
|
|
|
|
|
|
// Embeds Heroicons (https://heroicons.com) into your app.css bundle
|
|
|
|
|
// See your `CoreComponents.icon/1` for more information.
|
|
|
|
|
//
|
2024-10-21 19:20:35 -04:00
|
|
|
plugin(function ({ matchComponents, theme }) {
|
|
|
|
|
let iconsDir = path.join(__dirname, "../deps/heroicons/optimized");
|
|
|
|
|
let values = {};
|
2024-10-20 23:25:59 -04:00
|
|
|
let icons = [
|
|
|
|
|
["", "/24/outline"],
|
|
|
|
|
["-solid", "/24/solid"],
|
|
|
|
|
["-mini", "/20/solid"],
|
2024-10-21 19:20:35 -04:00
|
|
|
["-micro", "/16/solid"],
|
|
|
|
|
];
|
2024-10-20 23:25:59 -04:00
|
|
|
icons.forEach(([suffix, dir]) => {
|
2024-10-21 19:20:35 -04:00
|
|
|
fs.readdirSync(path.join(iconsDir, dir)).forEach((file) => {
|
|
|
|
|
let name = path.basename(file, ".svg") + suffix;
|
|
|
|
|
values[name] = { name, fullPath: path.join(iconsDir, dir, file) };
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
matchComponents(
|
|
|
|
|
{
|
|
|
|
|
hero: ({ name, fullPath }) => {
|
|
|
|
|
let content = fs
|
|
|
|
|
.readFileSync(fullPath)
|
|
|
|
|
.toString()
|
|
|
|
|
.replace(/\r?\n|\r/g, "");
|
|
|
|
|
let size = theme("spacing.6");
|
|
|
|
|
if (name.endsWith("-mini")) {
|
|
|
|
|
size = theme("spacing.5");
|
|
|
|
|
} else if (name.endsWith("-micro")) {
|
|
|
|
|
size = theme("spacing.4");
|
|
|
|
|
}
|
|
|
|
|
return {
|
|
|
|
|
[`--hero-${name}`]: `url('data:image/svg+xml;utf8,${content}')`,
|
|
|
|
|
"-webkit-mask": `var(--hero-${name})`,
|
|
|
|
|
mask: `var(--hero-${name})`,
|
|
|
|
|
"mask-repeat": "no-repeat",
|
|
|
|
|
"background-color": "currentColor",
|
|
|
|
|
"vertical-align": "middle",
|
|
|
|
|
display: "inline-block",
|
|
|
|
|
width: size,
|
|
|
|
|
height: size,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{ values },
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
};
|