less

LESS Variable Interpolation

社会主义新天地 提交于 2019-12-24 13:44:23
问题 I'm trying to simplify my CSS even further than I already have with LESS by using functions and variable interpolation. I was completely unaware of variable interpolation until I took a look at Hover.css' less files which is no surprise as to why I'm screwing up now. I'm working on Reddit to make a flair system and I am encountering problems using variable interpolation. I am currently using the below as a test: .flair.flair-one { color: red; } .flair.flair-two { color: green; } .flair.flair

Using Flexbox with bootstrap 3 and laravel 4 blade templates and associated LESS mixin

戏子无情 提交于 2019-12-24 13:43:04
问题 I am trying to implement a flexbox solution to display an inline mailbox system for a site that is in development. The basic design I need to implement is displayed in the wireframe : The zone with the red border is where I need to implement the flexbox. As the development is done with Laravel Blade Tempting engine, we're using included files to generate the content of the three panes (left mailboxes, middle email list and right email viewer). The basic code structure is as follows: This

Dynamic class to element with Less

孤人 提交于 2019-12-24 12:01:08
问题 I am using bootstrap.less and i want to add class="table table-striped table-hover" to all tables. Is it possible to achieve this? I want to add something like: table { //Add class here } 回答1: If I understand you correctly, I believe you're looking for: table { .table; .table-striped; .table-hover; /* Any other default table styles */ } While you can't add class="table table-striped table-hover" to each element (that's more in the JS-realm), you can get the same effect by using the other

Codekit Compass vs Less compilation when spriting

荒凉一梦 提交于 2019-12-24 09:19:04
问题 I recently moved from using Less to using Compass. I use Codekit, but dont use the built in Compass compiler due to it having problems when using plugins. Now my issue is that the compilation is significantly longer compared to Less. I have realized that this is due to it generating sprites on each compile. Is there a way to turn this off? IE, only compile when I have a certain customization in place. I looked at the customization, and there is no way to set a customization property that

how to optimize Less CSS? how to generate 1 minified version of all less files? I am also using modifyVars

戏子无情 提交于 2019-12-24 08:21:04
问题 Help! I am using Less CSS and less.js to compile all less file and now i am already done and i am optimizing the site. I'm trying to search on web on how to optimize less css. I want to have a 1 minified file version of all my less files without generating it to back to css file since i am using modifyVars. or is there alternative way? any suggestion or recommendation would be much appreciated. Cheers, 回答1: Don't use less.js in a product environment. LESS is a pre compiler you should use the

Django Compressor with dynamic LESS file raises a FilterError(err)

醉酒当歌 提交于 2019-12-24 07:17:34
问题 I had to come up with quite a complicated setup to enable database based styling options for users. Users enter styles (like background color, font face, etc...) in the django admin backend. I am creating a dynamic LESS file by rendering a template view as plain text view like so: views.py: class PlainTextView(TemplateView): """ Write customized settings into a special less file to overwrite the standard styling """ template_name = 'custom_stylesheet.txt' def get_context_data(self, **kwargs):

C++STL中的less和greater

廉价感情. 提交于 2019-12-24 06:36:36
greater() 和less()函数经常使用在sort()中用来对容器进行降序或者升序排序,或者用在push_heap()和pop_heap()中用来构建最小堆(greater)或者最大堆(less). 二者包含在头文件functional中 //包含在头文件<functional>中 // TEMPLATE STRUCT greater template < class _Ty > struct greater : public binary_function < _Ty , _Ty , bool > { // functor for operator> bool operator ( ) ( const _Ty & _Left , const _Ty & _Right ) const { // apply operator> to operands return ( _Left > _Right ) ; } } ; // TEMPLATE STRUCT less template < class _Ty > struct less : public binary_function < _Ty , _Ty , bool > { // functor for operator< bool operator ( ) ( const _Ty & _Left , const _Ty &

Conditionally encapsulate rules

淺唱寂寞╮ 提交于 2019-12-24 06:27:41
问题 Let's say I have the following: @import 'hello.less' Based on a variable value, I want to nest this inside another class. The following is what I want to accomplish, in pseudocode : if(@someVar = true): .someClass { @import 'hello.less' } else: @import 'hello.less' I guess I could use mixin guards, but I don't know how to handle the 'else' case: .someClass when (@someVar = true) { @import 'hello.less' } // Else? 回答1: Using not and &( & expands to nothing if its parent is the global scope (e.g

LESS - multiple different classes with the same style?

孤街浪徒 提交于 2019-12-24 05:54:43
问题 How would you write this style below in LESS? nav a:hover, nav a:focus, footer a:hover, footer a:focus, .fullscreen-container a:hover, .fullscreen-container a:focus { text-decoration: none; } My attempt: .text-decoration-none () { text-decoration: none; } nav a { &:focus, &:focus { .text-decoration-none (); } } footer a { &:focus, &:focus { .text-decoration-none (); } } .fullscreen-container a { &:focus, &:focus { .text-decoration-none (); } } Result: nav a:focus, nav a:focus { text

Apply style to child elements with LESS

南楼画角 提交于 2019-12-24 04:19:10
问题 This works: .layoutList { background-color: #CFCFCF; } .layoutList > .entityCard.hover { background-color: #FFFFFF; border: 1px solid yellow; } Why doesn't this work the same as the above code? What is the appropriate way to "cascade" this in LESS so that everything is under the main .layoutList {} section? .layoutList { background-color: #CFCFCF; .entityCard.hover { background-color: #FFFFFF; border: 1px solid yellow; } } 回答1: What you have for your LESS should work. It compiles to this CSS: