Executing npm run build command to generate Tailwind CSS on several HTML pages

After executing the npm run build command, a dist folder was generated. However, upon opening it, I noticed that my other HTML files were missing. Additionally, only a basic HTML file without any CSS styling was being displayed. The connected files such as about.html and contact.html were also not present in the dist folder.

Answer №1

Begin the process by creating a new input.css file within the src directory. Next, run the command

npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch
. Don't forget to add the following line to your HTML files:
<link rel="stylesheet" href="./dist/output.css">
, which will include styling for 'about' and 'contact' pages. Then, navigate to the tailwind.config.js file and make modifications:

module.exports = {
  content: ["./*.{html,js }" ],
  theme: {
    extend: {},
  },
  plugins: [],
}

Another option is to use the configuration below:

module.exports = {
  content: ["./contact.html", "about.html"],
  theme: {
    extend: {},
  },
  plugins: [],

}

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

Getting started with Babylon.js using npm: A step-by-step guide

I recently posted about my struggles with setting up Babylon.js using npm on Stack Overflow. Since I haven't received any answers yet, I was hoping to rephrase my question: Can someone provide a detailed step-by-step guide on how to set up Babylon.js ...

New feature in Opencart 3.0.2: Adding items to cart exclusively for registered users!

Is there a way to restrict adding items to the cart only for registered users? For non-registered users, can we show an alert asking them to log in or register instead? I have tried implementing this code snippet in my controller/checkout/cart.php but it ...

Using ExpressJS to Validate Request Headers for Authentication

My current task involves implementing an API for user authentication with LDAP. The provided information specifies that the Content-Type should be set to application/json, and both the username and password need to be included in the request header. Addi ...

Designing a rounded border radius for various child elements within a layout

I am currently working on creating a circular container that houses an image and a description overlaid at 50% opacity. Here is what I have achieved so far: https://i.stack.imgur.com/pIkO1.png My goal is to apply a uniform border-radius to the entire div ...

Guide for using two Async Pipe functions in Angular 7

Two different functions are in place to check a specific condition, and the requirement is for both of them to be true simultaneously. How can *ngIf be utilized to achieve this? Currently, setting just one of them works, but the aim is to have both. HTML ...

Node.js Query: PSQL Variable Not Defined Issue

I'm facing an issue with my function that retrieves all articles from the database. Here is the structure of the articles database: id | title | price | description And this is how the images database looks like: id | articleid | name After loggin ...

When deploying to Heroku, the "open" package in Node.js may encounter issues and not function as expected

I am attempting to view a docx document in the browser, The dependencies I have are: "dependencies": { "dotenv": "^10.0.0", "express": "^4.17.1", "log-timestamp": "^0.3.0", ...

The contents of the output file for an AMD module in Webpack vary between the example provided in the Webpack documentation

Currently, I am in the process of developing my own custom build system using Webpack with the AMD module. My goal is to achieve a result similar to the example provided in the following block quote https://webpack.js.org/configuration/output/#module-defi ...

What are the functioning principles of older ajax file uploading frameworks (pre-html5)?

Traditional HTML includes an input element with a file type option. Tools are available that enable asynchronous file uploads with progress tracking. From what I gather, this is achieved by splitting the file into chunks and sending multiple requests wit ...

Avoid automatic background resizing to match the full width of the header text

I've been trying to use CSS to style my <h1> element in a specific way, but it seems the default browser behavior is getting in the way: https://i.sstatic.net/oRR5N.png Despite my efforts, the browser continues to display it like this: https: ...

Prevent Bootstrap 5 input fields from automatically adjusting to the height of a CSS grid cell

Below is some Bootstrap 5 markup that I need help with. The first example is incorrect. I don't want the Bootstrap input to be the same height as the grid cell. The second example is right, but I want to achieve the same result without using a wrapp ...

View the user's ID profile

Having trouble accessing user profiles? For example, as User 1, you want to view User 2's profile but when entering the URL (e.g. localhost/$userID), only information from your own profile (User 1) is displayed. Below is the HTML CODE for displaying ...

Shop of Chocolate in Magento

We are in the process of setting up a Magento chocolate store. Our main hurdle is figuring out how to integrate a feature that allows users to select different sizes of chocolate boxes (4 piece, 9 piece, etc.) and have the selected product added directly t ...

Display a centered div with expanded content using media queries

How can I align the expanded card div to the center when the media screen reaches a max-width of 992px/768px? Currently, when I expand the div, it is not centered. What flex property should I use and how should I apply it? The grid layout shifts and the ...

Adjusting the image in JavaScript and jQuery

Within a group of span elements, there are img tags nested inside. <span id = "span1" class="span-class"> <img src="img.jpg"/> </span> <!--Several more similar span elements --> <span id = "span123" class="span-class"> ...

Change the div element to a different div element as the window size is adjusted

Here is the HTML snippet I am dealing with: <div id="div_top"></div> <div id="div_bottom"></div> When viewing the website on a mobile device or resizing the window, I need div_bottom to appear before div_top. To achieve this, I h ...

The file_get_contents function is not compatible with PHP

I'm currently working on my new PHP website. I am trying to create an HTML page using PHP file writing code. In this process, I have used the file_get_contents function as shown below: $page_old.="<table width='1051' border='0' ...

Is it possible to utilize viewport height as a trigger for classes in Gatsby?

Unique Case Working on a Gatsby site with Tailwind CSS has brought to light an interesting challenge regarding different types of content. While the blog pages fill the entire viewport and offer scrolling options for overflowing content, other pages with ...

Top strategy for monitoring a user's advancement in reading different text segments

If you are familiar with zyBooks, I am looking to implement a similar feature where users can track the sections they have read and mark them as completed with a button. However, I am struggling conceptually with determining how best to structure my mongo ...

The datalist in HTML5 is not dropping down when the list of suggestions is extensive

I am currently using datalist to provide suggestions for a specific text input field. However, I have noticed that when the size of the datalist becomes too large (I don't have an exact number yet, but it seems to occur when there are more than 40 opt ...