Skip to content

Commit

Permalink
fix: The font face style tag is created only once (#1090)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladitasev committed Dec 23, 2019
1 parent 586c19b commit 1a09e13
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/base/src/FontFace.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ const fontFaceCSS = `
`;

const insertFontFace = () => {
if (document.querySelector(`head>style[data-ui5-font-face]`)) {
return;
}

createStyleInHead(fontFaceCSS, { "data-ui5-font-face": "" });
};

Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/themes/List.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
box-sizing: border-box;
-webkit-text-size-adjust: none; /* To improve readability Mobile Safari automatically increases the size of small text so let's disable this */
font-size: var(--sapFontMediumSize);
font-family: var(--sapFontFamily,var(--sapFontFamily,"72","72full",Arial,Helvetica,sans-serif));
font-family: var(--sapFontFamily);
line-height: 2rem;
background-color: var(--sapList_FooterBackground);
color: var(--ui5_list_footer_text_color);
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/themes/Switch.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
min-width: 1.625rem;
padding: 0 0.125rem;
font-size: var(--sapFontSmallSize);
font-family: "72","72full",Arial,Helvetica,sans-serif;
font-family: var(--sapFontFamily);
text-transform: uppercase;
text-align: center;
color: var(--sapTextColor);
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/themes/TableCell.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:host {
display: contents;
font-family: var(--sapFontFamily,var(--sapFontFamily,"72","72full",Arial,Helvetica,sans-serif));
font-family: var(--sapFontFamily);
font-size: 0.875rem;
height: 100%;
box-sizing: border-box;
Expand Down

0 comments on commit 1a09e13

Please sign in to comment.