From d3e48d88fbedc02c837414fba42bde1622d12c72 Mon Sep 17 00:00:00 2001 From: Michael Fix Date: Sat, 15 Aug 2020 10:52:36 -0700 Subject: [PATCH] Clean up Fonts.js (#1080) * fix issue 1078 * update integration test oo --- components/style/Font.js | 39 -------------------------------- cypress/integration/gist.spec.js | 4 ++-- 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/components/style/Font.js b/components/style/Font.js index 82f5adf..53ce8a6 100644 --- a/components/style/Font.js +++ b/components/style/Font.js @@ -13,8 +13,6 @@ export default () => ( font-display: swap; src: url('//cdn.jsdelivr.net/npm/@typopro/web-iosevka@3.7.5/TypoPRO-iosevka-term-bold.woff') format('woff'); - font-weight: 400; - font-style: normal; } @font-face { @@ -24,8 +22,6 @@ export default () => ( format('woff2'), url('//cdn.jsdelivr.net/npm/@typopro/web-monoid@3.7.5/TypoPRO-Monoid-Regular.woff') format('woff'); - font-weight: 400; - font-style: normal; } @font-face { @@ -35,8 +31,6 @@ export default () => ( format('woff2'), url('//cdn.jsdelivr.net/npm/@typopro/web-fantasque-sans-mono@3.7.5/TypoPRO-FantasqueSansMono-Regular.woff') format('woff'); - font-weight: 400; - font-style: normal; } @font-face { @@ -46,8 +40,6 @@ export default () => ( format('woff2'), url('//cdn.jsdelivr.net/font-hack/2.020/fonts/woff/hack-regular-webfont.woff?v=2.020') format('woff'); - font-weight: 400; - font-style: normal; } @font-face { @@ -57,15 +49,11 @@ export default () => ( format('woff2'), url('//cdn.rawgit.com/tonsky/FiraCode/1.204/distr/woff/FiraCode-Regular.woff') format('woff'); - font-weight: 400; - font-style: normal; } @font-face { font-family: 'JetBrains Mono'; font-display: swap; - font-style: normal; - font-weight: 400; src: url('//cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff2/JetBrainsMono-Regular.woff2') format('woff2'), url('//cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff/JetBrainsMono-Regular.woff') @@ -80,87 +68,60 @@ export default () => ( src: local('IBM Plex Mono Medium Italic'), local('IBMPlexMono-MediumItalic'), url(https://fonts.gstatic.com/s/ibmplexmono/v2/-F6sfjptAgt5VM-kVkqdyU8n1ioSJlR1gMoQPttozw.woff2) format('woff2'); - unicode-range: U + 0000-00ff, U + 0131, U + 0152-0153, U + 02bb-02bc, U + 02c6, U + 02da, - U + 02dc, U + 2000-206f, U + 2074, U + 20ac, U + 2122, U + 2191, U + 2193, U + 2212, - U + 2215, U + FEFF, U + FFFD; } /* latin */ @font-face { font-family: 'Anonymous Pro'; font-display: swap; - font-style: normal; - font-weight: 400; src: local('Anonymous Pro Regular'), local('AnonymousPro-Regular'), url(//fonts.gstatic.com/s/anonymouspro/v11/Zhfjj_gat3waL4JSju74E3n3cbdKJftHIk87C9ihfO8.woff2) format('woff2'); - unicode-range: U + 0000-00ff, U + 0131, U + 0152-0153, U + 02bb-02bc, U + 02c6, U + 02da, - U + 02dc, U + 2000-206f, U + 2074, U + 20ac, U + 2122, U + 2212, U + 2215; } /* latin */ @font-face { font-family: 'Droid Sans Mono'; font-display: swap; - font-style: normal; - font-weight: 400; src: local('Droid Sans Mono Regular'), local('DroidSansMono-Regular'), url(//fonts.gstatic.com/s/droidsansmono/v9/ns-m2xQYezAtqh7ai59hJVlgUn8GogvcKKzoM9Dh-4E.woff2) format('woff2'); - unicode-range: U + 0000-00ff, U + 0131, U + 0152-0153, U + 02bb-02bc, U + 02c6, U + 02da, - U + 02dc, U + 2000-206f, U + 2074, U + 20ac, U + 2122, U + 2212, U + 2215; } /* latin */ @font-face { font-family: 'Inconsolata'; font-display: swap; - font-style: normal; - font-weight: 400; src: local('Inconsolata Regular'), local('Inconsolata-Regular'), url(//fonts.gstatic.com/s/inconsolata/v16/BjAYBlHtW3CJxDcjzrnZCIgp9Q8gbYrhqGlRav_IXfk.woff2) format('woff2'); - unicode-range: U + 0000-00ff, U + 0131, U + 0152-0153, U + 02bb-02bc, U + 02c6, U + 02da, - U + 02dc, U + 2000-206f, U + 2074, U + 20ac, U + 2122, U + 2212, U + 2215; } /* latin */ @font-face { font-family: 'Source Code Pro'; font-display: swap; - font-style: normal; - font-weight: 400; src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(//fonts.gstatic.com/s/sourcecodepro/v7/mrl8jkM18OlOQN8JLgasD5bPFduIYtoLzwST68uhz_Y.woff2) format('woff2'); - unicode-range: U + 0000-00ff, U + 0131, U + 0152-0153, U + 02bb-02bc, U + 02c6, U + 02da, - U + 02dc, U + 2000-206f, U + 2074, U + 20ac, U + 2122, U + 2212, U + 2215; } /* latin */ @font-face { font-family: 'Ubuntu Mono'; font-display: swap; - font-style: normal; - font-weight: 400; src: local('Ubuntu Mono'), local('UbuntuMono-Regular'), url(//fonts.gstatic.com/s/ubuntumono/v7/ViZhet7Ak-LRXZMXzuAfkYgp9Q8gbYrhqGlRav_IXfk.woff2) format('woff2'); - unicode-range: U + 0000-00ff, U + 0131, U + 0152-0153, U + 02bb-02bc, U + 02c6, U + 02da, - U + 02dc, U + 2000-206f, U + 2074, U + 20ac, U + 2122, U + 2212, U + 2215; } /* latin */ @font-face { font-family: 'Space Mono'; font-display: swap; - font-style: normal; - font-weight: 400; src: local('Space Mono'), local('SpaceMono-Regular'), url(https://fonts.gstatic.com/s/spacemono/v2/i7dPIFZifjKcF5UAWdDRYEF8RQ.woff2) format('woff2'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, - U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } `} diff --git a/cypress/integration/gist.spec.js b/cypress/integration/gist.spec.js index f316e56..05a5df9 100644 --- a/cypress/integration/gist.spec.js +++ b/cypress/integration/gist.spec.js @@ -12,11 +12,11 @@ describe('Gist', () => { cy.get('#downshift-input-JavaScript').should('have.value', 'JavaScript') }) - const pages = ['/', '/embed/'] + const pages = ['/', '/embed/', '/82d742f4efad9757cc826d20f2a5e5af'] pages.forEach(page => { test(`${page} should not contain a query string in the url`, () => { - cy.visit('/82d742f4efad9757cc826d20f2a5e5af') + cy.visit(page) cy.url().should('not.contain', '?') })