Hey everyone,
I have tried all the solutions offered in this community, still couldn’t get Font Awesome to show up on my app. I have tried various FontAwesome versions (4 and 5) and tried to load the stylesheet in different ways. Still, it doesn’t show the fonts. Here is my current stylesheet call:
external_style = ['https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css']
#https://use.fontawesome.com/releases/v5.8.2/css/all.css
app = dash.Dash(__name__, suppress_callback_exceptions=True,
external_stylesheets=[dbc.themes.BOOTSTRAP, external_style],
meta_tags=[{'name': 'viewport',
'content': 'width=device-width, initial-scale=1.0'}]
)
server = app.server
BTW, this is a function that other apps are calling, which looks like this:
import dash_bootstrap_components as dbc
import dash_html_components as html
def app_page_template(data):
PAGE_HEADER_STYLE = {
"background-image": data["BackImg"],
"background-repeat": "no-repeat",
"background-size": "cover",
"background-position": "center",
"width": "100%",
"height": "200px",
"max-width": "100%",
}
PAGE_CONTENT_STYLE = {
"margin-left": "0px",
"padding": "0.5rem 3rem",
"text-justify": "center",
}
# Creating badges
KeyWords = []
for X in data["AppKeys"]:
KeyWords.append(dbc.Badge(X, className="mr-2 badge badge-dark"))
# Final Layout of the page
layout = html.Div([
# App top image
dbc.Row(
html.Div(style=PAGE_HEADER_STYLE),
no_gutters=True),
html.I(id='submit-button', n_clicks=0, className='fa fa-send'),
html.Div([
html.I(className="fas fa-home"),
]),
html.Div([
# App title
html.H3(data["AppTitle"], className="text-center"),
# App short description
html.P(data["AppDesc"]),
# App paper or other relevant doc
html.P(data["AppPaper"], style={"font-style": "italic"}),
# App keywords
html.Span(KeyWords),
# App usage direction for academics and industry
html.P(data["AppUse"]),
# App citations in two format
dbc.Toast([
html.P(data["AppCite"]["normal"], style={"font-style": "italic"}),
html.Code(data["AppCite"]["bibtex"])
], header="Citation"),
], style=PAGE_CONTENT_STYLE)
], style={"overflow": "hidden"})
return layout
Every other component is showing correctly, but no font awesome. Anyone can help, please?