This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.example.components;
|
||||
|
||||
import com.vaadin.flow.component.icon.FontIcon;
|
||||
|
||||
/**
|
||||
* Font Awesome Free icon references, mirroring the ergonomics of
|
||||
* {@code VaadinIcon.create()}. Backed by the {@code fa-*} CSS classes
|
||||
* shipped in the bundled {@code @fortawesome/fontawesome-free} package.
|
||||
*
|
||||
* <p>Font Awesome paints glyphs via {@code content: var(--fa)} on
|
||||
* {@code ::before}; the glyph-specific class (e.g. {@code fa-sun}) is what
|
||||
* defines that {@code --fa} custom property, so both the family class
|
||||
* ({@code fa-solid}) and the glyph class must be present.
|
||||
*/
|
||||
public enum Fa {
|
||||
|
||||
MOON("fa-solid", "fa-moon"),
|
||||
SUN("fa-solid", "fa-sun"),
|
||||
DASHBOARD("fa-solid", "fa-gauge-high"),
|
||||
FORM("fa-solid", "fa-rectangle-list"),
|
||||
TABLE("fa-solid", "fa-table"),
|
||||
GLOBE("fa-solid", "fa-globe"),
|
||||
SEARCH("fa-solid", "fa-magnifying-glass");
|
||||
|
||||
private final String[] classes;
|
||||
|
||||
Fa(String... classes) {
|
||||
this.classes = classes;
|
||||
}
|
||||
|
||||
public FontIcon create() {
|
||||
return new FontIcon(classes);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user