diff --git a/web/assets/colors.css b/web/assets/colors.css new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/web/assets/colors.css @@ -0,0 +1 @@ + diff --git a/web/assets/status.css b/web/assets/status.css index 467d4302e..2da5e33ed 100644 --- a/web/assets/status.css +++ b/web/assets/status.css @@ -63,7 +63,7 @@ main { grid-column: span 3; display: grid; grid-template-columns: 50% 50%; - grid-auto-rows: 16rem; + grid-auto-rows: 10rem; overflow: hidden; gap: 0.3rem; } @@ -108,7 +108,7 @@ main { grid-column: span 2; } -.toot .media.odd a:first-child { +.toot .media.odd a:first-child, .toot .media.double a { grid-row: span 2; } diff --git a/web/gotosocial-styling/index.js b/web/gotosocial-styling/index.js index cc8e1526e..88d9398b2 100644 --- a/web/gotosocial-styling/index.js +++ b/web/gotosocial-styling/index.js @@ -46,17 +46,26 @@ let buildDir = process.env.BUILD_DIR; if (buildDir == undefined) { buildDir = `${__dirname}/build`; } +console.log("bundling to", buildDir); -if (process.env.NODE_ENV != "development") { - getTemplates().then((templates) => { +function bundleAll() { + return getTemplates().then((templates) => { return Promise.map(templates, bundle); }); +} + +if (process.env.NODE_ENV != "development") { + bundleAll(); } else { const chokidar = require("chokidar"); console.log("Watching for changes"); - let watcher = chokidar.watch(`${__dirname}/templates`).on("all", (a) => { - // bundle(); - console.log(a) + chokidar.watch(`${__dirname}/templates`).on("all", (_, path) => { + if (path.endsWith(".css")) { + bundle([path.split("/").slice(-1)[0], path]); + } + }); + chokidar.watch(`${__dirname}/colors.css`).on("all", () => { + console.log("colors.css updated, rebuilding all templates"); + bundleAll(); }); - watcher.add(`${__dirname}/colors.css`); } \ No newline at end of file diff --git a/web/gotosocial-styling/templates/status.css b/web/gotosocial-styling/templates/status.css index affa766f3..c0e0d6ad1 100644 --- a/web/gotosocial-styling/templates/status.css +++ b/web/gotosocial-styling/templates/status.css @@ -62,7 +62,7 @@ main { grid-column: span 3; display: grid; grid-template-columns: 50% 50%; - grid-auto-rows: 16rem; + grid-auto-rows: 10rem; overflow: hidden; gap: 0.3rem; @@ -105,7 +105,7 @@ main { grid-column: span 2; } - &.odd a:first-child { + &.odd a:first-child, &.double a { grid-row: span 2; } } diff --git a/web/template/status.tmpl b/web/template/status.tmpl index b371c9017..47cd89764 100644 --- a/web/template/status.tmpl +++ b/web/template/status.tmpl @@ -10,7 +10,7 @@ {{.Content |noescape}} {{with .MediaAttachments}} -
+
{{range .}} {{if not .Description}}