Challenges with implementing TailwindCSS classes in a Next.js application

I've encountered some issues in my nextJS app with utilizing certain TailwindCSS classes such as top, left, or drop-shadow.

Even after attempting to update Tailwind from version 1.9.5 to 3.3.3, I have not seen any changes.

I believe that I am importing it correctly:

@tailwind base;
@tailwind components;
@tailwind utilities;

Here is my configuration, although the problems I am facing do not involve custom classes:

const { colors } = require(`tailwindcss/defaultTheme`)

module.exports = {
  purge: {
    enabled: false,
    content: ["./components/**/*.js", "./pages/**/*.js"],
  },
  theme: {
    extend: {
      colors: {
        primary: colors.indigo,
        brique: "#cd391a",
        slate: "rgb(71, 71, 71)",
        blueBus: "#111635",
        deepBlue: "#340978",
        // "#1400FF",
        brightYellow: "#6BAA75",
        // "#FBE200",
        darkPurple: "#ffffff",
        // "#300729",
      },
      fontFamily: {
        display: ["Rubik"],
        titleFont: ["Concert One", "sans serif"],
      },
      container: {
        center: true,
        padding: {
          default: "1rem",
          md: "2rem",
        },
      },
      gridTemplateColumns: {
        // custom grid col for cards
        cards: "repeat(3, 10rem)",
      },
      height: {
        container: "calc(100vh - 256px)",
        canvasWrapper: "75vh",
      },
    },
  },
}

I'm unsure of what else to investigate to debug this issue.

EDIT: To provide more context, I am using these classes in this manner, for example:

<h5 className="drag-indicator absolute left-1/2 top-1/2 text-center text-3xl font-bold text-purple-500 z-10 opacity-75 drop-shadow-xl">
          &larr; Click & drag to rotate &rarr;
        </h5>

In terms of folder structure, I have a styles folder containing two files: one being index.css solely with the TailwindCSS imports and the other global.scss with some styling for a component reused from a previous application. Could this potentially be causing the problem?

Answer №1

To fix the issue, consider manually adding the shadow property to your tailwind.config.js file. You can do this by inserting a code snippet like the following inside the 'extend' section: boxShadow: { dark: "8px 6px 24px 0px rgba(107,103,107,0.59)", }, By doing this, you will be able to observe how it addresses the problem you are facing.

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

Modifying the position of an HTML element within its parent tag using document.createElement

As I dive into learning Javascript, I've come across document.createElement. This method allows me to create an HTML tag and insert it into an existing HTML parent element. However, I have a specific question in mind: Is it possible to choose the exac ...

Unexpected outcome from the zero-fill operator (>>>) in Javascript's right shift operation

Initially, is (-1 >>> 0) === (2**32 - 1) possibly due to extending the number with a zero on the left, transforming it into a 33-bit number? However, why does (-1 >>> 32) === (2**32 - 1) as well? I had anticipated that after shifting the ...

What is the best way to ensure the website theme remains consistent after a refresh in React?

I am currently enhancing a weather forecast website by incorporating a theme toggler feature. The functionality has been successfully implemented, but I am facing an issue where the selected theme does not persist after reloading the page. Can someone he ...

Setting an action when clicking on a slice of a Doughnut chart using Chart.js

I have been working on integrating chart.js into my Django Project, and so far it has been going smoothly. I successfully created a doughnut chart with two slices. Now, I am trying to implement separate actions for each slice when clicked, such as redirect ...

What is the best way to invoke a method within the $http body in AngularJS

When I try to call the editopenComponentModal method in another method, I encounter the following error: angular.js:13920 TypeError: Cannot read property 'editopenComponentModal' of undefined EditCurrentJob(job) { this.$http.put(pr ...

Run a PHP script that creates a PDF file using jQuery AJAX

I am currently working with a form that looks like this: <form action="tcpdf/examples/example_0611.php" method="get"> Name: <input type="text" name="name"><br> E-mail: <input type="text" name="email"><br> <input type="subm ...

Front-end and back-end seamlessly integrated in Next.js

I am new to this area and curious about whether it's better to include an API within my project or have a separate back-end integrated. I understand that having a separate backend means paying for two hosting services, whereas incorporating it within ...

Make the inner div within the td stretch to cover the entire height of the td

Inside the first tds, there is dynamic text content that automatically expands the trs and tds. However, the second tds have a div with a background image but no text inside. I want these divs with background images to expand or collapse along with the tab ...

jQuery SlideOver - Arranging Divs in a horizontal layout

Currently, I am working on an application wizard that is designed to slide panels in order to display different sections of the resume application. You can view my site here: . The issue I am having is that when you click anywhere on the form, the panels a ...

HTML5 Slideshow with Smooth Image Transitions

So, I have created an HTML5 image slideshow and it's working perfectly on my localhost. However, I am puzzled as to why there is no transition effect within the slideshow. I was expecting something like fading out the first picture and then having the ...

How to position ul at the bottom of a fixed div

I have a fixed sidebar with two ul elements. I attempted to position the blue ul at the bottom of the fixed div, but it is not aligning as intended. <div class="sidebar"> <ul style="background:green;"> <li>test</li> <li>test ...

Implementing a Create-React-App with Rails API integration on Heroku platform

I'm encountering an issue with deploying my react/rails app on Heroku. Although I've successfully deployed it and the rails server is running, the react app itself is not displaying. It seems like I'm very close to resolving the issue but I ...

Color Your Plone Website with a Custom JavaScript Colorscheme

Currently, I have implemented a custom theme by registering the javascript in the skin.xml file and then creating a specific folder within the browser to store the script. Below is the script shared by one of the users: $(document).ready(function(){ ...

tips for accessing dynamic key pair value data in Angular

I am facing an issue where I cannot retrieve the dynamic key pair value from the dynamic JSON. Below is my JSON: var d = { "pexels-photo.jpeg": { "information": "laptop", "desc": { "mimetype": "image/jpeg", "id" ...

How can we retrieve data from the back-end MongoDB and display it on the front-end using React JS?

I am working on displaying backend data from MongoDB in the frontend and calculating the balance of a specific member. Below is the code snippet: export default function BuySellInfo() { const[xnaLogData,setXnaLogData]=useState([]); const [balance,setB ...

Mastering the art of flawlessly executing kerning-generated code

I am facing a problem while implementing logotext with kerning technique in the <header> element. I found a useful tool made by Mr. Andrew which can be accessed through this link. Before making any modifications, I had the following code in the heade ...

Utilizing an array as a child component in conditional rendering with vue.js

I have a Laravel API and the front end is built with Vue.js + Laravel. I am fetching data from the API and passing it to the view. Now, I want to implement conditional rendering based on certain criteria. Here's what my array looks like: "data" =&g ...

Encountering an issue while trying to add a search feature. The error message reads: "Failed to cast value 'search' to ObjectId (type string) at path '_id' for model 'Post'."

Hello everyone! I am quite new to web development and have been following a MERN project tutorial on YouTube. I am currently working on implementing a search functionality for posts. These posts are stored in MongoDB. However, when I try to insert a title ...

Maximizing the potential of $urlRouterProvider.otherwise in angular js

I am encountering an issue with redirecting to the login screen when there is no UABGlobalAdminId in my storage. I have tried using $urlRouterProvider.otherwise but it doesn't seem to be functioning properly. When I attempt to debug, the console does ...

Troubleshooting problems with anchor-targets in Skrollr

I am experimenting with having divs overlap each other as the page is scrolled using Skrollr. Initially, I was able to achieve the desired effect with two divs. However, when trying to incorporate a third div, only the first and last ones seem to work prop ...