Skip to content

Commit

Permalink
be more explicit about these being related to tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
retlehs committed Dec 28, 2024
1 parent 2d317e7 commit 91f85d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions resources/js/build/wordpress.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ export function wordpressRollupPlugin() {

export function wordpressThemeJson({
tailwindConfig,
disableColors = false,
disableFonts = false,
disableFontSizes = false,
disableTailwindColors = false,
disableTailwindFonts = false,
disableTailwindFontSizes = false,
}) {
const resolvedConfig = resolveConfig(tailwindConfig)

Expand All @@ -151,13 +151,13 @@ export function wordpressThemeJson({
...baseThemeJson,
settings: {
...baseThemeJson.settings,
...((!disableColors && resolvedConfig.theme?.colors && {
...((!disableTailwindColors && resolvedConfig.theme?.colors && {
color: {
...baseThemeJson.settings?.color,
palette: flattenColors(resolvedConfig.theme.colors),
},
}) || {}),
...((!disableFonts && resolvedConfig.theme?.fontFamily && {
...((!disableTailwindFonts && resolvedConfig.theme?.fontFamily && {
typography: {
...baseThemeJson.settings?.typography,
fontFamilies: Object.entries(resolvedConfig.theme.fontFamily)
Expand All @@ -168,7 +168,7 @@ export function wordpressThemeJson({
})),
},
}) || {}),
...((!disableFontSizes && resolvedConfig.theme?.fontSize && {
...((!disableTailwindFontSizes && resolvedConfig.theme?.fontSize && {
typography: {
...baseThemeJson.settings?.typography,
fontSizes: Object.entries(resolvedConfig.theme.fontSize)
Expand Down
6 changes: 3 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export default defineConfig({
// based on the Tailwind config and the theme.json file from base theme folder
wordpressThemeJson({
tailwindConfig,
disableColors: false,
disableFonts: false,
disableFontSizes: false,
disableTailwindColors: false,
disableTailwindFonts: false,
disableTailwindFontSizes: false,
}),
],
})

0 comments on commit 91f85d5

Please sign in to comment.