From 343f614ce8a7311dca6bf17f900e30b5fd8025df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Fredrik=20Ki=C3=A6r?= <31612826+anders-kiaer@users.noreply.github.com> Date: Wed, 5 Feb 2020 15:23:12 +0100 Subject: [PATCH] Use official font CDN (#26) --- setup.py | 4 +- webviz_config_equinor/__init__.py | 11 ++- .../assets/equinor_fonts.css | 87 ------------------- .../assets/equinor_local.css | 2 +- .../assets/equinor_logo_primary.svg | 27 ------ 5 files changed, 12 insertions(+), 119 deletions(-) delete mode 100644 webviz_config_equinor/assets/equinor_fonts.css delete mode 100644 webviz_config_equinor/assets/equinor_logo_primary.svg diff --git a/setup.py b/setup.py index e1a18ee..4a357c5 100644 --- a/setup.py +++ b/setup.py @@ -17,9 +17,7 @@ entry_points={ "webviz_config_themes": ["equinor_theme = webviz_config_equinor:equinor_theme"] }, - install_requires=[ - 'webviz-config>=0.0.23' - ], + install_requires=["webviz-config>=0.0.23"], tests_require=tests_require, extras_require={"tests": tests_require}, setup_requires=["setuptools_scm~=3.2"], diff --git a/webviz_config_equinor/__init__.py b/webviz_config_equinor/__init__.py index d06a08e..ecd2be5 100644 --- a/webviz_config_equinor/__init__.py +++ b/webviz_config_equinor/__init__.py @@ -13,8 +13,17 @@ equinor_theme = WebvizConfigTheme(theme_name="equinor") +equinor_theme.external_stylesheets = [ + "https://eds-static.equinor.com/font/equinor-font.css" +] + equinor_theme.adjust_csp( - {"font-src": ["https://webviz-cdn.azureedge.net"],} + { + "font-src": ["https://eds-static.equinor.com"], + "img-src": ["https://eds-static.equinor.com"], + "style-src": ["https://eds-static.equinor.com"], + }, + append=True, ) equinor_theme.assets = glob.glob( diff --git a/webviz_config_equinor/assets/equinor_fonts.css b/webviz_config_equinor/assets/equinor_fonts.css deleted file mode 100644 index c5682df..0000000 --- a/webviz_config_equinor/assets/equinor_fonts.css +++ /dev/null @@ -1,87 +0,0 @@ -/** -================================================================== -EQUINOR - -Font-weights: -- 300 (light) -- 400 (regular) -- 500 (medium) -- 700 (bold) - -Font-styles: -- normal -- italic -================================================================== -*/ - -@font-face { - font-family: Equinor; - src: - url(https://webviz-cdn.azureedge.net/fonts/equinor-light/Equinor-Light.woff2) format('woff2'), - url(https://webviz-cdn.azureedge.net/fonts/equinor-light/Equinor-Light.woff) format('woff'); - font-style: normal; - font-weight: 300; -} - -@font-face { - font-family: Equinor; - src: - url(https://webviz-cdn.azureedge.net/fonts/equinor-regular/Equinor-Regular.woff2) format('woff2'), - url(https://webviz-cdn.azureedge.net/fonts/equinor-regular/Equinor-Regular.woff) format('woff'); - font-style: normal; - font-weight: 400; -} - -@font-face { - font-family: Equinor; - src: - url(https://webviz-cdn.azureedge.net/fonts/equinor-medium/Equinor-Medium.woff2) format('woff2'), - url(https://webviz-cdn.azureedge.net/fonts/equinor-medium/Equinor-Medium.woff) format('woff'); - font-style: normal; - font-weight: 500; -} - -@font-face { - font-family: Equinor; - src: - url(https://webviz-cdn.azureedge.net/fonts/equinor-bold/Equinor-Bold.woff2) format('woff2'), - url(https://webviz-cdn.azureedge.net/fonts/equinor-bold/Equinor-Bold.woff) format('woff'); - font-style: normal; - font-weight: 700; -} - -@font-face { - font-family: Equinor; - src: - url(https://webviz-cdn.azureedge.net/fonts/equinor-lightitalic/Equinor-LightItalic.woff2) format('woff2'), - url(https://webviz-cdn.azureedge.net/fonts/equinor-lightitalic/Equinor-LightItalic.woff) format('woff'); - font-style: italic; - font-weight: 300; -} - -@font-face { - font-family: Equinor; - src: - url(https://webviz-cdn.azureedge.net/fonts/equinor-italic/Equinor-Italic.woff2) format('woff2'), - url(https://webviz-cdn.azureedge.net/fonts/equinor-italic/Equinor-Italic.woff) format('woff'); - font-style: italic; - font-weight: 400; -} - -@font-face { - font-family: Equinor; - src: - url(https://webviz-cdn.azureedge.net/fonts/equinor-mediumitalic/Equinor-MediumItalic.woff2) format('woff2'), - url(https://webviz-cdn.azureedge.net/fonts/equinor-mediumitalic/Equinor-MediumItalic.woff) format('woff'); - font-style: italic; - font-weight: 500; -} - -@font-face { - font-family: Equinor; - src: - url(https://webviz-cdn.azureedge.net/fonts/equinor-bolditalic/Equinor-BoldItalic.woff2) format('woff2'), - url(https://webviz-cdn.azureedge.net/fonts/equinor-bolditalic/Equinor-BoldItalic.woff) format('woff'); - font-style: italic; - font-weight: 700; -} diff --git a/webviz_config_equinor/assets/equinor_local.css b/webviz_config_equinor/assets/equinor_local.css index 0990e8c..68672fa 100644 --- a/webviz_config_equinor/assets/equinor_local.css +++ b/webviz_config_equinor/assets/equinor_local.css @@ -24,7 +24,7 @@ h1, h2, h3, h4, h5, h6, p, a, div, button { height: 100px; width: 200px; background-size: contain; - background-image: url("./equinor_logo_primary.svg#red"); + background-image: url("https://eds-static.equinor.com/logo/equinor-logo-primary.svg#red"); background-repeat: no-repeat; } diff --git a/webviz_config_equinor/assets/equinor_logo_primary.svg b/webviz_config_equinor/assets/equinor_logo_primary.svg deleted file mode 100644 index 20a186e..0000000 --- a/webviz_config_equinor/assets/equinor_logo_primary.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - -