【问题标题】:How to compile bootstrap scss to css如何将引导程序 scss 编译为 css
【发布时间】:2018-06-02 11:01:00
【问题描述】:

我已经下载了bootstrap 源代码,但不想使用bootstrap.css (170kb) 和bootstrap.min.css (138kb) 中的所有css

我只使用 button.js (5.09kb) 并且只想要按钮相关的 css。

我自己可以手动获取所有与按钮相关的 css,但是在 bootstrap.css 中遍历 9000 行非常耗时。

一些手动css的例子:

.btn{color:#00bc8c; border-color:#00bc8c}
.btn:hover,.btn.active{color:#fff; background-color:#00bc8c}
.btn{padding:0.5rem 1rem;font-size:1.171875rem;}
.btn-group{display:inline-flex;}
.btn-group .btn{margin-left:-1px}
.btn-group>.btn:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}
.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}
.btn input[type="radio"]{position:absolute;clip:rect(0,0,0,0);}

存档中有一个 scss 文件夹,其中包含所有单独的样式表

例如在_button-group.scss:

.btn-group {
  > .btn:first-child {
    margin-left: 0;
  }
  // Reset rounded corners
  > .btn:not(:last-child):not(.dropdown-toggle),
  > .btn-group:not(:last-child) > .btn {
    @include border-right-radius(0);
  }
  > .btn:not(:first-child),
  > .btn-group:not(:first-child) > .btn {
    @include border-left-radius(0);
  }
}

它有我想要的所有按钮相关的东西。

所以我尝试使用http://beautifytools.com/scss-compiler.php,但出现此错误:

Error: no mixin named hover
       Backtrace:
        stdin:16
        on line 16 of stdin
>>     @include hover {
   -------------^

该网站确实声明“如果您的 scss 代码有这些,请在 @import 语句中输入完整的 url。”

所以我需要参考更多的全局 scss 信息。我假设开发所有这些引导程序的人都有一个很好的程序来很好地开发所有这些 scss 并单独组织。如果有人知道我如何编译按钮 scss,请告诉我。我自己“引用”它们的唯一想法是将所有其他 scss 添加到同一个源文件中,但这只会编译所有源文件。请帮忙。

【问题讨论】:

    标签: html css sass


    【解决方案1】:

    bootstrap.scss 中删除您不想要的导入。 (除了那些你仍然需要的)

    @import "functions";
    @import "variables";
    @import "mixins";
    @import "buttons";
    @import "button-group";
    

    现在bootstrap.css 只是 500 行按钮样式!

    .btn {
      display: inline-block;
      font-weight: 400;
      text-align: center;
      white-space: nowrap;
      vertical-align: middle;
      user-select: none;
      border: 1px solid transparent;
      padding: 0.375rem 0.75rem;
      font-size: 1rem;
      line-height: 1.5;
      border-radius: 0.25rem;
      transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; }
      @media screen and (prefers-reduced-motion: reduce) {
        .btn {
          transition: none; } }
      .btn:hover, .btn:focus {
        text-decoration: none; }
      .btn:focus, .btn.focus {
        outline: 0;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); }
      .btn.disabled, .btn:disabled {
        opacity: 0.65; }
      .btn:not(:disabled):not(.disabled) {
        cursor: pointer; }
      .btn:not(:disabled):not(.disabled):active, .btn:not(:disabled):not(.disabled).active {
        background-image: none; }
    
    a.btn.disabled,
    fieldset:disabled a.btn {
      pointer-events: none; }
    
    .btn-primary {
      color: #fff;
      background-color: #007bff;
      border-color: #007bff; }
      .btn-primary:hover {
        color: #fff;
        background-color: #0069d9;
        border-color: #0062cc; }
      .btn-primary:focus, .btn-primary.focus {
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); }
      .btn-primary.disabled, .btn-primary:disabled {
        color: #fff;
        background-color: #007bff;
        border-color: #007bff; }
      .btn-primary:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active, .show > .btn-primary.dropdown-toggle {
        color: #fff;
        background-color: #0062cc;
        border-color: #005cbf; }
        .btn-primary:not(:disabled):not(.disabled):active:focus, .btn-primary:not(:disabled):not(.disabled).active:focus, .show > .btn-primary.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); }
    
    .btn-secondary {
      color: #fff;
      background-color: #6c757d;
      border-color: #6c757d; }
      .btn-secondary:hover {
        color: #fff;
        background-color: #5a6268;
        border-color: #545b62; }
      .btn-secondary:focus, .btn-secondary.focus {
        box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); }
      .btn-secondary.disabled, .btn-secondary:disabled {
        color: #fff;
        background-color: #6c757d;
        border-color: #6c757d; }
      .btn-secondary:not(:disabled):not(.disabled):active, .btn-secondary:not(:disabled):not(.disabled).active, .show > .btn-secondary.dropdown-toggle {
        color: #fff;
        background-color: #545b62;
        border-color: #4e555b; }
        .btn-secondary:not(:disabled):not(.disabled):active:focus, .btn-secondary:not(:disabled):not(.disabled).active:focus, .show > .btn-secondary.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); }
    
    .btn-success {
      color: #fff;
      background-color: #28a745;
      border-color: #28a745; }
      .btn-success:hover {
        color: #fff;
        background-color: #218838;
        border-color: #1e7e34; }
      .btn-success:focus, .btn-success.focus {
        box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); }
      .btn-success.disabled, .btn-success:disabled {
        color: #fff;
        background-color: #28a745;
        border-color: #28a745; }
      .btn-success:not(:disabled):not(.disabled):active, .btn-success:not(:disabled):not(.disabled).active, .show > .btn-success.dropdown-toggle {
        color: #fff;
        background-color: #1e7e34;
        border-color: #1c7430; }
        .btn-success:not(:disabled):not(.disabled):active:focus, .btn-success:not(:disabled):not(.disabled).active:focus, .show > .btn-success.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); }
    
    .btn-info {
      color: #fff;
      background-color: #17a2b8;
      border-color: #17a2b8; }
      .btn-info:hover {
        color: #fff;
        background-color: #138496;
        border-color: #117a8b; }
      .btn-info:focus, .btn-info.focus {
        box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); }
      .btn-info.disabled, .btn-info:disabled {
        color: #fff;
        background-color: #17a2b8;
        border-color: #17a2b8; }
      .btn-info:not(:disabled):not(.disabled):active, .btn-info:not(:disabled):not(.disabled).active, .show > .btn-info.dropdown-toggle {
        color: #fff;
        background-color: #117a8b;
        border-color: #10707f; }
        .btn-info:not(:disabled):not(.disabled):active:focus, .btn-info:not(:disabled):not(.disabled).active:focus, .show > .btn-info.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); }
    
    .btn-warning {
      color: #212529;
      background-color: #ffc107;
      border-color: #ffc107; }
      .btn-warning:hover {
        color: #212529;
        background-color: #e0a800;
        border-color: #d39e00; }
      .btn-warning:focus, .btn-warning.focus {
        box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); }
      .btn-warning.disabled, .btn-warning:disabled {
        color: #212529;
        background-color: #ffc107;
        border-color: #ffc107; }
      .btn-warning:not(:disabled):not(.disabled):active, .btn-warning:not(:disabled):not(.disabled).active, .show > .btn-warning.dropdown-toggle {
        color: #212529;
        background-color: #d39e00;
        border-color: #c69500; }
        .btn-warning:not(:disabled):not(.disabled):active:focus, .btn-warning:not(:disabled):not(.disabled).active:focus, .show > .btn-warning.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); }
    
    .btn-danger {
      color: #fff;
      background-color: #dc3545;
      border-color: #dc3545; }
      .btn-danger:hover {
        color: #fff;
        background-color: #c82333;
        border-color: #bd2130; }
      .btn-danger:focus, .btn-danger.focus {
        box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); }
      .btn-danger.disabled, .btn-danger:disabled {
        color: #fff;
        background-color: #dc3545;
        border-color: #dc3545; }
      .btn-danger:not(:disabled):not(.disabled):active, .btn-danger:not(:disabled):not(.disabled).active, .show > .btn-danger.dropdown-toggle {
        color: #fff;
        background-color: #bd2130;
        border-color: #b21f2d; }
        .btn-danger:not(:disabled):not(.disabled):active:focus, .btn-danger:not(:disabled):not(.disabled).active:focus, .show > .btn-danger.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); }
    
    .btn-light {
      color: #212529;
      background-color: #f8f9fa;
      border-color: #f8f9fa; }
      .btn-light:hover {
        color: #212529;
        background-color: #e2e6ea;
        border-color: #dae0e5; }
      .btn-light:focus, .btn-light.focus {
        box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); }
      .btn-light.disabled, .btn-light:disabled {
        color: #212529;
        background-color: #f8f9fa;
        border-color: #f8f9fa; }
      .btn-light:not(:disabled):not(.disabled):active, .btn-light:not(:disabled):not(.disabled).active, .show > .btn-light.dropdown-toggle {
        color: #212529;
        background-color: #dae0e5;
        border-color: #d3d9df; }
        .btn-light:not(:disabled):not(.disabled):active:focus, .btn-light:not(:disabled):not(.disabled).active:focus, .show > .btn-light.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); }
    
    .btn-dark {
      color: #fff;
      background-color: #343a40;
      border-color: #343a40; }
      .btn-dark:hover {
        color: #fff;
        background-color: #23272b;
        border-color: #1d2124; }
      .btn-dark:focus, .btn-dark.focus {
        box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); }
      .btn-dark.disabled, .btn-dark:disabled {
        color: #fff;
        background-color: #343a40;
        border-color: #343a40; }
      .btn-dark:not(:disabled):not(.disabled):active, .btn-dark:not(:disabled):not(.disabled).active, .show > .btn-dark.dropdown-toggle {
        color: #fff;
        background-color: #1d2124;
        border-color: #171a1d; }
        .btn-dark:not(:disabled):not(.disabled):active:focus, .btn-dark:not(:disabled):not(.disabled).active:focus, .show > .btn-dark.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); }
    
    .btn-outline-primary {
      color: #007bff;
      background-color: transparent;
      background-image: none;
      border-color: #007bff; }
      .btn-outline-primary:hover {
        color: #fff;
        background-color: #007bff;
        border-color: #007bff; }
      .btn-outline-primary:focus, .btn-outline-primary.focus {
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); }
      .btn-outline-primary.disabled, .btn-outline-primary:disabled {
        color: #007bff;
        background-color: transparent; }
      .btn-outline-primary:not(:disabled):not(.disabled):active, .btn-outline-primary:not(:disabled):not(.disabled).active, .show > .btn-outline-primary.dropdown-toggle {
        color: #fff;
        background-color: #007bff;
        border-color: #007bff; }
        .btn-outline-primary:not(:disabled):not(.disabled):active:focus, .btn-outline-primary:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-primary.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); }
    
    .btn-outline-secondary {
      color: #6c757d;
      background-color: transparent;
      background-image: none;
      border-color: #6c757d; }
      .btn-outline-secondary:hover {
        color: #fff;
        background-color: #6c757d;
        border-color: #6c757d; }
      .btn-outline-secondary:focus, .btn-outline-secondary.focus {
        box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); }
      .btn-outline-secondary.disabled, .btn-outline-secondary:disabled {
        color: #6c757d;
        background-color: transparent; }
      .btn-outline-secondary:not(:disabled):not(.disabled):active, .btn-outline-secondary:not(:disabled):not(.disabled).active, .show > .btn-outline-secondary.dropdown-toggle {
        color: #fff;
        background-color: #6c757d;
        border-color: #6c757d; }
        .btn-outline-secondary:not(:disabled):not(.disabled):active:focus, .btn-outline-secondary:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-secondary.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); }
    
    .btn-outline-success {
      color: #28a745;
      background-color: transparent;
      background-image: none;
      border-color: #28a745; }
      .btn-outline-success:hover {
        color: #fff;
        background-color: #28a745;
        border-color: #28a745; }
      .btn-outline-success:focus, .btn-outline-success.focus {
        box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); }
      .btn-outline-success.disabled, .btn-outline-success:disabled {
        color: #28a745;
        background-color: transparent; }
      .btn-outline-success:not(:disabled):not(.disabled):active, .btn-outline-success:not(:disabled):not(.disabled).active, .show > .btn-outline-success.dropdown-toggle {
        color: #fff;
        background-color: #28a745;
        border-color: #28a745; }
        .btn-outline-success:not(:disabled):not(.disabled):active:focus, .btn-outline-success:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-success.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); }
    
    .btn-outline-info {
      color: #17a2b8;
      background-color: transparent;
      background-image: none;
      border-color: #17a2b8; }
      .btn-outline-info:hover {
        color: #fff;
        background-color: #17a2b8;
        border-color: #17a2b8; }
      .btn-outline-info:focus, .btn-outline-info.focus {
        box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); }
      .btn-outline-info.disabled, .btn-outline-info:disabled {
        color: #17a2b8;
        background-color: transparent; }
      .btn-outline-info:not(:disabled):not(.disabled):active, .btn-outline-info:not(:disabled):not(.disabled).active, .show > .btn-outline-info.dropdown-toggle {
        color: #fff;
        background-color: #17a2b8;
        border-color: #17a2b8; }
        .btn-outline-info:not(:disabled):not(.disabled):active:focus, .btn-outline-info:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-info.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); }
    
    .btn-outline-warning {
      color: #ffc107;
      background-color: transparent;
      background-image: none;
      border-color: #ffc107; }
      .btn-outline-warning:hover {
        color: #212529;
        background-color: #ffc107;
        border-color: #ffc107; }
      .btn-outline-warning:focus, .btn-outline-warning.focus {
        box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); }
      .btn-outline-warning.disabled, .btn-outline-warning:disabled {
        color: #ffc107;
        background-color: transparent; }
      .btn-outline-warning:not(:disabled):not(.disabled):active, .btn-outline-warning:not(:disabled):not(.disabled).active, .show > .btn-outline-warning.dropdown-toggle {
        color: #212529;
        background-color: #ffc107;
        border-color: #ffc107; }
        .btn-outline-warning:not(:disabled):not(.disabled):active:focus, .btn-outline-warning:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-warning.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); }
    
    .btn-outline-danger {
      color: #dc3545;
      background-color: transparent;
      background-image: none;
      border-color: #dc3545; }
      .btn-outline-danger:hover {
        color: #fff;
        background-color: #dc3545;
        border-color: #dc3545; }
      .btn-outline-danger:focus, .btn-outline-danger.focus {
        box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); }
      .btn-outline-danger.disabled, .btn-outline-danger:disabled {
        color: #dc3545;
        background-color: transparent; }
      .btn-outline-danger:not(:disabled):not(.disabled):active, .btn-outline-danger:not(:disabled):not(.disabled).active, .show > .btn-outline-danger.dropdown-toggle {
        color: #fff;
        background-color: #dc3545;
        border-color: #dc3545; }
        .btn-outline-danger:not(:disabled):not(.disabled):active:focus, .btn-outline-danger:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-danger.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); }
    
    .btn-outline-light {
      color: #f8f9fa;
      background-color: transparent;
      background-image: none;
      border-color: #f8f9fa; }
      .btn-outline-light:hover {
        color: #212529;
        background-color: #f8f9fa;
        border-color: #f8f9fa; }
      .btn-outline-light:focus, .btn-outline-light.focus {
        box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); }
      .btn-outline-light.disabled, .btn-outline-light:disabled {
        color: #f8f9fa;
        background-color: transparent; }
      .btn-outline-light:not(:disabled):not(.disabled):active, .btn-outline-light:not(:disabled):not(.disabled).active, .show > .btn-outline-light.dropdown-toggle {
        color: #212529;
        background-color: #f8f9fa;
        border-color: #f8f9fa; }
        .btn-outline-light:not(:disabled):not(.disabled):active:focus, .btn-outline-light:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-light.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); }
    
    .btn-outline-dark {
      color: #343a40;
      background-color: transparent;
      background-image: none;
      border-color: #343a40; }
      .btn-outline-dark:hover {
        color: #fff;
        background-color: #343a40;
        border-color: #343a40; }
      .btn-outline-dark:focus, .btn-outline-dark.focus {
        box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); }
      .btn-outline-dark.disabled, .btn-outline-dark:disabled {
        color: #343a40;
        background-color: transparent; }
      .btn-outline-dark:not(:disabled):not(.disabled):active, .btn-outline-dark:not(:disabled):not(.disabled).active, .show > .btn-outline-dark.dropdown-toggle {
        color: #fff;
        background-color: #343a40;
        border-color: #343a40; }
        .btn-outline-dark:not(:disabled):not(.disabled):active:focus, .btn-outline-dark:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-dark.dropdown-toggle:focus {
          box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); }
    
    .btn-link {
      font-weight: 400;
      color: #007bff;
      background-color: transparent; }
      .btn-link:hover {
        color: #0056b3;
        text-decoration: underline;
        background-color: transparent;
        border-color: transparent; }
      .btn-link:focus, .btn-link.focus {
        text-decoration: underline;
        border-color: transparent;
        box-shadow: none; }
      .btn-link:disabled, .btn-link.disabled {
        color: #6c757d;
        pointer-events: none; }
    
    .btn-lg, .btn-group-lg > .btn {
      padding: 0.5rem 1rem;
      font-size: 1.25rem;
      line-height: 1.5;
      border-radius: 0.3rem; }
    
    .btn-sm, .btn-group-sm > .btn {
      padding: 0.25rem 0.5rem;
      font-size: 0.875rem;
      line-height: 1.5;
      border-radius: 0.2rem; }
    
    .btn-block {
      display: block;
      width: 100%; }
      .btn-block + .btn-block {
        margin-top: 0.5rem; }
    
    input[type="submit"].btn-block,
    input[type="reset"].btn-block,
    input[type="button"].btn-block {
      width: 100%; }
    
    .btn-group,
    .btn-group-vertical {
      position: relative;
      display: inline-flex;
      vertical-align: middle; }
      .btn-group > .btn,
      .btn-group-vertical > .btn {
        position: relative;
        flex: 0 1 auto; }
        .btn-group > .btn:hover,
        .btn-group-vertical > .btn:hover {
          z-index: 1; }
        .btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active,
        .btn-group-vertical > .btn:focus,
        .btn-group-vertical > .btn:active,
        .btn-group-vertical > .btn.active {
          z-index: 1; }
      .btn-group .btn + .btn,
      .btn-group .btn + .btn-group,
      .btn-group .btn-group + .btn,
      .btn-group .btn-group + .btn-group,
      .btn-group-vertical .btn + .btn,
      .btn-group-vertical .btn + .btn-group,
      .btn-group-vertical .btn-group + .btn,
      .btn-group-vertical .btn-group + .btn-group {
        margin-left: -1px; }
    
    .btn-toolbar {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-start; }
      .btn-toolbar .input-group {
        width: auto; }
    
    .btn-group > .btn:first-child {
      margin-left: 0; }
    .btn-group > .btn:not(:last-child):not(.dropdown-toggle),
    .btn-group > .btn-group:not(:last-child) > .btn {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0; }
    .btn-group > .btn:not(:first-child),
    .btn-group > .btn-group:not(:first-child) > .btn {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0; }
    
    .dropdown-toggle-split {
      padding-right: 0.5625rem;
      padding-left: 0.5625rem; }
      .dropdown-toggle-split::after, .dropup .dropdown-toggle-split::after, .dropright .dropdown-toggle-split::after {
        margin-left: 0; }
      .dropleft .dropdown-toggle-split::before {
        margin-right: 0; }
    
    .btn-sm + .dropdown-toggle-split, .btn-group-sm > .btn + .dropdown-toggle-split {
      padding-right: 0.375rem;
      padding-left: 0.375rem; }
    
    .btn-lg + .dropdown-toggle-split, .btn-group-lg > .btn + .dropdown-toggle-split {
      padding-right: 0.75rem;
      padding-left: 0.75rem; }
    
    .btn-group-vertical {
      flex-direction: column;
      align-items: flex-start;
      justify-content: center; }
      .btn-group-vertical .btn,
      .btn-group-vertical .btn-group {
        width: 100%; }
      .btn-group-vertical > .btn + .btn,
      .btn-group-vertical > .btn + .btn-group,
      .btn-group-vertical > .btn-group + .btn,
      .btn-group-vertical > .btn-group + .btn-group {
        margin-top: -1px;
        margin-left: 0; }
      .btn-group-vertical > .btn:not(:last-child):not(.dropdown-toggle),
      .btn-group-vertical > .btn-group:not(:last-child) > .btn {
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0; }
      .btn-group-vertical > .btn:not(:first-child),
      .btn-group-vertical > .btn-group:not(:first-child) > .btn {
        border-top-left-radius: 0;
        border-top-right-radius: 0; }
    
    .btn-group-toggle > .btn,
    .btn-group-toggle > .btn-group > .btn {
      margin-bottom: 0; }
      .btn-group-toggle > .btn input[type="radio"],
      .btn-group-toggle > .btn input[type="checkbox"],
      .btn-group-toggle > .btn-group > .btn input[type="radio"],
      .btn-group-toggle > .btn-group > .btn input[type="checkbox"] {
        position: absolute;
        clip: rect(0, 0, 0, 0);
        pointer-events: none; }
    
    /*# sourceMappingURL=bootstrap.css.map */
    

    我使用Koala编译scss文件夹。

    【讨论】:

      【解决方案2】:

      我刚刚在 git 上检查了他们的代码。 - > https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/bootstrap/_button-groups.scss

      如您所见,有那些 @include 语句 - 这些是使用的 mixin,它们来自其他文件。

      还有一个占位符 @extend .btn-xs 等,您需要这些,以便您的 scss 可以正确转换为 css。

      您可以只找到这里使用的那些 mixin 和占位符,或者包含整个文件。

      【讨论】:

        猜你喜欢
        • 2017-12-31
        • 1970-01-01
        • 2017-03-18
        • 2018-07-01
        • 2018-03-15
        • 1970-01-01
        • 2023-02-10
        • 2019-12-05
        • 2020-01-06
        相关资源
        最近更新 更多