mixins

Scss compiler error: no mixin named transition

不打扰是莪最后的温柔 提交于 2019-12-20 04:08:05
问题 I have a meteor app which uses bower components. When I try to run the app I got an error: Scss compiler error: no mixin named transition which comes from the line of: @include transition(.2s ease-out); What could be cause of this problem? 回答1: @include expects a mixin. In this case it is expecting a mixin named 'transition' and I think you are trying to apply 'transition' as a css property. Check this page out: http://sass-lang.com/guide 来源: https://stackoverflow.com/questions/35482388/scss

LESS: Loop using data stored in an array (or something similar)

帅比萌擦擦* 提交于 2019-12-20 02:36:10
问题 I found this example in LESS documentation: LESS: .generate-columns(4); .generate-columns(@n, @i: 1) when (@i =< @n) { .column-@{i} { width: (@i * 100% / @n); } .generate-columns(@n, (@i + 1)); } OUTPUT CSS: .column-1 { width: 25%; } .column-2 { width: 50%; } .column-3 { width: 75%; } .column-4 { width: 100%; } This loop generates 4 different divs because '4' was the value passed by firs mixin's call, but generated values are entirely calculated inside mixin. In other words, @n implicitly

LESS CSS - Change variable value for theme colors depending on body class

房东的猫 提交于 2019-12-18 11:35:28
问题 Getting to grips with LESS here but one thing is still a little unclear. Lets say I have multiple color themes for my website, controlled by a class on the body tag. From this I can redefine the various colors for each element within each theme. Easy enough but fairly time consuming if I have a lot of elements to change... and a lot of themes. Every time I add a new theme I need to write out all the selectors again, with different color values. I am basing my working so far on another post I

Can a sass @mixin accept an undefined number of arguments?

若如初见. 提交于 2019-12-18 11:02:11
问题 I'm trying to create a sass mixin for transitions. This is what I have so far. @mixin transition($var) -webkit-transition: $var transition: $var I want to be able to pass it multiple arguments like this @include transition(color .5s linear, width .5s linear) Unfortunately, I get the following error Syntax error: Mixin transition takes 1 argument but 2 were passed. Is there a way to do this so it produces the following output in css while still accepting an undefined number of arguments?

Semantic Grid with Bootstrap + LESS Mixins ¿ HOW?

被刻印的时光 ゝ 提交于 2019-12-18 10:57:28
问题 Twitter bootstrap documentation talks about three mixins to generate grid systems: .container-fixed(); #grid > .core(); #grid > .fluid(); I know how to setup the page to use bootstrap and less... But I don't know how to use the grid system semantically. The documentation says what mixins to use but not how... ¿ Could anyone ilustrate how to use them in order to create semantic grids ? Just to figure out or to see how it works :S Thank you !! 回答1: In navbar.less of bootstrap you will find the

Does Objective-C support Mixin like Ruby?

落花浮王杯 提交于 2019-12-18 10:50:38
问题 In Ruby, there's Modules and you can extend a class by "mixing-in" the module. module MyModule def printone print "one" end end class MyClass include MyModule end theOne = MyClass.new theOne.printone >> one In Objective-C, I find that I have a set of common methods that I want a number of Class to "inherit". What other ways can I achieve this without creating a common class and deriving all from that common class? 回答1: Edit : changes added because some people feel I am responsible for the

When to use mixins and when to use interfaces in Dart?

橙三吉。 提交于 2019-12-18 10:39:28
问题 I'm very familiar with the concepts of interfaces and abstract classes, but not super familiar with the concepts of mixins . Right now, in Dart, every class A defines an implicit interface, which can be implemented by another class B by using the implements keyword. There's no explicit way of declaring interfaces as, for example, in Java, where an interface contains only unimplemented methods (and eventually static variables). In Dart, since interfaces are defined by classes, the methods of

Mixins with C# 4.0

半世苍凉 提交于 2019-12-17 22:08:51
问题 I've seen various questions regarding if mixins can be created in C# and they are often directed to the re-mix project on codeplex. However, I don't know if I like the "complete interface" concept. Ideally, I would extend a class like so: [Taggable] public class MyClass { .... } By simply adding the Taggable interface, I can create objects of type MyClass via some kind of object factory. The returned instance would have all the members defined in MyClass as well as all members provided by

Mixin vs inheritance

大城市里の小女人 提交于 2019-12-17 15:26:47
问题 What is the difference between a mixin and inheritance? 回答1: A Mix in is typically used with multiple inheritance. So, in that sense, there's "no difference". The detail is that a Mix in is rarely useful as a standalone object. For example, say you have a Mix In name "ColorAndDimension", which adds a color property and width and height. Now, you could add ColorAndDimension to a, say, Shape Class, a Sprite Class, a Car Class, etc. And they will all have the same interface (say get/setColor,

Skipping an optional argument in Sass mixin

孤街醉人 提交于 2019-12-17 06:11:47
问题 I have this mixin to handle a simple CSS3 linear gradient: @mixin linear-gradient($from, $to, $dir: bottom, $dir-webkit: top, $ie-filters: false) { background-color: $to; background-image: -webkit-linear-gradient($dir-webkit, $from, $to); background-image: linear-gradient(to $dir, $from, $to); @if $ie-filters == true and $old-ie { filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($from)}', endColorstr='#{ie-hex-str($to)}'); } } $dir is short for 'direction'. If I