Giannis Savvidis
Giannis Savvidis

Reputation: 772

import bootstrap variables in my style.sass issue

I am trying to import bootstrap 4 beta variables partial in my style.sass but when i compile i get the following error:

events.js:160 throw er; // Unhandled 'error' event ^ Error: node_modules\bootstrap\scss_variables.scss Error: argument $color of darken($color, $amount) must be a color

   Backtrace:
    node_modules/bootstrap/scss/_variables.scss:168, in function `darken`
    node_modules/bootstrap/scss/_variables.scss:168
    on line 168 of node_modules/bootstrap/scss/_variables.scss

$link-hover-color: darken($link-color, 15%) !default; ------------------------^

at options.error (C:\Users\Giannis\Desktop\np-lab\node_modules\node-sass\lib\index.js:291:26)

here is my code:

@import "../../../node_modules/bootstrap/scss/variables"

body
  background-color: red

Any ideas what is going on? thanks

Upvotes: 11

Views: 6923

Answers (1)

Fathima Linsa K
Fathima Linsa K

Reputation: 648

Before importing variables file, you have to import functions.scss. Darken function is defined in it.

@import "../../../node_modules/bootstrap/scss/functions";
@import "../../../node_modules/bootstrap/scss/variables";
<!--your styles here-->

Upvotes: 26

Related Questions