mixins

LESS '+=' a string lessjs 1.6.x

天大地大妈咪最大 提交于 2019-12-12 02:37:51
问题 is it possible to += (plus-equal) a string in LESS (less-css)? I am trying to create a loop to extend a string. In particular I am trying to create a mixin (no inline JS) that can add vendor prefixes to transform in transition-propery basic for loop // for-loop // works with two integers or a list .for(@i;@n) when (@i <= @n) {.-each(@i);} .for(@n) when not (isnumber(@n)) {.for(1;length(@n));} .for(@i;@n) when not (@i = @n) {.for(@i + 1;@n);} prop loop (duplicated for loop to resolve variable

How to use compass mixins in a project using Sass

ε祈祈猫儿з 提交于 2019-12-12 01:48:57
问题 ColorZilla's gradient editor says // needs latest Compass, add '@import "compass"' to your scss Well I've found that's not so easy. Obviously if you just throw @import "compass"; at the top of your .scss file, Sass won't compile because _compass.scss can't be found. This is an asp.net project utilizing Sass. In addition, I have to use the sass ruby gem to compile, not compass's compiler. I've installed the compass gem. I've followed the instructions on http://compass-style.org/install/. I've

The best way to share the same functionality in Backbone

夙愿已清 提交于 2019-12-12 01:37:12
问题 I am in the current situation: for a Backbone.Collection (but it should be also for a Backbone.Model ), I extend the class in this way(1). The functionality I want to share are the following: 1) startPolling and stopPolling should be public method accessible from all Backbone.Collections and eventually Backbone.Models 2) executePolling and onFetch should be private method. What is the best way to share startPolling and stopPolling between all Backbone.Collection/Backbone.Model keeping

Spring AOP, declare-parents cast exception

余生颓废 提交于 2019-12-11 23:54:17
问题 I have: an interface GenericDao a class GenericDaoImpl implements GenericDao a class UserDao What I want to do is: UserDao userDao; public void setUserDao(UserDao val) { userDao = val; } ... ((GenericDao) userDao).update(user); My Beans.xml looks like: <bean id="genericUserDao" class="dao.GenericDaoImpl"> ... <property name="sessionFactory" ref="hibernateSessionFactory" /> </bean> <bean id="userDao" class="dao.user.UserDao"> <property name="sessionFactory" ref="hibernateSessionFactory" /> <

Less - parametric mixin with shorthand numeric and or string values, with rem and px fallback

谁说我不能喝 提交于 2019-12-11 18:49:48
问题 Using Less, I'm trying output css combination shorthand values for properties, whilst detecting the type of a value passed as a variable depending on how many values are passed as variables. one value @v1 two values @v1 and @v2 four values @v1 , @v2 , @v3 and @v4 And for each variable detected, check if is is a number greater than 0, and if so output a rem and px value for each property value, so the complied css might be something like: .demobox{ border-width: 10px 20px 0 0; border-width:

Mixing “trait bundles”

只谈情不闲聊 提交于 2019-12-11 14:07:49
问题 I'm trying to make "trait bundles" that I can mix together, which mix traits contained within them. The following approach doesn't seem to work. Can you suggest an approach that can work? trait GraphTypes { trait Node { def size: Double } } trait HasBigAndSmallNodes extends GraphTypes { trait BigNode extends super.Node { override def size = 5.00 } trait SmallNode extends super.Node { override def size = 0.05 } } trait NodesHaveHappiness extends GraphTypes { trait Node extends super.Node { def

less.js guards and conditionals

末鹿安然 提交于 2019-12-11 12:15:57
问题 I have the following less mixin: @myColor = #123456; .mixin(@a) when (@a = @myColor){ // do something } This however throws this error: Unable to perform comparison Why is that? 回答1: It would appear (as of lesscss 1.2.2) that guards only support comparing Dimensions and Keywords. (search the source for "compare:") So, sadly, comparing two colors or strings just won't work. 回答2: UPDATE : Four thoughts (again, I don't have experience with LESS itself, I'm just looking at documentation). Is the

Register Jackson MixIn in JavaEE application

心已入冬 提交于 2019-12-11 09:32:00
问题 On the basis of this setup (using Jackson as JAXB-provider in a JavaEE application): How can I register my MixIn modules? In my client application using the JAX-RS client feature it is registered automatically. I've seen this SO post, but where do I get the ObjectMapper from? I've tried to create on in my ServletContextListener and register the module there. But of course the mapper instance will be disposed after the contextInitialized method ends. 回答1: Use a ContextResolver as seen in this

How to make a Sass mixin declare a non-nested selector on base level?

给你一囗甜甜゛ 提交于 2019-12-11 07:18:28
问题 Sorry for the weird language on the question, but I don't know how to describe it any better. I hope this example makes clear what I want: scss-syntax .my-smug-selector { @include my-smug-mixin(30px); } desired css-output .my-smug-selector{ // some styles } .another-smug-selector-on-base-lvl{ // some other styles } .smug-non-nested-selector{ // some other styles } I'm interested in this in general, but to explain why in the world I would want to do this: I want to have a keyframe-animation

LESS: mixin to create Blink animation, passing @color -stops

别说谁变了你拦得住时间么 提交于 2019-12-11 07:15:40
问题 I wish to create a CSS animation that act like "Blink effect" using LESS. My purpose is to call a single mixin passing each time 2 @stop colors in order to get diffent color blink depending by css class of DOM element. Currently I have the following HTML: <p class='blink'> Loading... </p> <p class='blink alert'> <big>WARNING!!!! Operation failed.</big> </p> And here, LESS CODE: .blink { .animation-blink-mixin(@dark-green,@light-green); &.alert { .animation-blink-mixin(@dark-red,@light-red); }