tallstackui icon indicating copy to clipboard operation
tallstackui copied to clipboard

[KnowHow]: Tallstackui + Mary-UI + Daisy-UI

Open cord opened this issue 1 year ago • 2 comments

The Issue

When installing Tallstackui together with Mary-ui the tailwind stylings are overwritten by daisy-ui.

Here is how to fix this (thx to ChatGPT):

The Solution

To prevent the settings from tallstackui defined in vendor/tallstackui/tallstackui/tailwind.config.js from being overwritten by daisyui, you can adjust the configuration to merge the settings rather than completely replacing them. You can achieve this by using the lodash merge function or a similar utility. Here's how you can modify your tailwind.config.js file to achieve this:

const _ = require('lodash');
const tallstackuiConfig = require('vendor/tallstackui/tallstackui/tailwind.config.js');
const daisyui = require('daisyui');

module.exports = {
  mode: 'jit',
  purge: [...],
  theme: {
    extend: _.merge({}, tallstackuiConfig.theme.extend, {
      colors: {
        // Add your custom colors here if needed
      },
      // Add other customizations as needed
    }),
  },
  plugins: [
    daisyui,
    // Add other plugins as needed
  ],
};

cord avatar Apr 19 '24 13:04 cord

Thanks. I'll keep this issue open until I doc this.

devajmeireles avatar Apr 22 '24 03:04 devajmeireles

I successfully used the script, but with two additions/changes:

- "./vendor/tallstackui/tallstackui/tailwind.config.js" and not "vendor/tallstackui/tallstackui/tailwind.config.js" in the script

  • I put a prefix for tallstackui (in the .env file I put TALLSTACKUI_PREFIX="ts-" )

open-soft-app avatar Aug 13 '24 07:08 open-soft-app

Closing. I'll write this into v2 docs.

devajmeireles avatar Nov 20 '24 03:11 devajmeireles