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 8739153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:52:32+00:00 2026-06-13T10:52:32+00:00

I use a mixin for linear-gradient like this: .linear-gradient (@color1:#ccc, @color2:#fff, @stop1:0, @stop2:100%, @dir:top)

  • 0

I use a mixin for linear-gradient like this:

.linear-gradient (@color1:#ccc, @color2:#fff, @stop1:0, @stop2:100%, @dir:top) {
    background-color: @color2;
    background: -webkit-linear-gradient(@dir, @color1 @stop1, @color2 @stop2);
    background:    -moz-linear-gradient(@dir, @color1 @stop1, @color2 @stop2);
    background:     -ms-linear-gradient(@dir, @color1 @stop1, @color2 @stop2);
    background:      -o-linear-gradient(@dir, @color1 @stop1, @color2 @stop2);
    background:         linear-gradient(@dir, @color1 @stop1, @color2 @stop2);
    filter: e(%       ("progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=%d,endColorstr=%d)", @color1, @color2));
}

It’s worked well so far.. but after w3c publish a new correct direction for gradients and Mozilla update FireFox to 16.0.1 – I can’t use this mixin because FireFox 16 use linear-gradients without prefix -moz.

Now I can’t use .linear-gradient(#ffffff, #000000, 0, 100%, top) because top – not correct direction, now correct linear gradient from top to bottom is to bottom.

0deg, 90deg — doesn’t work cross browsers, because in all browsers 90deg it’s direction from bottom to top, but in FireFox 16 it’s from right to left.

About new directions https://hacks.mozilla.org/2012/07/aurora-16-is-out/

Got any ideas?

  • 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-13T10:52:33+00:00Added an answer on June 13, 2026 at 10:52 am

    Using a local variable and adding 90 degrees for browsers that do not yet support the new orientation should do the trick:

    (It was only in jsFiddle that the operation on degrees didn’t work).

    .linear-gradient(@color1:#ccc, @color2:#fff, @stop1:0, @stop2:100%, @deg:0deg) {
      @old-deg: @deg + 90deg;
      background-color: @color2;
      background: -webkit-linear-gradient(@old-deg, @color1 @stop1, @color2 @stop2);
      background:    -moz-linear-gradient(@old-deg, @color1 @stop1, @color2 @stop2);
      background:     -ms-linear-gradient(@old-deg, @color1 @stop1, @color2 @stop2);
      background:      -o-linear-gradient(@old-deg, @color1 @stop1, @color2 @stop2);
      background:         linear-gradient(@deg, @color1 @stop1, @color2 @stop2);
      filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#000000')";
    }
    
    .test {
      width:100px;
      height:100px;
      .linear-gradient(#000, #ff0, 0, 100%, 0deg);
    }
    

    (Note that I changed the escape syntax on the IE line).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to use a Mixin to always add some init functionality to my
I'm using a dotLess 'mixin' like this: .base-button-style { ... } .specific-button-style { .base-button-style;
If I'm using compass for CSS and use a function or mixin like: @include
Use of gradient images is very common among developers for styling a page. Gradient
I'm trying to write my first mixin for use across different backbone projects, and
I am having trouble creating a simple mixin that i plan to use on
In Scala, I'd like to be able to write generic classes which use operators
I want to mixin a trait so that I can use a method from
I have a service that returns a lovely svg gradient for use in IE,
I'm reading about the mixin pattern in javascript and I encountered this piece of

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.