10

I am trying to customize card columns by using Bootstrap 4 card layout. But why it is showing error if i am writing this code in my css file?

Error showing is in VS code: unknown at rule @include css(unknownatrules)

HTML file

<div class="card-columns">
  <div class="card" *ngFor="let item of vision">
    <div class="card-header">{{item.heading}}</div>
    <carousel [showIndicators]="false">
      <slide *ngFor="let item of vision">
        <img class="card-img-top embed-responsive embed-responsive-16by9" [src]="item.img" alt="vision image">
      </slide>
    </carousel>
  </div>
</div>

CSS file

.card-columns {
  @include media-breakpoint-only(md) {
    column-count: 3;
  }
  @include media-breakpoint-only(lg) {
    column-count: 4;
  }
}
Sumit Trivedi
  • 113
  • 1
  • 1
  • 9

4 Answers4

14

@include is a SASS feature not CSS feature. Alternatively, you can turn the warning off by

  "css.lint.unknownAtRules": "ignore"

Reference : https://github.com/microsoft/vscode/issues/53175

https://github.com/stylelint/stylelint/issues/3190

Avinash Dalvi
  • 8,551
  • 7
  • 27
  • 53
6

If you use scss, than "scss.lint.unknownAtRules": "ignore".

Vyacheslav
  • 61
  • 1
  • 2
4

The solution to this is almost always to install a plugin for your editor/IDE for PostCSS language support instead of regular CSS.

VS Code has a PostCSS Language Support plugin you can use that works great with morden CSS.

D.M.
  • 39
  • 2
1

From this github issue, you need to add stylelint-scss to your devDependencies and in your .stylelintrc should have the following to turn off the warning.

{
  ...
  plugins: ["stylelint-scss"],
  "rules": {
    ...
    "at-rule-no-unknown": null,
    "scss/at-rule-no-unknown": true,
    ...
  }
}
Morlo Mbakop
  • 3,518
  • 20
  • 21