Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deprecation Warning in Bootstrap SCSS

I am trying to create custom bootstrap by importing only the required components into a style.scss file from bootstrap sass. However, I get a chain of many Deprecation Warnings when I import and compile the 3 required components.

SCSS:

@import "./bootstrap-4.3.1/scss/functions";
@import "./bootstrap-4.3.1/scss/variables";
@import "./bootstrap-4.3.1/scss/mixins";

Console Warning (first of the many):

Deprecation Warning: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($spacer, 2)

More info and automated migrator: https://sass-lang.com/d/slash-div

    ╷
298 │ $headings-margin-bottom:      $spacer / 2 !default;
    │                               ^^^^^^^^^^^
    ╵
    bootstrap-4.3.1\scss\_variables.scss 298:31  @import
    style.scss 3:9                               root stylesheet

I am using the following versions of tools:

Bootstrap: 4.3.1, Sass: 1.33.0 compiled with dart2js 2.13.0

Is anything wrong with using this version combination, or any other issue? How can I resolve it?

like image 228
deekeh Avatar asked May 24 '21 16:05

deekeh


People also ask

Can I use SCSS with Bootstrap?

scss , you'll import Bootstrap's source Sass files. You have two options: include all of Bootstrap, or pick the parts you need. We encourage the latter, though be aware there are some requirements and dependencies across our components. You also will need to include some JavaScript for our plugins.

What is deprecation warning?

Deprecation warnings are a common thing in our industry. They are warnings that notify us that a specific feature (e.g. a method) will be removed soon (usually in the next minor or major version) and should be replaced with something else.

What is Bootstrap SCSS?

The Bootstrap scss folder contains a set of . scss files and also 2 directories, mixins and utilities, with more Sass code. Copy the contents of this folder to a new bootstrap folder and place it within an scss directory underneath the root of your project.


1 Answers

I found a solution here.

Essentially, what I understand is that a new version of SASS is throwing warnings. You can downgrade your version to stop the warnings for now and doing so shouldn't break anything either.

tl:dr You should use Sass: "1.32.13" instead.

like image 189
Narb Avatar answered Oct 16 '22 12:10

Narb