From 95e79a731696ba466015410bb805a3880fafa05a Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 26 Jan 2020 15:31:24 -0500 Subject: [PATCH] fix: auto beautify css injection in admin --- dev/build/Dockerfile | 4 ++-- server/graph/resolvers/theming.js | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dev/build/Dockerfile b/dev/build/Dockerfile index 80b18135..5d710468 100644 --- a/dev/build/Dockerfile +++ b/dev/build/Dockerfile @@ -1,7 +1,7 @@ # ==================== # --- Build Assets --- # ==================== -FROM node:12.13-alpine AS assets +FROM node:12.14-alpine AS assets RUN apk add yarn g++ make python --no-cache @@ -23,7 +23,7 @@ RUN yarn --production --frozen-lockfile --non-interactive # =============== # --- Release --- # =============== -FROM node:12.13-alpine +FROM node:12.14-alpine LABEL maintainer="requarks.io" RUN apk add bash curl git openssh gnupg sqlite --no-cache && \ diff --git a/server/graph/resolvers/theming.js b/server/graph/resolvers/theming.js index 89625c55..cfd63670 100644 --- a/server/graph/resolvers/theming.js +++ b/server/graph/resolvers/theming.js @@ -20,7 +20,14 @@ module.exports = { }] }, async config(obj, args, context, info) { - return _.pick(WIKI.config.theming, ['theme', 'iconset', 'darkMode', 'injectCSS', 'injectHead', 'injectBody']) + return { + theme: WIKI.config.theming.theme, + iconset: WIKI.config.theming.iconset, + darkMode: WIKI.config.theming.darkMode, + injectCSS: new CleanCSS({ format: 'beautify' }).minify(WIKI.config.theming.injectCSS).styles, + injectHead: WIKI.config.theming.injectHead, + injectBody: WIKI.config.theming.injectBody + } } }, ThemingMutation: {