less

Built-in functions not working with evaluated strings, why?

风格不统一 提交于 2019-11-27 08:13:48
问题 It seems that evaluated color strings are not working with some built-in LESS functions. I have tried using e() and ~"" and any combination of both. I might find a workaround for my particular case, I’m just asking if this is this expected behaviour, or if there is a fault in my reasoning? Any insight appreciated. For example here, the color is created from an evaluated string; note the 'missing' # in the hex value that gets added later : .broken-mixin(@hexcode: '9719e1') { @color: e("#@

Using undefined number of arguments in mixins

99封情书 提交于 2019-11-27 08:11:43
问题 I currently have -webkit specific attributes in my Less CSS sheet, I am trying to update them with mixins to add -moz attributes, like this: .transition(@1) { -webkit-transition: @1; -moz-transition: @1; } div { .transition(all .5s); } The example above works fine, however I also have things like that: div { -webkit-transition: border-color .3s, background .3s; } And I can’t call the mixin as .transition(border-color .3s, background .3s) because it has more arguments than defined in the mixin

Media Query grouping instead of multiple scattered media queries that match

邮差的信 提交于 2019-11-27 08:09:35
I'm experimenting with LESS (not a fan of the SASS syntax) and have been trying to find out what the best way to do media queries with it would be. I read through this blog post on how to "do" media queries with LESS, but it points out the fact that this causes all the media queries to be separated and scattered throughout the resulting CSS. This doesn't really bother me (I could care less about the result and more about it working). What did bother me was a comment that talked about issues when viewing from iOS devices and the commenter found that once the media queries were consolidated the

Dotless - Can't reference less variable in separate file with MVC Bundling

和自甴很熟 提交于 2019-11-27 07:41:38
问题 I hope I'm not creating a duplicate topic, but I've been searching for two days and can't find a solution to this. We are starting a new project in MVC4 and we have the less version of bootstrap loaded. The issue I'm running into is when I try to reference some classes or variables in the bootstrap.less , my global.less , or any thing outside the current file. I can create a variable in the top of the current file and use it just fine, but if I want to use something out of a separate file, I

Double border with different color

强颜欢笑 提交于 2019-11-27 07:33:11
With Photoshop, I can put two different border to an element with two different color. And with that, I can make many dynamic shade-effect with my elements. Even with Photoshop effects, I can manage that with Drop Shadow and Inner Shadow. On the Web Design concern, if I have design like the image below, how can I achieve that with CSS? Is it really possible? NOTE: I'm giving two borders to the white element: the outer border is white, and the inner border is greyish. Together, they create a dynamic look so that it feels like an inset element, and the white element is pillow embossed. So thing

Prefixing all selectors for twitter bootstrap in less

北城以北 提交于 2019-11-27 07:31:13
I'd like to start learning Twitter Bootstrap and merging it into my site (starting with the form elements) but it breaks the rest of the site if I include it as is. I'd like to prefix all of the selectors so that I can gradually add content that's bootstrap-styled like so: <div class="bootstrap"><!-- bootstrap styled stuff here --></div> Because I'm only starting to learn, I don't really know what's possible with less . I have manually done the selector prefix but I'm curious if there would be a way to do this with less so that I can learn it by modifying bootstrap while still isolating it in

Dynamically changing less variables

醉酒当歌 提交于 2019-11-27 07:30:42
I want to change a less variable on client side. Say I have a less file @color1: #123456; @color2: @color1 + #111111; .title { color: @color1; } .text { color: @color2; } I want that user yo pick a color and change the value of @color1 and recompile css without reloading the page. Basically I'm looking for a js function, something like this less_again({color1: '#ff0000'}) Moin Zaman The creator of less.js added some features that should allow you to do something like this. Read the comments and the answers here: Load less.js rules dynamically Marvin, I wrote a function that does exactly what

MySQL分区与传统的分库分表

℡╲_俬逩灬. 提交于 2019-11-27 07:29:08
传统的分库分表 传统的分库分表都是通过应用层逻辑实现的,对于数据库层面来说,都是普通的表和库。 分库 分库的原因 首先,在单台数据库服务器性能足够的情况下,分库对于数据库性能是没有影响的。在数据库存储上, database 只起到一个 namespace 的作用。 database 中的表文件存储在一个以 database名 命名的文件夹中。比如下面的 employees 数据库: mysql> show tables in employees; +---------------------+ | Tables_in_employees | +---------------------+ | departments | | dept_emp | | dept_manager | | employees | | salaries | | titles | +---------------------+ 在操作系统中看是这样的: # haitian at haitian-coder.local in /usr/local/var/mysql/employees on git:master ● [21:19:47] → ls db.opt dept_emp.frm dept_manager.ibd salaries.frm titles.ibd departments.frm dept

How can I establish the difference between two HEX colours?

社会主义新天地 提交于 2019-11-27 07:28:26
问题 I need to be able to extract the different between two hex colours, represented itself as a hex colour, in order to combine them at a later point using LESS. Ideally, this would work in javascript 回答1: If you want a full Javascript solution : function parseHexColor(c) { var j = {}; var s = c.replace(/^#([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})$/, function(_, r, g, b) { j.red = parseInt(r, 16); j.green = parseInt(g, 16); j.blue = parseInt(b, 16); return ""; }); if(s.length == 0) {

less mixin or selector to change position based on sibling index?

老子叫甜甜 提交于 2019-11-27 06:49:04
问题 I'm trying to adjust the position of several sibling divs based on which sibling they are. Currently, they're all position: absolute , but that's not set in stone. They are each a few hundred pixels tall, but I want them to overlap each other so that the ones behind only 'peek' out above the ones in front by a few pixels. The easiest way I can think of to do this would be a Less mixin for nth-of-type that, instead of only applying the rules to the matching one index, instead passes the index