7

I tried to use @include media-breakpoint-up in Angular but when compile get this error

Bootstrap 5.1.13

Angular CLI: 10.2.4

Node: 14.17.2

OS: win32 x64

Angular: 10.2.5

ERROR in Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined mixin.
  ╷
6 │ ┌         @include media-breakpoint-down(md) {
7 │ │             width: 100%;
8 │ │             margin: 0 10px 0 10px;
9 │ └         }

style class

.mat-form-field{
        width: 460px;

        @include media-breakpoint-down(md) {
            width: 100%;
            margin: 0 10px 0 10px;
        }
    } 

import in main.scss @import '~bootstrap/scss/bootstrap-utilities';

bootrap class in html working normally

where is wrong? Thanks

I tried to import every single bootsrap class (in correct order), i tried to restart Angular ng serve but never working

apnnux
  • 361
  • 4
  • 11

2 Answers2

9
@import 'node_modules/bootstrap/scss/functions';
@import 'node_modules/bootstrap/scss/variables';
@import 'node_modules/bootstrap/scss/mixins';

these imports are needed for it to work

ibrahimgb
  • 693
  • 5
  • 13
2

As suggested by cloned you have to import the bootstrap file on each SCSS component.

apnnux
  • 361
  • 4
  • 11