0

所以我开始使用 bootstrap 3.0 并意识到有很多变化。我想app.less为我的站点特定的自定义添加一个。我知道它应该被添加到bootstrap.less,但我想要一些关于在哪里添加它的建议!我是否必须进行任何其他更改以例如package.jsongruntfile.js能够使用“标准” grunt 命令,例如 grunt 和 grunt watch?

未触动的 Bootstrap.less

/*!
 * Bootstrap v3.0.0
 *
 * Copyright 2013 Twitter, Inc
 * Licensed under the Apache License v2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Designed and built with all the love in the world by @mdo and @fat.
 */

// Core variables and mixins
@import "variables.less";
@import "mixins.less";

// Reset
@import "normalize.less";
@import "print.less";

// Core CSS
@import "scaffolding.less";
@import "type.less";
@import "code.less";
@import "grid.less";

@import "tables.less";
@import "forms.less";
@import "buttons.less";

// Components: common
@import "component-animations.less";
@import "input-groups.less";
@import "dropdowns.less";
@import "list-group.less";
@import "panels.less";
@import "wells.less";
@import "close.less";

// Components: Nav
@import "navs.less";
@import "navbar.less";
@import "button-groups.less";
@import "breadcrumbs.less";
@import "pagination.less";
@import "pager.less";

// Components: Popovers
@import "modals.less";
@import "tooltip.less";
@import "popovers.less";

// Components: Misc
@import "alerts.less";
@import "thumbnails.less";
@import "media.less";
@import "labels.less";
@import "badges.less";
@import "progress-bars.less";
@import "accordion.less";
@import "carousel.less";
@import "jumbotron.less";

// Utility classes
@import "utilities.less"; // Has to be last to override when necessary
@import "responsive-utilities.less";
4

1 回答 1

0

为什么不制作一个额外的 LESS 文件来调用您的自定义文件和 Bootstrap 文件。

所以在mystyles.less你里面会有

@import "bootstrap.less";
@import "app.less";

然后,当有较新版本的 Bootstrap 时,您只需替换文件,保持文件不变。

于 2013-08-05T14:33:45.737 回答