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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:02:55+00:00 2026-05-26T13:02:55+00:00

Here’s a CSS that I want to abstract with Less. In this case, there

  • 0

Here’s a CSS that I want to abstract with Less. In this case, there are 4 stops. But I have another class with 10 stops. How can I use variable number of arguments?

I see @arguments in the docs, but as you can notice, the syntax differs: some rules use all the arguments in a row, others group them in pairs: color-stop(x%, #y).

If you know a solution in Sass, suggest it, I can switch to it.

.action {
    background: -moz-linear-gradient(top, #6db3f2 0%, #54a3ee 50%, #3690f0 51%, #1e69de 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6db3f2), color-stop(50%,#54a3ee), color-stop(51%,#3690f0), color-stop(100%,#1e69de)); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top, #6db3f2 0%,#54a3ee 50%,#3690f0 51%,#1e69de 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, #6db3f2 0%,#54a3ee 50%,#3690f0 51%,#1e69de 100%); /* Opera11.10+ */
    background: -ms-linear-gradient(top, #6db3f2 0%,#54a3ee 50%,#3690f0 51%,#1e69de 100%); /* IE10+ */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6db3f2', endColorstr='#1e69de',GradientType=0 ); /* IE6-9 */
    background: linear-gradient(top, #6db3f2 0%,#54a3ee 50%,#3690f0 51%,#1e69de 100%); /* W3C */background: linear-gradient(top, #1e5799 0%,#2989d8 14%,#207cca 84%,#7db9e8 100%); /* W3C */
}
  • 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-05-26T13:02:56+00:00Added an answer on May 26, 2026 at 1:02 pm

    My own solution, using a modified file from bourbon project:

    _linear-gradient.scss

    @mixin linear-gradient($pos, $G1, $G2: false,
                            $G3: false, $G4: false,
                            $G5: false, $G6: false,
                            $G7: false, $G8: false,
                            $G9: false, $G10: false) {
        // Detect what type of value exists in $pos
        $pos-type: type-of(nth($pos, 1));
    
        // If $pos is missing from mixin, reassign vars and add default position
        @if ($pos-type == color) or (nth($pos, 1) == "transparent")    {
            $G10: $G9; $G9: $G8; $G8: $G7; $G7: $G6; $G6: $G5;
             $G5: $G4; $G4: $G3; $G3: $G2; $G2: $G1; $G1: $pos;
            $pos: top; // Default position
        }
    
        $usual:($G1);
        $webkit: color-stop($G1);
        @each $g in $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10 {
            @if $g != false {
                $usual: $usual + ',' + $g;
                $webkit: $webkit + ',' + color-stop($g);
            }
        }
        $usual: unquote($usual);
        $webkit: unquote($webkit);
    
        background-color: nth($G1, 1);
        background: deprecated-webkit-gradient(linear, $usual); // Safari <= 5.0
        background: -webkit-gradient(linear, $pos, $webkit); // Safari 5.1+, Chrome
        background: -webkit-linear-gradient($pos, $usual); // Safari 5.1+, Chrome
        background: -moz-linear-gradient($pos, $usual);
        background: -ms-linear-gradient($pos, $usual);
        background: -o-linear-gradient($pos, $usual);
        background: linear-gradient($pos, $usual);
    }
    

    usage (screen.sass):

    @import linear-gradient
    button.action
        +linear-gradient(top, #6db3f2 0%, #54a3ee 50%, #3690f0 51%, #1e69de 100%)
    

    How I configured Sass with django-compressor:

    STATICFILES_FINDERS = (
        'django.contrib.staticfiles.finders.FileSystemFinder',
        'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    #   'django.contrib.staticfiles.finders.DefaultStorageFinder',
        'compressor.finders.CompressorFinder',
    )
    
    INSTALLED_APPS = (
        ...
        'compressor',
    )
    
    COMPRESS = True
    COMPRESS_PRECOMPILERS = (
        ('text/sass', 'sass {infile} {outfile}'),
    )
    COMPILER_FORMATS = {
        '.sass': {
            'binary_path': 'sass',
            'arguments': '*.sass *.css'},
    }
    

    a template:

    {% load compress %}
    {% compress css %}
    <link href="{{ STATIC_URL }}css/screen.sass" rel="stylesheet" type="text/sass" media="screen,projection"/>
    {% endcompress %}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my scenario - I have an SSIS job that depends on another prior
Here is the issue I am having: I have a large query that needs
Here's a coding problem for those that like this kind of thing. Let's see
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is the css: #content ul { font-size: 12px; } I am trying this:
Here's the setup - I have a view that lists products. On that same
Here's my situation. I have a DotNetNuke application. I want to link to an
Here is a scenario: User installs .NET application that you have made. After some
Here is my code...I have two dimensional matrices A,B. I want to develop the
Here is my code (Say we have a single button on the page that

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.