| 1 |
<?php |
| 2 |
namespace Depicter\Document\Models\Common\Styles; |
| 3 |
|
| 4 |
|
| 5 |
use Depicter\Document\CSS\Breakpoints; |
| 6 |
|
| 7 |
class Svg extends States |
| 8 |
{ |
| 9 |
|
| 10 |
public function set( $css ) { |
| 11 |
$devices = Breakpoints::names(); |
| 12 |
foreach ( $devices as $device ) { |
| 13 |
if ( !empty( $this->{$device}->fill ) ) { |
| 14 |
$css[ $device ][ 'fill' ] = $this->{$device}->fill; |
| 15 |
} |
| 16 |
|
| 17 |
if ( !empty( $this->{$device}->stroke ) ) { |
| 18 |
$css[ $device ][ 'stroke' ] = $this->{$device}->stroke; |
| 19 |
} |
| 20 |
|
| 21 |
if ( !empty( $this->{$device}->strokeWidth ) ) { |
| 22 |
$css[ $device ][ 'stroke-width' ] = $this->{$device}->strokeWidth->value . $this->{$device}->strokeWidth->unit; |
| 23 |
} |
| 24 |
|
| 25 |
if ( !empty( $this->{$device}->color ) ) { |
| 26 |
$css[ $device ][ 'color' ] = $this->{$device}->color; |
| 27 |
} |
| 28 |
|
| 29 |
if ( !empty( $this->{$device}->stopColor ) ) { |
| 30 |
$css[ $device ][ 'stop-color' ] = $this->{$device}->stopColor; |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
return $css; |
| 35 |
} |
| 36 |
} |
| 37 |
|