Add assets and config

This commit is contained in:
Boris Waaub
2026-01-20 16:34:22 +01:00
parent e429e6f25b
commit ce4e946615
46 changed files with 2822 additions and 568 deletions
+26 -68
View File
@@ -1,34 +1,25 @@
const fs = require("fs");
const path = require("path");
const themePath = path.join(__dirname, "data/theme.json");
const themeRead = fs.readFileSync(themePath, "utf8");
const theme = JSON.parse(themeRead);
let font_base = Number(theme.fonts.font_size.base.replace("px", ""));
let font_scale = Number(theme.fonts.font_size.scale);
let h6 = font_base / font_base;
let h5 = h6 * font_scale;
let h4 = h5 * font_scale;
let h3 = h4 * font_scale;
let h2 = h3 * font_scale;
let h1 = h2 * font_scale;
let fontPrimary, fontPrimaryType, fontSecondary, fontSecondaryType;
if (theme.fonts.font_family.primary) {
fontPrimary = theme.fonts.font_family.primary
.replace(/\+/g, " ")
.replace(/:[ital,]*[ital@]*[wght@]*[0-9,;]+/gi, "");
fontPrimaryType = theme.fonts.font_family.primary_type;
}
if (theme.fonts.font_family.secondary) {
fontSecondary = theme.fonts.font_family.secondary
.replace(/\+/g, " ")
.replace(/:[ital,]*[ital@]*[wght@]*[0-9,;]+/gi, "");
fontSecondaryType = theme.fonts.font_family.secondary_type;
}
// Définition statique des couleurs principales (extraites de theme.json)
const primary = {
50: '#f8f9fa',
100: '#f1f3f5',
200: '#e9ecef',
300: '#dee2e6',
400: '#ced4da',
500: '#121212',
600: '#f46839',
700: '#e57469',
800: '#334d5c',
900: '#121212',
};
const secondary = '#e57469'; // à adapter si besoin
const fontPrimary = 'Open Sans, sans-serif';
const fontSecondary = 'Arial, sans-serif';
/** @type {import('tailwindcss').Config} */
module.exports = {
presets: [require('./themes/hugo-saasify-theme/tailwind.config.js')],
presets: [require('./themes/chill-theme/tailwind.config.js')],
content: [
"./themes/hugo-saasify-theme/layouts/**/*.html",
"./layouts/**/*.html",
@@ -36,53 +27,20 @@ module.exports = {
],
theme: {
extend: {
colors: {
primary,
secondary,
// Ajoutez ici d'autres couleurs statiques si besoin
},
fontFamily: {
sans: ['Inter', 'system-ui', 'sans-serif'],
heading: ['Plus Jakarta Sans', 'sans-serif'],
primary: [fontPrimary],
secondary: [fontSecondary],
},
colors: {
text: theme.colors.default.text_color.default,
light: theme.colors.default.text_color.light,
dark: theme.colors.default.text_color.dark,
primary: theme.colors.default.theme_color.primary,
secondary: theme.colors.default.theme_color.secondary,
body: theme.colors.default.theme_color.body,
border: theme.colors.default.theme_color.border,
"theme-light": theme.colors.default.theme_color.theme_light,
"theme-dark": theme.colors.default.theme_color.theme_dark,
darkmode: {
text: theme.colors.darkmode.text_color.default,
light: theme.colors.darkmode.text_color.light,
dark: theme.colors.darkmode.text_color.dark,
primary: theme.colors.darkmode.theme_color.primary,
secondary: theme.colors.darkmode.theme_color.secondary,
body: theme.colors.darkmode.theme_color.body,
border: theme.colors.darkmode.theme_color.border,
"theme-light": theme.colors.darkmode.theme_color.theme_light,
"theme-dark": theme.colors.darkmode.theme_color.theme_dark,
},
},
fontSize: {
base: font_base + "px",
h1: h1 + "rem",
"h1-sm": h1 * 0.8 + "rem",
h2: h2 + "rem",
"h2-sm": h2 * 0.8 + "rem",
h3: h3 + "rem",
"h3-sm": h3 * 0.8 + "rem",
h4: h4 + "rem",
h5: h5 + "rem",
h6: h6 + "rem",
},
fontFamily: {
primary: [fontPrimary, fontPrimaryType],
secondary: [fontSecondary, fontSecondaryType],
},
},
},
plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
],
}