added icon sharp feature

This commit is contained in:
Cüneyt Şentürk 2023-04-20 17:42:44 +03:00
parent c4bbad2c7e
commit 2534d28dca
2 changed files with 8 additions and 3 deletions

View File

@ -19,6 +19,9 @@ class Icon extends Component
/** @var bool */
public $rounded;
/** @var bool */
public $sharp;
/** @var bool */
public $simpleIcons;
@ -35,13 +38,14 @@ class Icon extends Component
*/
public function __construct(
string $icon = '', string $class = '',
bool $filled = false, bool $rounded = false,
bool $filled = false, bool $rounded = false, bool $sharp = false,
bool $simpleIcons = false, bool $custom = false, string $alias = ''
) {
$this->icon = $icon;
$this->class = ($simpleIcons) ? 'w-8 h-8 ' . $class : $class;
$this->filled = $filled;
$this->rounded = $rounded;
$this->sharp = $sharp;
$this->simpleIcons = $simpleIcons;
$this->custom = $custom;
$this->alias = $alias;

View File

@ -9,10 +9,11 @@
@else
<span
@class([
'material-icons-outlined' => (! $filled && ! $rounded),
'material-icons-outlined' => (! $filled && ! $rounded && ! $sharp),
$class,
'material-icons' => $filled,
'material-icons-round' => $rounded,
'material-icons-sharp'=> $sharp,
])
{{ $attributes }}
>{{ $icon }}</span>