0

I Have Variable $direction , $left , $direction

$direction == rtl ;
$left:left; 
$right:right;

@if($direction == rtl){
   $left : right;
   $right : left;
}

I Want Change In

@include border-right-radius(0);

as

@include border-#{$right}-radius(0);

I See Error

I Want Get Result as

@include border-left-radius(0);

I Know i Can Use

@if($direction == rtl){
   @include border-left-radius(0);
}@else{
   @include border-right-radius(0);
}

notes in url How to define a dynamic mixin or function name in SASS? he want create dynamically mixins , put i want retrieve dynamically mixins

Update I have change in mixins function and retrieve as static mixins , It seems more logical And a shortcut to time

xpredo
  • 1,282
  • 17
  • 27
  • Do you want to concatenate a string as a SASS @include function name? – Alexis Philip Sep 09 '19 at 13:33
  • yes alexis i want reslut @include border-left-radius(0); – xpredo Sep 09 '19 at 13:38
  • 1
    Possible duplicate of [How to define a dynamic mixin or function name in SASS?](https://stackoverflow.com/questions/15748937/how-to-define-a-dynamic-mixin-or-function-name-in-sass) – ReSedano Sep 09 '19 at 14:25
  • @ReSedano notes i url he want create dynamically mixins , put i want retrieve dynamically mixins – xpredo Sep 09 '19 at 16:53
  • @HosamElzagh Sure, I noticed that, but my comment don't change: you can't use interpolation with a mixin. That answer is very clear about that and also provides an explanation link where you can find every information about how you can use interpolation: https://sass-lang.com/documentation/interpolation. So for me this is a duplicate 'cause the answer you are looking for is the same: you can't do this. I'm sorry ;-) – ReSedano Sep 09 '19 at 20:06
  • @ReSedano thanks for replay , I have change in mixins function and retrieve as static mixins , It seems more logical And a shortcut to time – xpredo Sep 10 '19 at 07:16

0 Answers0