简单不会编译Initializr生成的Bootstrap [英] SimpLESS won't compile initializr generated Bootstrap

查看:85
本文介绍了简单不会编译Initializr生成的Bootstrap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚下载了Initializr生成的Bootstrap版本.我还安装了SimpLESS,以免经常不得不手动重新编译LESS文件,并且避免使用浏览器内编译器.但是,简单地拒绝在我的目录中编译非常基本的style.css文件.它吐出来了:

I just downloaded an intializr generated version of Bootstrap. I also installed SimpLESS to keep from having to constantly having to manually recompile my LESS files and to avoid using the in-browser compiler. SimpLESS however, refuses to compile the very basic style.css file in my directory. It spits up:

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

注意:表情"的拼写确实与上面的显示方式相同.

Note: "Expression" is indeed spelled the way it appears above.

我的style.less文件当前如下所示:

My style.less file currently looks like this:

@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文件看起来像这样,它将起作用:

I experienced the same issue, and the workaround for me was to not have nested @imports. I'm using SimpLESS 1.4 and Bootstrap 2.1.0 on Win7 and it works if your style.less file looks like this:

// 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";

这篇关于简单不会编译Initializr生成的Bootstrap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆