Skip to content

Commit

Permalink
chore: set body1 as default variant; restore default margin
Browse files Browse the repository at this point in the history
  • Loading branch information
sensasi-delight committed Jun 25, 2024
1 parent 576b9ff commit 083fda8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Components/Typography.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class Typography extends Component
*/
public function __construct(
private bool $disableGutter = false,
string $variant = 'body1',
?string $element = null,
?string $slot = null,
?string $variant = null
) {
[$elementTemp, $variant] = $this->variantPreprocess($variant);

Expand Down Expand Up @@ -60,11 +60,10 @@ public function variantPreprocess(?string $variant)

public function attributesPreprocess(ComponentAttributeBag $attributes)
{
return $attributes->style([
'margin: 0',
'margin-bottom: 0.35em' => !$this->disableGutter
])->class([
'mdc-typography' . ($this->variant ? '--' . $this->variant : null)
return $attributes->class([
'mdc-typography',
'mdc-typography--' . $this->variant,
'mbc-m-0' => $this->disableGutter,
]);
}
}

0 comments on commit 083fda8

Please sign in to comment.