css-preprocessor

Sass: Using two @each lists in SCSS

本秂侑毒 提交于 2019-12-01 01:01:01
In my CSS I have to create classes that make reference to a 'hair colour' and 'hairstyle' I have written a mixin to help make my CSS writing more efficient: @mixin hair($hair, $colour) { .hair-#{$colour} .#{$hair} { background:image-url("xsppsfhair#{$hair}#{$colour}.svg") center top no-repeat, image-url("xsppsheadgrey.svg") center top no-repeat, image-url("xsppsbhair#{$hair}#{$colour}.svg") center top no-repeat; } } @include hair(spikyboy, blonde); @include hair(curlyafroboy, blonde); This produces the following CSS .hair-blonde .spikyboy { background: url('../images/xsppsfhairspikyboyblonde

Media queries with sass

断了今生、忘了曾经 提交于 2019-12-01 00:25:39
问题 I'm getting errors compiling my sass files using media query mixins. I followed several tutorials, but it won't compile. I'm using Sass 3.3.0.alpha.67 (Bleeding Edge) . Here's my code /* Included at the end */ @mixin mobile-only { @media (max-width : 320px) { @content; } } /* Included where the rest of my sass is */ body { @include mobile-only { display: none; } } I'm using scout to compile and watch for changes. Is there anything else I need to be doing? 回答1: Doesn't seem to be an issue

How to use Sass in Visual Studio 2013 [closed]

喜欢而已 提交于 2019-11-28 15:51:53
How can I use the Sass CSS preprocessor in Visual Studio 2013 ? Are there any extensions that provide support for Sass? Visual Studio 2013 Update 2 Visual Studio 2013 Update 2 has native syntax support for both SCSS and LESS files. You can create SCSS or LESS files and see syntax highlighting and intellisense for these file types. It does not however provide a method of compilation. Here's a link to the blog explaining about the new features: We added LESS in VS2013 RTM, and we now have a SASS project item and editor. SASS editor features are comparable to LESS editor, include colorization,

Can I use webpack to generate CSS and JS separately?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 04:38:06
I have: JS files that I want to bundle. LESS files that I want to compile down to CSS (resolving @imports into a single bundle). I was hoping to specify these as two separate inputs and have two separate outputs (likely via extract-text-webpack-plugin). Webpack has all the proper plugins/loaders to do compilation, but it doesn't seem to like the separation. I've seen examples of people requiring their LESS files directly from JS, such as require('./app.less'); , for no other reason than to tell webpack to include those files into the bundle. This allows you to only have a single entry point,

Can I use webpack to generate CSS and JS separately?

主宰稳场 提交于 2019-11-27 00:16:17
问题 I have: JS files that I want to bundle. LESS files that I want to compile down to CSS (resolving @imports into a single bundle). I was hoping to specify these as two separate inputs and have two separate outputs (likely via extract-text-webpack-plugin). Webpack has all the proper plugins/loaders to do compilation, but it doesn't seem to like the separation. I've seen examples of people requiring their LESS files directly from JS, such as require('./app.less'); , for no other reason than to

How to define a dynamic mixin or function name in SASS?

我与影子孤独终老i 提交于 2019-11-26 14:30:49
问题 I want to dynamically create mixins in SASS, named after each item in the list, but it doesn't seem to work. I tried this but I get an error: $event-icons: fair, concert, art-show, conference, dance-show, film, party, festival, theatre, launch @each $event-icon in $event-icons @mixin event-icon-#{$event-icon} background-position: -($event-icon-width * $i) 0 Error: Invalid CSS after "": expected expression (e.g. 1px, bold), was "#{$event-icon}" Is this usage not supported by SASS? I couldn't