css - Create box-shadow to drop-shadow mixin -


i'm trying write mixin should take argument css box-shadow , convert filter: drop-shadow().

// mixin drop-shadow($shadows)   $array = split(',', $shadows)   $dropshadows = ()    $shadow in $array     push($dropshadows, 'drop-shadow(' + $shadow + ')')     filter: unquote(join(' ', $dropshadows))  // usage body   drop-shadow: 0 0 1px, 0 0 1px 

the problem must pass value of drop-shadow string make work, if pass array, doesn't...

// works drop-shadow: '0 0 1px, 0 0 1px'  // doesn't work drop-shadow: 0 0 1px, 0 0 1px 

ok, found solution:

// custom property (mixin) allows define box-shadow // rendered `filter: drop-shadow()` // // usage: // drop-shadow: 2px 0 1px rgba(0,0,0,0.5) // => filter: drop-shadow(2px 0 1px rgba(0,0,0,0.5))  drop-shadow()   $array = arguments   $dropshadows = ()    $shadow in $array     push($dropshadows, 'drop-shadow(' + $shadow + ')')    filter: unquote(join(' ', $dropshadows)) 

this accept rgb(a) or hsl(a) colors , works box-shadow


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -