gpt4 book ai didi

twitter-bootstrap - SimpLESS 不会编译 initializr 生成的 Bootstrap

转载 作者:行者123 更新时间:2023-12-03 23:39:43 26 4
gpt4 key购买 nike

我刚刚下载了一个 intializr 生成的 Bootstrap 版本。我还安装了 SimpLESS 以避免不断地手动重新编译我的 LESS 文件并避免使用浏览器内编译器。然而,SimpLESS 拒绝在我的目录中编译非常基本的 style.css 文件。它吐了:

Result of expresiin style.less on 'e.message' [undefined] is not an object.

注意:“表达式”的拼写确实与上面出现的方式相同。

我的 style.less 文件目前如下所示:
@import "bootstrap/bootstrap.less";

body {
padding-top: 60px;
padding-bottom: 40px;
}

@import "bootstrap/responsive.less";

最佳答案

我遇到了同样的问题,对我来说解决方法是不要嵌套@imports。我在 Win7 上使用 SimpLESS 1.4 和 Bootstrap 2.1.0,如果你的 style.less 文件如下所示,它可以工作:

// CSS Reset
@import "reset.less";

// Core variables and mixins
@import "variables.less"; // Modify this for custom colors, font-sizes, etc
@import "mixins.less";

// Grid system and page structure
@import "scaffolding.less";
@import "grid.less";
@import "layouts.less";

// Base CSS
@import "type.less";
@import "code.less";
@import "forms.less";
@import "tables.less";

// Components: common
@import "sprites.less";
@import "dropdowns.less";
@import "wells.less";
@import "component-animations.less";
@import "close.less";

// Components: Buttons & Alerts
@import "buttons.less";
@import "button-groups.less";
@import "alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less

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

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

// Components: Misc
@import "thumbnails.less";
@import "labels-badges.less";
@import "progress-bars.less";
@import "accordion.less";
@import "bootstrap/carousel.less";
@import "bootstrap/hero-unit.less";

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


//Needed if using fixed navbar
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}

// RESPONSIVE CLASSES
// ------------------

@import "responsive-utilities.less";


// MEDIA QUERIES
// ------------------

// Large desktops
@import "responsive-1200px-min.less";

// Tablets to regular desktops
@import "responsive-768px-979px.less";

// Phones to portrait tablets and narrow desktops
@import "responsive-767px-max.less";


// RESPONSIVE NAVBAR
// ------------------

// From 979px and below, show a button to toggle navbar contents
@import "responsive-navbar.less";

关于twitter-bootstrap - SimpLESS 不会编译 initializr 生成的 Bootstrap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11683600/

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