aria-expanded="false"
>
{icon size=32 name='info' type='solid'}
- {icon size=32 name='bell' type='regular'}
+ {icon size=32 name='bell'}
<span class="icon icon32 fa-bell-o"></span>
{icon size=32 name='500px' type='brand'}
<span>{lang}wcf.user.notification.notifications{/lang}</span>{if $__wcf->getUserNotificationHandler()->getNotificationCount()} <span class="badge badgeUpdate">{#$__wcf->getUserNotificationHandler()->getNotificationCount()}</span>{/if}
}
}
- setIcon(name: string, type: "regular" | "solid"): void {
+ setIcon(name: string, type: "" | "solid"): void {
const metadata = window.getFontAwesome6IconMetadata(name);
if (metadata === undefined) {
throw new TypeError(`The icon '${name}' is unknown or unsupported.`);
}
this.solid = type === "solid";
- this.regular = type === "regular";
this.name = name;
const root = this.shadowRoot!;
}
}
- get regular(): boolean {
- return this.hasAttribute("regular");
- }
-
- set regular(regular: boolean) {
- if (regular) {
- this.setAttribute("regular", "");
- } else {
- this.removeAttribute("regular");
- }
- }
-
get name(): string {
return this.getAttribute("name") || "";
}
throw new Error(`The icon '${name}' does not support the style '${type}'.`);
}
this.solid = type === "solid";
- this.regular = type === "regular";
this.name = name;
const root = this.shadowRoot;
(_a = root.childNodes[0]) === null || _a === void 0 ? void 0 : _a.remove();
this.removeAttribute("solid");
}
}
- get regular() {
- return this.hasAttribute("regular");
- }
- set regular(regular) {
- if (regular) {
- this.setAttribute("regular", "");
- }
- else {
- this.removeAttribute("regular");
- }
- }
get name() {
return this.getAttribute("name") || "";
}
{
private const SIZES = [16, 24, 32, 48, 64, 96, 128, 144];
- private const TYPES = ['brand', 'regular', 'solid'];
+ private const TYPES = ['brand', 'solid'];
/**
* @inheritDoc
throw new \InvalidArgumentException("The `name` attribute must be present and non-empty.");
}
- if ($type === '') {
- throw new \InvalidArgumentException("The `type` attribute must be present and non-empty.");
- } else if (!\in_array($type, self::TYPES)) {
+ if ($type !== '' && !\in_array($type, self::TYPES)) {
throw new \InvalidArgumentException("An unsupported type `${type}` was specified.");
}
HTML;
}
+ $modifier = '';
+ if ($type === 'solid') {
+ $modifier = ' solid';
+ }
+
return <<<HTML
- <fa-icon size="{$size}" name="{$name}" {$type}></fa-icon>
+ <fa-icon size="{$size}" name="{$name}"{$modifier}></fa-icon>
HTML;
}
}
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
- font-family: "Font Awesome 6 Free";
+ font-family: var(--fa-font-family, "Font Awesome 6 Free");
font-size: var(--font-size);
font-style: normal;
font-variant: normal;
+ font-weight: var(--fa-font-weight, 400);
line-height: 1;
text-rendering: auto;
&[solid] {
font-weight: 900;
}
-
- &[regular] {
- font-weight: 400;
- }
}
/* Default icon sizes */