less

setting an image to fill the background of a div

人盡茶涼 提交于 2019-12-11 00:59:30
问题 I'm trying to set an image as a background for the main body DIV. The image needs to scale to fit the div and be vertically and horizontally centred . Overflow can be hidden on all sides. Within the div, there needs to be a 25px padding on all sides, then the inner div has a background colour with a 0.2 opacity. Within that div is the component area where the articles are published, again, with a 25px padding on all sides. You can see the problem I am having here: http://betelec.ergonomiq.net

Faster website by combining CSS files in one file - Laravel

安稳与你 提交于 2019-12-11 00:37:17
问题 Actually I am new in Laravel community, and I have finished my website finally :) But what I am facing now is the slowness of the website's loading. I have minimised the size of my pictures. And I have been told that it is a good way to put your css files in one file after minifying all of css files to make it easy for browser to fetch them. So, I have created a dynamic way to fetch all required css files and combine them in one file for each page, my solution is : My layouts/master.blade.php

Dynamic classnames with parameters in Less mixin

ぃ、小莉子 提交于 2019-12-11 00:24:51
问题 I'm trying to create a Less mixin to generate media queries. The goal is to store my breakpoints in a variables.less file, and loop through them to create @media blocks. The mixin would then be used as: .mq-medium({ // rules }); and generate CSS like: @media only screen and (min-width: 640px) { // rules } Here's my current mixin: variables.less /* media queries */ @breakpoints: small 0, medium 640px, large 1024px, xlarge 1281px, xxlarge 1440px; mediaqueries.less .createMQClasses(@iterator:1)

How to specify a html tag on a LESS CSS nested class?

拜拜、爱过 提交于 2019-12-10 21:44:27
问题 I have a class used on an article and a section HTML5 tag. On the home: <article class="exit"> <a href="exit.php"> <figure class="box"> <img src="assets/img/projects/exit-m.jpg" alt=""> <figcaption>…</figcaption> </figure> </a> </article> On the project page: <section class="page project exit"> <div class="corner nw intro"> <figure class="box"> <img src="assets/img/projects/exit.jpg" alt=""> <figcaption>…</figcaption> </figure> </div> … Each elements with the class exit have a figure HTML5

Create dynamic less mixin setting property names

自闭症网瘾萝莉.ら 提交于 2019-12-10 21:36:31
问题 I want to create a less mixin to build up a number of margin/padding rules. I have been able to create the correct mixin for height, width, height percent and width percents. For example, .widthX (@px) when (@px > 0) and (@px =< 30) { .width(@px); .widthX(@px - 1); } .widthX (@px) when (@px >= (30 + 5)) { .width(@px); .widthX(@px - 5); } .width (@px) { (~".w@{px}") { width: ~"@{px}px"; } } This allows me to create explict widths or a series of width classes. The following will create CSS

How to configure sourceMaps for LESS using Grunt when there is more than one file in your project?

强颜欢笑 提交于 2019-12-10 21:32:13
问题 I have multiple .less files that I want processed to their matching .css with sourceMaps for each file all in the same folder as the source. How hard can that be? I have no problem in doing this directly with less but cant figure out how to do this in grunt-contrib-less as it seems to want the sourceMapFilename to be a single hard coded value. This my gruntfile: module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON("package.json"), watch: { options: { livereload: true

Get current index with LESS Recursion

谁都会走 提交于 2019-12-10 19:57:27
问题 I'm trying to make this: I have an array like this: @levels:'level_one','level_two','level_three','level_four','level_five','level_six','level_seven','level_eight'; Each of those levels also has a corresponding variable which is a colour, and match a class in the list markup of the level indicator. I'm able to loop through these easily enough to generate out the background colours for each level. I want to be able to have the heights automatically set for each item, so theoretically if I

How to target multiple directories with a single Makefile?

元气小坏坏 提交于 2019-12-10 19:38:55
问题 I'm using GNU Make to build three different editions of a static html document. I use Less as a CSS preprocessor. My directory structure looks like this: Makefile 160x600/style.less 300x250/style.less 728x90/style.less This is my Makefile: LESSC=lessc -x # use -x for debugging .PHONY: all clean all: 160x600 300x250 728x90 %.css: %.less $(LESSC) $< > $@ 160x600: 160x600/style.css 300x250: 300x250/style.css 728x90: 728x90/style.css clean: rm -f 160x600/*.css rm -f 300x250/*.css rm -f 728x90/*

Twitter Bootstrap: less compilation taking a long time

被刻印的时光 ゝ 提交于 2019-12-10 19:12:42
问题 I'm writing a simple app using Twitter Bootstrap. In my main HTML file I have the following lines: <link rel="stylesheet/less" href="/static/less/style.less"> <script src="/static/js/libs/less-1.3.0.min.js"></script> so every time I refresh the page, the whole css gets generated. This takes about 15 seconds each time, so it's a pain waiting for the page to load. I tried using SimpLESS to generate css out of the less files but the generation failed. I'll try to get that to work, but I'm also

Adding vendor prefixes with LESS mixin

爱⌒轻易说出口 提交于 2019-12-10 19:12:05
问题 I'm getting a Syntax Error for this mix-in: .vendors(@statement){ @statement; -moz-@statement; -webkit-@statement; } Any way to do this, or do mixin variables have to be on the right side of a : ? 回答1: Since Less v2 you can use the autoprefix plugin to prefix your properties, which seems to be a better alternative. The autoprefix plugin add browser prefixes leveraging the autoprefixer postprocessor. For client side compiling (in the browser) you can use -prefixfree. As already mentioned by