Nesting functionality in TailwindCSS is currently experiencing issues when used in conjunction with tailwindcss/nesting or postcss

PostCSS Configuration

module.exports = {
  plugins: {
    "postcss-import": {},
    "tailwindcss/nesting": {},
    tailwindcss: {},
    autoprefixer: {},
  },
};

Global CSS Styles

.form-control {
  @apply w-full px-3;
  & p {
    @apply mb-1;
  }
  & input:not([type="checkbox"]),
  & select,
  & option,
  & textarea {
    @apply placeholder-gray-500 dark:placeholder-gray-text  focus:outline-none focus:border-2 focus:border-brand-100 bg-bg-light-100 dark:bg-bg-dark-100 p-1 px-3 h-9 shadow-md;
  }
  & textarea {
    @apply h-24;
  }
  &.error {
    & input {
      &:not([type="checkbox"]) {
        @apply border-red-600 outline-none border-2;
      }
    }
  }
}

The postcss-import plugin is functioning properly, but I'm experiencing issues with the nesting plugins not rendering my styles. Just a note, I am currently using Next.js.

Answer №1

How would you like the css output to look? For example, if you desire:

.form-control p{
   //styles
}

then it should be written as

.form-control {
   p {
    @apply mb-1;
  }
}

but without using the &.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Looking for a jQuery plugin that helps with form alignment?

In a blog post comment, I came across an interesting jQuery form alignment plugin: jQuery.fn.autoWidth = function(options) { var settings = { limitWidth : false } if(options) { jQuery.extend(settings, options); }; ...

Having trouble sharing images through the API on the newest version of LinkedIn API

For some reason, I am encountering an issue where I can only post a Text only Post and the Image Post feature is not working. Surprisingly, I'm not receiving any error messages either. I have been diligently following the guidelines provided in the o ...

When attempting to send an archiver file in NodeJS, the request may become unresponsive

In my NextJS application, I am facing the challenge of generating a large number of QR codes at once, like 300, 400, or even 500, and then packaging them into a zip file for users to download. The following code snippet demonstrates how I achieve this usin ...

Utilize SWR to retrieve data that corresponds to the chosen value from the dropdown menu

Can SWR fetch data based on the selected value in a dropdown? Initially, it works, but when I select a previously selected value, it doesn't fetch the correct data. Using the Fetch API const { data: entities } = useSWR( currentEntity?.enti ...

The Dropdown Button Functions Once and Then Stops

I am facing a challenge in implementing a button within an HTML table that triggers a dropdown menu when clicked, and closes upon another click or when the user clicks outside the menu. Oddly, the button only seems to work once before completely losing fun ...

Issues with connecting local CSS and JS files to HTML pages

I am facing an issue with my base HTML file that I want all other pages to inherit certain characteristics from. The problem arises when I try to link an external CSS file like bootstrap.css from within my project directory. I have the file stored in the s ...

How to Align Video Alongside Image in HTML without Using CSS

Is there a way to place a video on the left and an image on the right of the same line in HTML without relying on CSS? ...

The coexistence of conflicting extensions, such as Metamask and Trust Wallet, both attempting to interact

I am working on developing a personal service that I want to integrate with browser extensions like Metamask and Trust Wallet, with the potential to include others in the future. However, I am facing challenges in finding resources on how to access the nec ...

Why is my CSS not showing up in Live Server when I preview it from Visual Studio?

Every time I use the "Go Live" option with Live Server (Visual Studio extension), I only get a preview of my plain HTML file. However, when I manually open the HTML file from the folder containing both HTML and CSS files, the page loads correctly with the ...

"Is it possible to rearrange the parent div's position when hovering over a child image with jquery sortable

Can you assist me with a task? I have two text boxes with an equal sign image, and I want the user to be able to move the div only when hovering over the equal sign. This means that the user should be able to drag the div using the equal sign. Can you hel ...

Adjust the button's color even after it has been clicked

My goal is to update the button's color when it's clicked. I found some examples that helped me achieve this, but there's an issue - once I click anywhere outside of the button, the CSS class is removed. These buttons are part of a form, and ...

Changing a const variable to true based on a condition in React

Is there a way in react to reassign a constant variable to true based on a condition being met? I keep encountering an error saying 'displayInternalForm' is declared but its value is never read. export async function getStaticProps({ params }) { ...

Arrange multiple elements in a column using the flexbox `justify-content` property

I have a div containing h1 and h2 tags. My objective is to center them both horizontally and vertically using flexbox. However, my current code aligns them diagonally like this: -------------- | | | h1h2 | | | --------- ...

What is the best way to design an element that exceeds the size of my physical body

I am currently working on creating a table that needs to be larger than the body and centered. Let me provide some more information. Below is my simplified HTML code : <body> <div id="one"> <div> <tab ...

Question about transparency - HTML, CSS, and Bootstrap

I adjusted the opacity of the bootstrap card to 0.8, but now I want the table to be opaque while the rest of the card remains translucent. How can I achieve this effect? I attempted to add the style opacity : 1 to the table, but it didn't have the des ...

Is there a way to showcase a Matplotlib graph using FastAPI/Nextjs without needing to save the chart on the local machine

For my website, I am utilizing a Nextjs frontend along with a FastAPI backend. On the frontend, there is an input form for capturing an 'ethereum address'. Using this address, a matplotlib chart displaying 'ethereum balance over time' i ...

Unable to assign user roles in next-auth due to the absence of matching modifiers for user

I am currently working on implementing user roles in next-auth. Within my database, I have defined a prisma enum UserRole with the values 'ADMIN' and 'USER'. In my auth.ts file, I included the role property in the session object and enc ...

Security Error when using the JavaScript map function in FireFox

My current dilemma involves using a JavaScript code to extract the above-the-fold CSS from my websites. Surprisingly, it functions flawlessly on Google Chrome. However, when I attempt to execute it on Firefox, an infamous 'SecurityError' occurs: ...

Getting rid of unnecessary compiled CSS files in Compass

After making changes to files and running compass compile, the compiled files remain even if they are renamed or deleted. Similarly, compass clean does not remove these old files as it only focuses on cleaning up current files in use. I want to avoid compl ...

Preserve the original position of the inner <div> when animating the container <div> using JQuery

I am currently working on a small website and encountering some challenges with jQuery animation. My issue involves placing a single character text inside a circle and wanting it to grow when the user hovers over it, while keeping the inner text in its ori ...