首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >我应该导入哪些文件,才能使Bootstrap自定义范围拇指正常工作?

我应该导入哪些文件,才能使Bootstrap自定义范围拇指正常工作?
EN

Stack Overflow用户
提问于 2019-01-23 22:38:05
回答 1查看 1.8K关注 0票数 2

我正在尝试使用Bootstrap的自定义表单范围,尽管它的拇指不工作,即使我导入scss/_bootstrap.scss清单文件。只有在导入了dist/bootstrap.css或者我正在使用CDN时,它才起作用。

这是我用于导入Bootstrap文件的清单文件:

代码语言:javascript
复制
// Required abstracts
@import "../../../node_modules/bootstrap/scss/functions";
@import "../../../node_modules/bootstrap/scss/variables";
@import "../../../node_modules/bootstrap/scss/mixins";

/*----------------------------- OPTIONAL -----------------------------*/

// abstract
@import "../../../node_modules/bootstrap/scss/utilities/display";
@import "../../../node_modules/bootstrap/scss/utilities/flex";

// base
@import "../../../node_modules/bootstrap/scss/reboot";
@import "../../../node_modules/bootstrap/scss/type";
@import "../../../node_modules/bootstrap/scss/code";

// layout
@import "../../../node_modules/bootstrap/scss/grid";

//components
@import "../../../node_modules/bootstrap/scss/card";
@import "../../../node_modules/bootstrap/scss/forms";
@import "../../../node_modules/bootstrap/scss/custom-forms";

这是我的HTML代码:

代码语言:javascript
复制
<input id='quantity' 
       class='custom-range' 
       type='range' 
       min='12' 
       max='18' 
       step='2'
       value='12'>

导入这些文件后,range thumb将不会按预期设置样式(它会保持浏览器的默认样式)。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-02-27 23:13:24

如果您正在使用WebCompiler extension for Visual Studio并正在编译Bootstrap Sass文件,则需要在compilerconfig.json中添加对Autoprefixer的支持:

代码语言:javascript
复制
{
  "outputFile": "wwwroot/css/site.css",
  "inputFile": "wwwroot/css/site.scss",
  "options": {
    "autoPrefix": "last 2 versions"
  }
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54329658

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档