Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to add Prefix for Wind presets #110

Closed
antonbehaeghe opened this issue Feb 5, 2024 · 1 comment
Closed

Add ability to add Prefix for Wind presets #110

antonbehaeghe opened this issue Feb 5, 2024 · 1 comment

Comments

@antonbehaeghe
Copy link

Would it be possible to add the ability to the Wind preset docs pages to add a prefix?

We use the tailwind prefix option, and it's quite tedious now to copypaste the preset, and then manually add the prefix. It would be nice if this could be added automatically.

@mertsincan
Copy link
Member

Hi,

For now, we don't think it. But, I made some changes in mergeProps option of ptOptions. I think you can use output class string and then add prefix to each class part. primefaces/primevue#4707 (comment)

const addPrefix = (classes) => {
     return classes?.spit(' ').map((c) => ....).join(' '); // you can update this block according to your needs.
}

const customMergeProps = (globalPTProps = {}, selfPTProps = {}, datasets) => {
   /*
    * - mergeProps from Vue package
    */
   const mergedProps = Vue.mergeProps(globalPTProps, selfPTProps, datasets);
   const newClassesWithPrefix = addPrefix(mergedProps?.class);

    mergedProps.class = newClassesWithPrefix;

    return mergedProps;
}

Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants