gpt4 book ai didi

twitter-bootstrap - twitter bootstrap 覆盖和自定义样式

转载 作者:行者123 更新时间:2023-12-04 05:12:01 24 4
gpt4 key购买 nike

我在以下方面需要帮助:

  • Twitter bootstrap
  • 简单(可选)

  • 我正在使用 twitter bootstrap 并且我修改了 variables.less 以满足我的配色方案,并且我还使用 custom.less 作为我的布局等。我通过wearkiss 使用 simpless 来编译(或任何称为)less 到 css。

    我在最后使用包含我的 custom.less 到“bootstrap.less”@import“custom.less”,它为我生成单个 *.css 文件,直到现在我已经满意了,但现在我需要分离核心 bootstrap .css 和我的 custom.css,现在这是我面临的问题,我在 custom.less 文件中使用核心类,例如:
  • .btn
  • .btn-primary 以及 mixins 等

  • 如果没有将核心包含在我的 custom.less 中,我不能包含 (.btn) 等。为了利用核心类我有什么选择(我不想重写核心中已经存在的内容)并且仍然能够将核心 *.css 和我的 custom.css 分开?

    最佳答案

    可用于 LESS 1.5

    从 LESS 1.5 开始,您可以仅出于引用目的导入文件,这允许您访问类和 mixin,而无需文件生成自己的输出 css。您会在 custom.less 中这样做文件:

    @import (reference) "bootstrap.less";

    关于twitter-bootstrap - twitter bootstrap 覆盖和自定义样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14809546/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com