我正在使用sass版的Bootstrap,并希望自定义按钮字体,使其与系统字体不同。
我没有看到任何可以修改按钮字体系列的sass/less变量:http://getbootstrap.com/customize/#buttons 那么,我该如何实现呢?
我没有看到任何可以修改按钮字体系列的sass/less变量:http://getbootstrap.com/customize/#buttons 那么,我该如何实现呢?
您可以通过以下方式覆盖btn
类中的样式:
.btn {
font-family: SomeFont;
}
$input-btn-font-family
和 $btn-font-family
可用。
Bootstrap 4.5:
./node_modules/bootstrap/scss/_variables.scss
$input-btn-font-family: null !default;
$btn-font-family: $input-btn-font-family !default;
./node_modules/bootstrap/scss/_buttons.scss
.btn {
> font-family: $btn-font-family;
.yourownclass{
font-family: "Arial Bold", Gadget, sans-serif;
font-style: normal;
font-size: 15px ! important; //to make fontsize bigger
}
<input type="submit" value="Submit" class="btn btn-primary yourownclass"/>