如何从bootswatch .less文件开始重新编译.css文件? [英] How to recompiles .css files starting from bootswatch .less files?

查看:97
本文介绍了如何从bootswatch .less文件开始重新编译.css文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功安装了节点并减少了

I succesfully installed node and less

我从bootswatch下载了"Flatly"中的以下两个文件:

I downloaded from bootswatch the following two files from them 'Flatly':

  • variable.less
  • bootswatch.less

现在,我想简单地创建最终的boostrap.css而不做任何修改,只是想尝试一下是否完全不影响来自相同主题的bootstrap.css文件.

Now I'd like simply create the final boostrap.css without do any modification, just to try if all is indetical to precooked bootstrap.css files from the same theme.

我尝试过

lessc variables.less > bootstrap.css

但是我没有空的boostrap.css文件

But I got empty boostrap.css file

我尝试过

lessc bootswatch.less > bootstrap.css

但是我知道了

NameError:变量@ navbar-default-bg在以下位置未定义 C:\ Users \\ Downloads \ bootswatch.less,第16行,第14列:15
背景颜色:#fff; 16色:@ navbar-default-bg; 17}

NameError: variable @navbar-default-bg is undefined in C:\Users\\Downloads\ bootswatch.less on line 16, column 14: 15
background-color: #fff; 16 color: @navbar-default-bg; 17 }

所以我尝试了

lessc variables.css bootswatch.less > bootstrap.css

它没有给我任何错误,但仍然有一个空的bootstrap.css文件.

It give me no errors, but still I got an empty bootstrap.css file.

是否有任何方法可以直接使用更少或绝对更少的方法来编译.css,我必须执行定制中列出的所有步骤.这里?

Is there any way to compile .css using directly less or absolutely must I do all of the steps listed at Customization here ?

推荐答案

获取Bootswatch定制的Bootstrap CSS的最简单方法(如果您不想打扰所有

The simplest way to get a Bootswatch customized Bootstrap css (if you don't want to bother with all that black magic) is the following:

  1. 下载更少的Bootstrap 资源
  2. 下载相应的Bootswatch variable.lessbootswatch.less.
  3. 使用以下导入创建新文件:

  1. Download Bootstrap Less sources
  2. Download corresponding Bootswatch variable.less and bootswatch.less.
  3. Create new file with the following imports:

// Set imported file paths to their actual location in your environment
@import "..../bootstrap/less/bootstrap"; // <- Bootstrap  bootstrap.less 
@import "..../.../bootswatch";           // <- Bootswatch bootswatch.less 
@import "..../.../variables";            // <- Bootswatch variables.less

  • 使用lessc(或任何兼容工具)编译此文件.

  • Compile this file with lessc (or whatever compatible tool).

    这篇关于如何从bootswatch .less文件开始重新编译.css文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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