less

Image urls for Rails 4 + Less not including the hash

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a Rails 4 application and am using the less-rails gem. In main.css.less , I add a background image to the site using: body { background-image: image-url("background.jpg"); } Everything works fine locally, but when I push up to my server with precompiled assets, the image url is not updating to include the hash. That is, the image now lives at public/assets/background-074c0b767cd8cfb2da93b37ea3596326.jpg but my css file still says url(/assets/background.jpg) . The link below seemed very promising, but none of the recommended solutions

bootstrap 3.0 grid with less than 12 columns

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to create a calendar using the grid with only 7 columns. I would like to have these 7 columns evenly spaced and fit the entire row. Currently, the 7 columns does not add up to 12 and I get 12 columns with 5 empty. Is there a way in Bootstrap 3 to get all 7 spread across the row? 回答1: Your best bet is probably to create your own custom column class. Since you want a colum that spans 1/7th the width of it's parent, use width:14.285%; (100 divided by 7 = 14.285...). DEMO: http://www.bootply.com/uakh14tkuX CSS . col - day {

How to change the theme color in less css using javascript/jquery

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: am using the below less css to change different theme color @lightRed : #fdd; @lightGreen : #dfd; @lightBlue : #ddf; @defaultThemeColor : @lightBlue ; #header{ . wrapper (); width : @defaultWidth ; height : 80px ; margin - bottom : 20px ; background : @defaultThemeColor ; } #menu{ background : @defaultThemeColor ; } And html is as follows: <div id = "swatch" > <ul> <li><a href = "" > theme1 </a></li> <li><a href = "" > theme2 </a></li> <li><a href = "" > theme3 </a></li> </ul> </div> when theme1 is clicked @lightRed theme should be

Passing less variables from webpack

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to pass less variables within a webpack configuration to the less loader, naturally. For some reason the variable is not being passed ok. I can't figure the correct syntax. The variable has a dynamic content that is determined at the build time, in the webpack config file. This is the relevant line (I've tried many variations of it): loader: 'style!css?-minimize!less?-minimize&{modifyVars:{"resources-path-prefix":"' + pathPrefix + '"}}' In the above example some pathPrefix is being determined at build time and we want to pass its

Check if parent has class using LESS

风流意气都作罢 提交于 2019-12-03 08:27:24
问题 Example scenario: I would like to hide a sub-navigation menu if the user has javascript enabled so that it can be revealed on a click of a navigation link further up in the nav hierarchy. Modernizr adds a class 'js' to the html tag if javascript is enabled so I can use that for detection. In SASS I can do something like this: div.subnav{ display: block; html.js & { display: none; } } Can this be done using LESS? Can I target a parent from within another rule? 回答1: Can this be done using LESS?

LESSCSS method with IE FIlter Alpha Opacity CSS

你离开我真会死。 提交于 2019-12-03 08:26:05
问题 I am using LESSCSS. I'm trying to create a method for opacity: .opacity (@opacity) { opacity: @opacity; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=(@opacity * 100))"; filter: alpha(opacity = (@opacity * 100)); } So, If I call it using: h1 { .opacity(.5); } I want it to output: h1 { opacity: .5; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=50)"; filter: alpha(opacity = 50); } But instead, LESS throws the error: Expected '}' on line 30 in file '/Content/styles

less语法

点点圈 提交于 2019-12-03 08:23:39
一、less语言特性 1.1 概览   作为 CSS 的一种扩展,LESS CSS 不仅向下兼容 CSS 的语法,而且连新增的特性也是使用 CSS 的语法。这样的设计使得学习 LESS 很轻松,而且你可以在任何时候回退到 CSS。 1.2 变量 1.2.1 变量的定义和使用    定义变量: less定义变量使用 “@变量名: 变量值” 的方式定义;    使用变量: 在需要使用定义好的变量的css属性后面直接使用 “@变量名” 即可。 例如:在less文件中代码如下 @width : 100px; //定义变量 .w { width: @width; //使用变量 } 1.2.2 变量的作用域   如果对同一个变量定义两次的话,在当前作用域中最后一次定义的将被使用。这不 CSS 的机制类似,最后一次定义的值会成为这个属性的值。若定义在嵌套乊中,那么这个变量就叧能服务亍这个嵌套乊内的属性了。 变量也是没有顺序可言的,只要页面里有(即可以在变量定义之前使用),都会按顺序覆盖,按顺序加载 。例如 @width : 1px; .meng { @width : 2px; .long { @width : 9000px; width:@width; @width : 22px; } width: @width; }   编译后为: .meng { width: 2px; } .meng

在HBuilderX中新建的Vue项目中使用less

爱⌒轻易说出口 提交于 2019-12-03 08:09:02
1.在HBuilderX中新建Vue项目    2. 安装less和less相关的转移插件   打开cmd cd到项目所在的目录:      在命令行执行:cnpm install ( 注意:必须先执行这一步,安装依赖,后面一步是基于这一步的 )   在命令行执行: c npm install --save-dev less less-loader css-loader style-loader    3. 在Vue文件中使用Less编写样式代码       4. 运行项目   在命令行使用命令: npm run serve运行项目    可以看到使用less语法的效果:    来源: https://www.cnblogs.com/hebing0415/p/11784525.html

rem 适配布局 + LESS + 媒体查询

三世轮回 提交于 2019-12-03 07:39:24
1. rem 基础  rem 是一个相对单位,类似于 em ,em 是父元素字体大小。  em 是相对于父元素 的字体大小来说的  rem 是相对于 html 元素 字体大小来说的  rem 优点 就是可以通过修改 html 里面的文字大小来改变页面中元素的大小可以整体控制  比如:根元素(html )设置的 font-size=12px;非根元素设置 width:2rem;则换成px 表示 24px(12px*2rem) 2. 媒体查询(@media)  @media 可以针对不同的屏幕尺寸设置不同的样式  语法规范:   @media mediatype and | not | only (media feature){     CSS - Code;   } 用 @media 开头 mediatype 媒体类型     all:用于所有设备,     print:用于打印机和打印预览,     screen:用于电脑屏幕,平板电脑,手机等 关键字 and not only     and:可以将多个媒体特性连接到一起,相当于“且”的意思     not:排除某个媒体类型,相当于“非”的意思,可以省略     only:指定某个特定的媒体类型,可以省略 media feature 媒体特性 必须有小括号包含     width:定义输出设备中页面可见区域的宽度     max

How to compile Bootstrap LESS source in VS 2013

霸气de小男生 提交于 2019-12-03 06:52:48
I have visual studio 2013 Ultimate Update 4 plus Web Essentials installed and updated. I download bootstrap V3.3.1 source I copied the css, js, fonts and less folder to visual studio. Now I want to compile all .less files after my edits there to overwrite the bootstrap.css file, I selected all files in solution explorer and right click but all Web Essentials menu items disabled. What are the steps I should follow to compile all files to .css file or should I use a different tool than Web Essentials? For the record the current Web Essentials will re-compile any compiled files when edits occur,