sass - 将 @include 与 scss 一起使用时出错
问题描述
如何让媒体查询在引导程序中工作?我有一个 SCSS 文件,我想我需要导入一些东西,但我不知道是什么。
错误信息:
Scss compiler error: Error: no mixin named media-breakpoint-up
小路:homepage.scss
@include media-breakpoint-up(sm) {
h1.home-page {
font-size: 3rem;
}
}
解决方案
你可以@import整个“引导”scss,然后定义自定义@include ...
@import "bootstrap";
@include media-breakpoint-up(sm) {
h1.home-page {
font-size: 3rem;
}
}
或者,您可以导入函数、变量和 mixin(因为这仅包括 mixin 所需的内容)...
@import "bootstrap/functions";
@import "bootstrap/variables";
@import "bootstrap/mixins";
/* change col style on sm only */
@include media-breakpoint-up(sm) {
h1.home-page {
font-size: 3rem;
}
}
@import "bootstrap";
这完全取决于您拥有的其他自定义项。
https://codeply.com/go/3zTbKtczVd
推荐阅读
- vue.js - 使用 Django Rest Framework、JWT 和 Vuejs 获取经过身份验证的用户信息
- rust - 调用返回具有共享特征的不同类型并传递给其他函数的函数
- javascript - React - 如何在另一个 React-Select 更改时清除 React-Select 的值
- android - 版本控制室数据库
- ruby-on-rails - 无法在 Docker 容器中将 rake(12.3.1、12.3.0)更新到版本 12.3.2
- java - ALR-H450 条码阅读器
- amazon-athena - 雅典娜性能测试
- r - 重新排列多列数据框
- python-3.x - 使用pygame进行多线程处理,程序崩溃
- ios - Firebase 动态链接如何在应用安装中幸存下来的理论是什么?