less

LESS CSS Escape entire CSS rule with different prefixes?

纵饮孤独 提交于 2019-12-01 19:54:11
How do i escape the following: .prefix(@rule, @prop) { -webkit-@{rule}: @{prop}; -moz-@{rule}: @{prop}; -o-@{rule}: @{prop}; -ms-@{rule}: @{prop}; @{rule}: @{prop}; } I've tried a bunch of different ways, wrapping it in ~"stuff" , wrapping the variables in @{var} , backslashing the - 's... no success! Edit: There's a pull req for it on Github: https://github.com/cloudhead/less.js/pull/698 Update for LESS 1.6+ Your original plan almost works with the LESS 1.6 update . This is the syntax needed: LESS .prefix(@rule, @prop) { -webkit-@{rule}: @prop; -moz-@{rule}: @prop; -o-@{rule}: @prop; -ms-@

Less & Sass 的区别

一曲冷凌霜 提交于 2019-12-01 19:35:50
Less   CSS 预处理语言。扩展了 CSS 语言,增加了嵌套、变量、混合(Mixins)、函数等特性,使 CSS 更易维护和扩展。   Less 基于 JavaScript, 是在客户端处理的。 // 变量: @width: 10px; #header{ width: @width } // 混合器:Mixins 可以传递参数 .bordered (@normal, @hover) {   &:hover { color: @hover }    color: @normal; border-top: 1px solid blue; border-bottom: 1px solid red; } .notice{ color: #111; .bordered(blue, red)    // 解析出:  // .notice { color: blue; border-top: 1px solid blue; border-bottom: 1px solid red; }  // .notice:hover { color: red } } Sass   CSS 预处理语言。增加了嵌套、变量、混合(Mixins)、   Sass 基于 Ruby 语言, 是在服务器端处理的。因此安装 sass 前需要安装 Ruby。 // 变量: $width: 80px; #header{

oracle分区表 转

放肆的年华 提交于 2019-12-01 19:28:21
oracle表分区详解 从以下几个方面来整理关于分区表的概念及操作: 表空间及分区表的概念 表分区的具体作用 表分区的优缺点 表分区的几种类型及操作方法 对表分区的维护性操作 1.表空间及分区表的概念 表空间:   是一个或多个数据文件的集合,所有的数据对象都存放在指定的表空间中,但主要存放的是表, 所以称作表空间。 分区表: 当表中的数据量不断增大,查询数据的速度就会变慢,应用程序的性能就会下降,这时就应该考虑对表进行分区。表进行分区后,逻辑上表仍然是一张完整的表,只是将表中的数据在物理上存放到多个表空间(物理文件上),这样查询数据时,不至于每次都扫描整张表。 2.表分区的具体作用 Oracle的表分区功能通过改善可管理性、性能和可用性,从而为各式应用程序带来了极大的好处。通常,分区可以使某些查询以及维护操作的性能大大提高。此外,分区还可以极大简化常见的管理任务,分区是构建千兆字节数据系统或超高可用性系统的关键工具。 分区功能能够将表、索引或索引组织表进一步细分为段,这些数据库对象的段叫做分区。每个分区有自己的名称,还可以选择自己的存储特性。从数据库 管理员的角度来看,一个分区后的对象具有多个段,这些段既可进行集体管理,也可单独管理,这就使数据库管理员在管理分区后的对象时有相当大的灵活性。但 是,从应用程序的角度来看,分区后的表与非分区表完全相同,使用 SQL DML

通过LESS/Sass自定义Bootstrap的式样

主宰稳场 提交于 2019-12-01 19:20:15
一、定制Bootstrap 在实际前端UI开发中,对 Bootstrap 的式样进行自定义是必要的。 定制Boostrap的式样的方法通常有如下几种: 覆盖原有的bootstrap式样 通过构建器,对bootstrap中的式样变量自定义。 通过bootstrap less深度定制式样。 下面我们就来分析上面的三种方法各自的优缺点。 方法一、覆盖原有的bootstrap式样 这里的“覆盖”是CSS层叠式样的覆盖的意思,具体方法是将我们的my-custom.css文件引用放到bootstrap.css文件的后面,这样我们定义的样式就会覆盖原有的样式。 优点:方便,不会变更原来的工作流程。 缺点:很明显,会导致式样不一致和臃肿,以及降低了CSS式样的可维护性。 很显然,这种方法的缺点非常明显,可以在非正式场合如测试环境中使用,但是在正式开发环境中是不应该使用。 方法二、使用构建器自定义bootstrap的式样变量 使用官网的定制页面 http://v3.bootcss.com/customize/ 可以自定义bootstrap的式样。 定制好你的变量后点击download按钮就会生成一套属于你的bootstrap框架了。 这种方法: 优点:简便了你对整体网站式样的更改。 缺点:项目网站的式样必定是不断变更的,这意味着你需要不断的根据你的式样重新构建bootstrap框架

Retrieve or set LESS variable from JavaScript?

馋奶兔 提交于 2019-12-01 18:47:39
问题 While testing my web app, I'd like to be able to set the value of one of my LESS @variables using a simple dropdown. (To change the color scheme altogether). I guess after setting the value, LESS has to reload/recompile the .less files with the new value? Is there any simple way of accomplishing this? (I'm not running node.js) The basic example would be something like: styles.less @base-color = `window.baseColor()` 回答1: I think you're doing it in a bit too complicated way ;) Here's what I

vuecli3 less 全局变量

风格不统一 提交于 2019-12-01 18:38:00
1,安装style-resources-loader:vue add style-resources-loader; 2,在vue.config.js中的pluginOptions添加第三方插件:  a,引入路径:const path = require('path');   b,配置: pluginOptions: { 'style-resources-loader': { preProcessor: 'less', patterns: [ path.resolve(__dirname, './src/assets/custom.less') ] } }, 3,在定义的less文件上部声明文件采用 UTF-8 编码:   @charset "UTF-8"; 来源: https://www.cnblogs.com/wxx-17-5-13/p/11712548.html

LessCSS - IE gradient filter with variables and lighten

怎甘沉沦 提交于 2019-12-01 18:16:20
I need to have an IE gradient filter in Less CSS with a variable and lighten. Is this possible? #whatever { filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='lighten(@grayColor, 3%)', endColorstr='@greenColor', GradientType=0); } As far as I know you can't mix escaping (because that's what you need here) and colour functions (lighen). So you'll need to store the startColor value in another variable. @grayColor :#dddddd; @greenColor : #ff0000; @start : lighten(@grayColor, 3%); .css { filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr='@{start}', endColorstr='@

Node not finding Less module

旧时模样 提交于 2019-12-01 18:13:57
I am trying to install Node and Less on Ubuntu 12.1. Installing appears to work ok and I can see there is a Less folder created when I install Less using "sudo npm g install less" in: /usr/local/lib/node_modules However when I run "lessc -v" I get the below: module.js:340 throw err; ^ Error: Cannot find module 'less' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:362:17) at require (module.js:378:17) at Object.<anonymous> (/usr/bin/lessc:8:12) at Module._compile (module.js:449:26) at Object.Module._extensions..js

Can I do math within a LESS css string interpolation?

自闭症网瘾萝莉.ら 提交于 2019-12-01 17:43:16
I have this less and I can't figure out how to do the math inside the string @bp-tablet-landscape: 1024px; @bp-tablet-portrait : 768px; @tablet-landscape-only: ~"only screen and (min-width:@{bp-tablet-portrait} + 1) and (max-width: @{bp-tablet-landscape})"; Usage div#header { @media @tablet-landscape-only { background: #000; } } But it doesn't quite compile correctly. It doesn't add 768px + 1 as I had hoped. Any ideas? I've tried several different flavors and I can't nail it. I can obviously define a variable outside the string concat, but I'd like to avoid that approach if possible. winLess

On input focus change color of label. How?

…衆ロ難τιáo~ 提交于 2019-12-01 17:43:11
On input focus I want to change the color of the label element. How can I achieve this in less? .control-label{ color: @gray-light; } .controls{ input, textarea{ background-color:red; &:focus{ .control-label &{ color: red; //HERE } } } HTML: <div class="control-group"> <label class="control-label" for="inputEmail">Firstname</label> <div class="controls"> <input type="text" id="inputEmail" placeholder="Firstname"> </div> </div> Bass Jobsen I don't think you can without changing your HTML, see also: Is there any way to hover over one element and affect a different element? , your elements should