less

Webpack, less-loader - Unexpected token - Why?

这一生的挚爱 提交于 2019-12-05 01:19:40
I'm using Webpack (in a Windows environment) and I'm trying to use less-loader and extract-text-webpack-plugin to generate a css file. I have less , webpack-core and webpack also in my node_modules folder. In my app I use: require('./index.less'); My Webpack config: const path = require('path'); const ExtractTextPlugin = require("extract-text-webpack-plugin"); module.exports = { entry: [ './app/index.jsx' ], output: { path: path.join(__dirname, '/public'), filename: "js/app.js" }, module: { loaders: [{ test: /\.(js|jsx)$/, include: path.join(__dirname, '/app'), exclude: path.join(__dirname, '

webpack编译less和sass

99封情书 提交于 2019-12-05 01:04:31
1.Less (1)处理效果 (2)安装loader 安装less-loader和less 下载: npm install less-loader less --save-dev (2)配置loader 代码: 2.Sass (1)处理效果 (2)安装loader 安装sass-loader和node-sass 下载: npm install sass-loader node-sass --save-dev (2)配置loader 来源: https://www.cnblogs.com/lanlanJser/p/11893922.html

Intellij indents 4 spaces when I have configured it to do 2 spaces (LESS)

本小妞迷上赌 提交于 2019-12-05 00:30:04
On Intellij IDEA 14, I have tried to set my preferences in Editor > Code Style > LESS to do 2 space indents but no matter what I do, my code ends up getting formatted with 4 space indents. How do I get it to do 2 space indents for LESS? If your project has an ".editorconfig" file, IntelliJ 14 uses that by default (which overwrites your settings). If you absolutely do not wish to use these settings, you need to disable the editorconfig plugin. Not as likely, but if you make a scratch buffer and rename it to filename.ext. It does not honor the code style for *.ext, it defaults to tabs. You have

在react中配置less

試著忘記壹切 提交于 2019-12-04 23:41:56
在创建项目之后执行 $  yarn eject   抽离配置文件 会多出config和script文件夹 接下来安装less yarn add less less-loader 或者 npm install less less-loader 安装完成后打开config文件夹,找到webpack.config.js文件 这里一共有三项需要修改   1.修改style files regexes(样式文件正则),找到 注释style files regexes,在这部分最后添加如下两行代码: const lessRegex = /\.less$/; const lessModuleRegex = /\.module\.less$/;   2.修改 getStyleLoaders 函数,添加代码 lessOptions  { loader: require.resolve('less-loader'), options: lessOptions, }   3.模仿代码中提供的sassRegex代码,添加如下代码   { test: lessRegex, exclude: cssModuleRegex, use: getStyleLoaders({ importLoaders: 1, sourceMap: isEnvProduction && shouldUseSourceMap, }),

Bootstrap 4 supports LESS?

时间秒杀一切 提交于 2019-12-04 23:41:14
As nowadays bootstrap team announced the version 4 alpha which natively uses SASS as CSS preprocessor. Is this mean it hasn't any LESS support?! You have to remember that Bootstrap 4 is in its Alpha phase. Currently it does not support LESS, as Bootstrap's blog entry on Bootstrap 4 Alpha states: Moved from Less to Sass. Bootstrap now compiles faster than ever thanks to Libsass, and we join an increasingly large community of Sass developers. However , version 4's Getting Started page does still give LESS a mention (although I imagine this is a copy/paste oversight): npm Bootstrap’s package.json

Integrate LESS version of Bootstrap-Material-Design to Rails Project

折月煮酒 提交于 2019-12-04 23:01:34
I am using this gem bootstrap-material-design which is a sass version of https://github.com/FezVrasta/bootstrap-material-design library but recently I have noticed that sass version is no longer maintained. Problem i am facing with this gem is that it doesn't turn buttons and flash messages to material styled. One solution as suggested here: https://github.com/FezVrasta/bootstrap-material-design/issues/535 is to use LESS version but I dont know how to Integrate the LESS version of this Library. anyone has done this already ? UPDATE : In case anyone is looking to add Bootstrap-Material-Design

Get less variables list using less.js

非 Y 不嫁゛ 提交于 2019-12-04 22:38:28
I'm using client-side less.js. Is there a way to get all variables from my less file. I know how to modify variables: less.modifyVars({ "@var": "#fff" }); But I want to get all of them, like (don't work): var variables = less.getVars(); This is going to be an unconventional answer as it seems that this data isn't publicly exposed as part of the browser facing API. tl;dr Save a local copy of the less.js file. Add this function definition somewhere function exposeVars(root) { var r=root._variables,n=Object.keys(r),m={} for(var k of n){m[k]=r[k].value} less.variables = m; } Add the following call

Using and routing Less file in the layout.cshtml in ASP.NET Core 2

馋奶兔 提交于 2019-12-04 21:55:21
I've used a template for admin section (bootstrap admin template) in my project and installed it from Bower and I've applied ASP.NET Core 2 . When I run the project, I get an error that is: FileError: ' http://localhost:52125/lib/bootstrap-admin-template/public/assets/less/theme.less ' wasn't found (404) in theme.less But the file, theme.less , exists in the path!! I don't know why browsers cannot recognize the file. For routing the theme.less file I did: <link rel="stylesheet/less" type="text/css" href="~/lib/bootstrap-admin-template/public/assets/less/theme.less"> How can I fix this problem?

Calculating background-position with a formula in LESS Css

放肆的年华 提交于 2019-12-04 21:47:13
I need to be able to calculate the background position using a math formula in LESS Css via a function method that takes the x and y position of a sprite image. My best guess for this is as follows, but alas this doesn't work. @icon_base: 30px; @icon: 24px; /*sets the position of the background based on the x and y position order */ .icon_position(@x: 1, @y: 1) { @posx: ((#sizes[@icon_base] - #sizes[@icon])/2 + (@x * #sizes[@icon_base])) * -1; @posy: ((#sizes[@icon_base] - #sizes[@icon])/2 + (@y * #sizes[@icon_base])) * -1; background-position: @{posx}px @{posy}px; } I think you have some

Lesscss and ASP.NET MVC

我们两清 提交于 2019-12-04 20:52:45
问题 Since switching my site from ASP.NET WebPages to MVC4, I'm having trouble with Lesscss. CSS + Javascript lines: <link href="@Url.Content("~/Content/site.css")" rel="stylesheet/less" type="text/css" /> <script src="@Url.Content("~/Scripts/less-1.3.0.min.js")" type="text/javascript"></script> I have NO idea what is wrong. The paths are correct. The stylesheet works when you drop the '/less' from the CSS link to use it normally. When trying to use the Lesscss JS file, it loads fine BUT no