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

  • Home
  • SEARCH
  • 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 8796113
In Process

The Archive Base Latest Questions

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

I am not sure if this is possible or not. But I feel like

  • 0

I am not sure if this is possible or not. But I feel like there should be a way to do this. I am using SASS and I am trying to find a way to optimize borders. I would like to be able to define my border sides sizes, type, and color all in one line.

There are instances where I have 1,2, or 3 borders. And what I would like to do is. Write something using SASS where all properties can be defined in one line. The problem is..

border-left: border-right: border-top: and border-bottom:

Are all separate selectors and I would like to combine them.

What I am thinking of doing is something like this…

SUDO CODE:

border ($top,$left,$right,$bottom, $type, $color);

#div {
    @include border(1px, 1px, 1px, 0, solid, #CCC);
}

I was thinking something along these lines would be close… but again the problem is combining all border selectors into one line so that is outputs as valid CSS.

@mixin borders {
  border:($top,$left,$right,$bottom, $type, $color);
}

Using a @mixin is all wrong, I am pretty sure of this… So any help to point me in the right direction would be much appreciated. Thanks in advance..

  • 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-13T23:32:54+00:00Added an answer on June 13, 2026 at 11:32 pm

    I was looking to do something similar and ended up with this @mixin.

    @mixin border ($style,  $sides...){
    
        @if ($style != "") {
    
            @if ($sides == "") {
    
                border: $style;
    
            } @else {
    
                @each $side in $sides {
    
                   @if ($side == 'top' or
                        $side == 'right' or
                        $side == 'bottom' or
                        $side == 'left') {
    
                        border-#{$side}: $style;
    
                    }
    
                }
    
            }
    
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not sure this is possible, but is there a way, using template programming
I'm not sure if this is possible but I'd like to be able to
I'm not sure this is possible, but is there a syntax to be used
I'm not sure if this possible but probably is fairly simple. I've made a
I'm not sure this is even possible but I know if it is, the
I'm not sure if this is possible but I want to see objects created
I'm not sure if this is possible but as I was looking for a
Not sure this is possible, but looking to write a script that would return
I'm not sure this is possible, but in ruby, you can dynamically call a
Not sure if this is possible in one Makefile alone, but I was hoping

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.