From 9f85dc658f1fafa500adbf0bd8ca9f8e6c624631 Mon Sep 17 00:00:00 2001 From: Chuck Dries Date: Mon, 19 Jul 2021 12:43:53 -0700 Subject: [PATCH] fix bg styles being compiled away by tailwind --- src/pages/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index dc69e94..4bee291 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -23,12 +23,15 @@ const getDifferentRand = (range, lastNs, iterations = 0) => { return n; }; -const getButtonClasses = (isClient, colorMode = "vibrant") => - classnames( +const getButtonClasses = (isClient, colorMode = "vibrant") => { + const textColor = colorMode === 'vibrant' ? 'text-vibrant-light' : 'text-muted-light' + const bgColor = colorMode === 'vibrant' ? 'bg-vibrant-dark' : 'bg-muted-dark' + return classnames( "z-20 rounded-md text-md inline-block px-3 py-2 my-1 mr-2 text-md hover:underline", - isClient && `text-${colorMode}-light bg-${colorMode}-dark blurred-or-opaque-bg-2`, + isClient && `${textColor} ${bgColor} blurred-or-opaque-bg-2`, isClient && colorMode === "muted" ? `hover:bg-muted` : "" ); +}; const Nav = ({ ar, isClient }) => (