Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:13:36+00:00 2026-06-14T18:13:36+00:00

LESS allows parametric mixins, such as: .transition(@property, @duration){ transition: @property @duration; -moz-transition: @property @duration;

  • 0

LESS allows parametric mixins, such as:

.transition(@property, @duration){
    transition:         @property @duration;
    -moz-transition:    @property @duration; /* Firefox 4 */
    -webkit-transition: @property @duration; /* Safari and Chrome */
    -o-transition:      @property @duration; /* Opera */
}

However, this doesn’t always work with properties such as transitions. If you are trying to have multiple transitions and attempt to call the mixin multiple times, the last mixin overrides all previously defined transitions. That’s because the proper CSS3 syntax for defining multiple transitions is:

... {
    transition: @property1 @duration1, @property2 @duration2, ...;
}

The only way that I can think of to define multiple transitions as mixins is to overload the mixin:

.transition(@property, @duration){...}
.transition(@property, @duration, @prop2, @dur2){...}
.transition(@property, @duration, @prop2, @dur2, @prop3, @dur3){...}

Is there a more robust and concise way of defining the transition mixin to take in a variable number of arguments and construct the appropriate transition CSS?

Context: Sometimes I’d like to transition on multiple properties; for example, a :hover might trigger transitions on background color, box-shadow, text-color, etc…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:13:38+00:00Added an answer on June 14, 2026 at 6:13 pm

    See my answer here: Multiple properties are getting treated as separate arguments in mixins

    Summary: use this mixin for variable number of arguments:

    .transition (@value1,@value2:X,...)
    {
        @value: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`;
    
        -webkit-transition: @value;
        -moz-transition: @value;
        -ms-transition: @value;
        -o-transition: @value;
        transition: @value;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My website allows uploading of images. I limit images to 10 megapixel or less
I'm exposing a more or less public API that allows the user to query
I was hoping to create LESS mixin for border-radius that allows for two parameters
XCode 4.5 only allows armv7. I'm happy with that change, as it takes less
Since LESS is a pre-compile stylesheet language, this may not achieve what I'm after,
The title more or less says it all. I create a widget, add it
I know more or less how to do this, but I think I'm getting
Possible Duplicate: Sleep Less Than One Millisecond How can I make a program sleep
I am more or less wondering how time() is implemented in the C standard
I am using less php and want to implement an uncompiled version of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.