question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tailwindcss classes are not working in Tooltip & Dialog components

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

I set up the project as per the docs about using mui along with the tailwindcss and all classes are working as expected.

but rounded-none tailwindcss class is not working for the tooltip. (other tailwind classes are also not working for the tooltip)

image

image

image

Expected behavior 🤔

i’d love to remove the rounded border by tailwindcss class

Steps to reproduce 🕹

Steps:

  1. created the tooltip component
  2. set the classes tooltip prop by tailwindcss ones

image

Context 🔦

No response

Your environment 🌎

System: OS: macOS 12.4 Binaries: Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v16.15.1/bin/yarn npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm Browsers: Chrome: 103.0.5060.114 Edge: Not Found Firefox: Not Found Safari: 15.5 npmPackages: @emotion/react: ^11.9.3 => 11.9.3 @emotion/styled: ^11.9.3 => 11.9.3 @mui/base: 5.0.0-alpha.88 @mui/icons-material: ^5.8.4 => 5.8.4 @mui/material: ^5.8.7 => 5.8.7 @mui/private-theming: 5.8.6 @mui/styled-engine: 5.8.7 @mui/system: 5.8.7 @mui/types: 7.1.4 @mui/utils: 5.8.6 @types/react: ^18.0.10 => 18.0.10 react: ^18.1.0 => 18.1.0 react-dom: ^18.1.0 => 18.1.0 typescript: ^4.7.2 => 4.7.2

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
baymax88commented, Aug 9, 2022

@mnajdova thanks for your patience. i had some typo in this part and that was the reason.

const theme = createTheme({
  components: {
    MuiPopover: {
      defaultProps: {
        container: rootElement
      }
    },
    MuiPopper: {
      defaultProps: {
        container: rootElement
      }
    },
    MuiDialog: {
        defaultProps: {
          container: rootElement,
        },
     },
  }
});

root.render(
  <React.StrictMode>
    <StyledEngineProvider injectFirst>
      <ThemeProvider theme={theme}>
        <CssBaseline />
        <App />
      </ThemeProvider>
    </StyledEngineProvider>
  </React.StrictMode>
);

It also didn’t work for the dialog but it worked after adding this.

MuiDialog: {
    defaultProps: {
      container: rootElement,
    },
 },
1reaction
mnajdovacommented, Jul 12, 2022

In that case, can you maybe just share a link to a github repo I can clone and try locally?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tailwind CSS classes is not working in my project?
This error is due to tailwind not finding any classes to scan in what it 'thinks' is your HTML code directories.
Read more >
Z-Index - Tailwind CSS
Tailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use hover:z-50 to only apply the z-50 ...
Read more >
Tailwind CSS Modal / Dialog - Free Examples & Tutorial
Responsive modal built with Tailwind CSS. Use Modal to add dialogs to your site for lightboxes, user notifications, or completely custom content. Free...
Read more >
Tailwind Elements tutorial - Tailwind CSS components library
Tailwind Elements - Bootstrap components recreated with Tailwind CSS, but with better design and more functionalities.
Read more >
Tooltip by Tailwind and Alpine - CodePen
<div x-on:mouseover="tooltip = true" x-on:mouseleave="tooltip = false" class="rounded-md px-3 py-2 bg-indigo-500 text-white cursor-pointer shadow">.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found