SASS warning: Units 'px' and 'px*px' are not compatible

I've been working with SCSS to customize the style of Bootstrap 4 for my project, but I encountered an error while compiling my SCSS code:

{
  "status": 1,
  "file": "H:/!WEBSITE/modules/The Force - Bootstrap/content/scss/variables/variables.scss",
  "line": 330,
  "column": 34,
  "message": "Incompatible units: 'px' and 'px*px'.",
  "formatted": 
     "Error: Incompatible units: 'px' and 'px*px'. 
        on line 330 of scss/variables/variables.scss
        >> $input-height: (($font-size-base * $input-line-height) + ($input-padding-y * 2)) !default;"
}


Details of my variables:

$font-size-base:          14px !default;
$line-height-base:        1.846 !default;
$input-line-height:       floor(($font-size-base * $line-height-base)) !default;
$input-padding-y:         6px !default;


The problematic line causing the error:

$input-height: (($font-size-base * $input-line-height) + ($input-padding-y * 2)) !default;


I'm struggling to understand why this issue is occurring and how to resolve it. I use node-sass for compiling SCSS, and although I haven't faced such errors before, I can't seem to pinpoint the exact cause in this scenario.

Answer №1

The issue at hand is the multiplication of px with px, resulting in px2

To correct this, simply remove px from the variable $font-size-base

$font-size-base:          14 !default;
$line-height-base:        1.846 !default;
$input-line-height:       floor(($font-size-base * $line-height-base)) !default;
<input-padding-y:         6px !default;
$input-height: (($font-size-base * $input-line-height) + ($input-padding-y * 2)) !default;

For further information on Sass units, check out this resource here

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

Utilizing Bootstrap results in the font size being dynamically adjusted

Initially, I created a CSS file for my website. However, in the middle of development, I decided to incorporate Bootstrap by including the Bootstrap CDN in the HTML file. Unfortunately, this change ended up reducing the font size of the entire project. BE ...

Middleware designed for logging in React, akin to Multer in the realm of Express JS

Currently developing a React application that involves multiple API calls. I am exploring the possibility of integrating a middleware to intercept and log all these calls, similar to how Multer functions in an Express server. I am also curious if there is ...

Failure [ERR_STREAM_WRITE_AFTER_END]: writing past the endpoint [npm-request using socket.io]

My server has a socket server running, and on my laptop, I have a socket.io-client service. When both are turned on, they establish a connection. When other users request information from my server, the server sends that request to my laptop via a socket. ...

Setting up a Webpack configuration for a React project

For my React application, I decided to use npm eject in order to access the Webpack configuration. My goal is to modify the paths for assets so that they do not include a leading slash. This adjustment is necessary because when I deploy my application on a ...

Implementing Two-Way Authentication for Cloud Foundry Applications using NodeJS and Express

I have successfully deployed my NodeJs+express application on IBM Cloud as a Cloud Foundry application. Now, I am looking to implement mutual authentication (client and server certificates) to manage incoming traffic and requests to my application. The cer ...

Tips for utilizing the semantic-ui rail component

Currently, I am attempting to design a vertical left menu utilizing semantic-ui, resembling an admin menu. In order to align it to the left side of the page, I have utilized the rail element provided by semantic-ui. However, I am facing an issue where my c ...

Techniques and Strategies for showcasing several images in close proximity

I am looking to arrange dummy images in a row next to each other, similar to the example shown here: https://i.sstatic.net/HUUGz.png Since my CSS skills are not very strong, I am seeking guidance on the proper way to achieve this. The images I have are a ...

Can an advertisement's appearance be altered to include custom content using only CSS?

Dealing with SAP for our ticket system has been quite a challenge due to the design that is causing some frustration. In an attempt to make it more tolerable, I used CSS to make some adjustments. However, my problem now lies in the fact that they keep maki ...

Issue: unable to spawn process due to missing file or command (Snapchat NPM) in NodeJS environment

Every time I start my app, I encounter the following error: events.js:72 throw er; // Unhandled 'error' event ^ Error: spawn ENOENT at errnoException (child_process.js:980:11) at Process.ChildProcess._handle.onexit ...

Getting the Request Body Content in Express Middleware

Currently, I am in the process of developing a small API logger to use as an Express middleware. This logger is designed to gather data from both the request and response objects, then store this information in a JSON file on disk for later reference. Her ...

Bootstrap dropdown feature automatically rearranges all items in my navigation bar

I recently set up a navbar for my website, but I'm struggling to grasp the concept of positioning items with Bootstrap. One issue I encountered is that when I click on the dropdown button (profile image), it causes all the items in my navbar to shift, ...

Error Encountered: Unable to Locate Node Modules on Ubuntu Version 20.04.5

I am a Windows 10 user who utilizes WSL. Initially, I was working with Ubuntu 20.04.5 from the Microsoft Store and running node commands smoothly. However, my attempt to upgrade to Ubuntu Jammy (22.x) resulted in errors when trying to use nodejs after inst ...

Arranging shapes for varying levels of magnification

Seeking assistance with properly aligning two forms. I have tried using a positioning approach, but the layout gets disrupted when the browser's Zoom level is adjusted. The second button ends up shifting slightly either upwards or downwards. Here is t ...

Organize image uploads into distinct directories using Nodejs multer

I have a software for selling cars, and I need to organize the car images into specific folders within a path structure of country/city. For instance: Let's say there's a car located in Berlin, Germany. When adding this car, the images should b ...

"Bootstrap 4 does not allow labels to be displayed inline with the input field

I'm currently working with Bootstrap 4 and Vue.js to populate an input form, but I'm struggling to get the label to appear inline and before the input type file. <div v-for="problem in problems"> <div class="row"& ...

Applying Flexbox to Bootstrap 4 enables the creation of responsive columns, yet some content within the columns

I am trying to achieve a specific layout with my code: Initial: https://i.sstatic.net/cbKvs.png After resizing: https://i.sstatic.net/dWzy1.png https://i.sstatic.net/WzPzt.png The goal is to prevent Group 1 and Group 2 from wrapping. However, the out ...

The implementation of display flex is causing issues with the material-ui grid layout

Struggling to implement the grid system from material-ui due to an issue where grid items do not resize when resizing the browser window. The culprit seems to be a parent div with the style property "display": "flex". The dilemma arises from using a mater ...

Update Table Row Background Color in Separate Table by Clicking Button Using JQuery

Two tables are involved in this scenario - one that receives dynamically added rows, and another that stores the data to be included. The illustration above displays these tables. Upon clicking the Edit button, the information from the selected row in Tab ...

Encountering a CORS header issue when using socket.io and nodejs on an apache2 server

I am currently learning how to implement socket.io within Laravel, but I am encountering an error that says Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:3001/socket.io/?EIO=3&transport=p ...

Having trouble with starting the Docker container containing react and express apps after running one process?

After successfully Dockerizing a project using React.js and Express.js separately, I decided to combine them into one docker-compose file. I created a new file named docker-compose-all-dev.yml: version: '3.7' services: client: container_n ...