Skip to content

Commit

Permalink
ensure tailwind config evaluates properly + update textarea -> input
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Nov 3, 2024
1 parent 2bdfdb9 commit c87c6cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 27 deletions.
17 changes: 1 addition & 16 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ const RenderField: FC<RenderFieldProps> = ({
type={field.type}
label={label}
name={field.name}
isTextArea={true}
/>
)}
</>
Expand Down
17 changes: 7 additions & 10 deletions web/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ var merge = require("lodash/merge");
// Use relative paths for imports
const baseThemes = require("./tailwind-themes/tailwind.config.js");

let customThemes = null;
try {
if (process.env.NEXT_PUBLIC_THEME) {
customThemes = require(
`./tailwind-themes/custom/${process.env.NEXT_PUBLIC_THEME}/tailwind.config.js`
);
}
} catch (error) {
console.warn(`Custom theme not found for: ${process.env.NEXT_PUBLIC_THEME}`);
}
const customThemes = process.env.NEXT_PUBLIC_THEME
? require(
process.env.NEXT_PUBLIC_THEME
? `./tailwind-themes/custom/${process.env.NEXT_PUBLIC_THEME}/tailwind.config.js`
: "./tailwind-themes/custom/default/tailwind.config.js"
)
: null;

/** @type {import('tailwindcss').Config} */
module.exports = customThemes ? merge(baseThemes, customThemes) : baseThemes;

0 comments on commit c87c6cf

Please sign in to comment.