From 761a46060b8a3701be2e6b84ed9444c4aeacc156 Mon Sep 17 00:00:00 2001 From: Daniel Scalzi Date: Mon, 13 Apr 2020 06:23:27 -0400 Subject: [PATCH] Add global styles, move fonts. Need to figure out if the path trick to load fonts from css will work in prod. May need to load fonts from tsx file and use __static. --- .../{App.css => components/Application.css} | 0 src/renderer/components/Frame.css | 4 +- src/renderer/components/Frame.tsx | 6 +-- src/renderer/index.css | 44 ++++++++++++++++++ src/renderer/index.tsx | 1 + {assets => static}/fonts/Avenir-Black.ttf | Bin .../fonts/Avenir-BlackOblique.ttf | Bin {assets => static}/fonts/Avenir-Book.ttf | Bin .../fonts/Avenir-BookOblique.ttf | Bin {assets => static}/fonts/Avenir-Heavy.ttf | Bin .../fonts/Avenir-HeavyOblique.ttf | Bin {assets => static}/fonts/Avenir-Light.ttf | Bin .../fonts/Avenir-LightOblique.ttf | Bin {assets => static}/fonts/Avenir-Medium.ttf | Bin .../fonts/Avenir-MediumOblique.ttf | Bin {assets => static}/fonts/Avenir-Oblique.ttf | Bin {assets => static}/fonts/Avenir-Roman.ttf | Bin {assets => static}/fonts/ringbearer.ttf | Bin 18 files changed, 49 insertions(+), 6 deletions(-) rename src/renderer/{App.css => components/Application.css} (100%) create mode 100644 src/renderer/index.css rename {assets => static}/fonts/Avenir-Black.ttf (100%) rename {assets => static}/fonts/Avenir-BlackOblique.ttf (100%) rename {assets => static}/fonts/Avenir-Book.ttf (100%) rename {assets => static}/fonts/Avenir-BookOblique.ttf (100%) rename {assets => static}/fonts/Avenir-Heavy.ttf (100%) rename {assets => static}/fonts/Avenir-HeavyOblique.ttf (100%) rename {assets => static}/fonts/Avenir-Light.ttf (100%) rename {assets => static}/fonts/Avenir-LightOblique.ttf (100%) rename {assets => static}/fonts/Avenir-Medium.ttf (100%) rename {assets => static}/fonts/Avenir-MediumOblique.ttf (100%) rename {assets => static}/fonts/Avenir-Oblique.ttf (100%) rename {assets => static}/fonts/Avenir-Roman.ttf (100%) rename {assets => static}/fonts/ringbearer.ttf (100%) diff --git a/src/renderer/App.css b/src/renderer/components/Application.css similarity index 100% rename from src/renderer/App.css rename to src/renderer/components/Application.css diff --git a/src/renderer/components/Frame.css b/src/renderer/components/Frame.css index 0be5d5e8..62563e5c 100644 --- a/src/renderer/components/Frame.css +++ b/src/renderer/components/Frame.css @@ -63,9 +63,9 @@ right: -2px; height: 22px; } -#frameButtonDockWin > .frameButton:not(:first-child) { +/* #frameButtonDockWin > .frameButton:not(:first-child) { margin-left: -4px; -} +} */ /* Darwin frame button dock: NaN; */ #frameButtonDockDarwin { diff --git a/src/renderer/components/Frame.tsx b/src/renderer/components/Frame.tsx index 19ae985d..86484c68 100644 --- a/src/renderer/components/Frame.tsx +++ b/src/renderer/components/Frame.tsx @@ -2,8 +2,6 @@ import * as React from 'react'; import { remote } from 'electron'; import './Frame.css'; -require('./Frame.css') - function closeHandler() { const window = remote.getCurrentWindow(); window.close(); @@ -48,10 +46,10 @@ const Frame = () => ( diff --git a/src/renderer/index.css b/src/renderer/index.css new file mode 100644 index 00000000..01d30954 --- /dev/null +++ b/src/renderer/index.css @@ -0,0 +1,44 @@ +/******************************************************************************* + * * + * Fonts * + * * + ******************************************************************************/ + + @font-face { + font-family: 'Avenir Book'; + src: url('../../static/fonts/Avenir-Book.ttf'); +} + +@font-face { + font-family: 'Avenir Medium'; + src: url('../../static/fonts/Avenir-Medium.ttf'); +} + +@font-face { + font-family: 'Ringbearer'; + src: url('../../static/fonts/Ringbearer.ttf'); +} + +/******************************************************************************* + * * + * Element Styles * + * * + ******************************************************************************/ + +/* Reset body, html, and div presets. */ +body, html, div { + margin: 0; + padding: 0; +} + +/* Reset p presets. */ +p { + -webkit-margin-before: 0em; + -webkit-margin-after: 0em; +} + +/* Set default font and color. */ +body, button { + font-family: 'Avenir Book'; + color: white; +} \ No newline at end of file diff --git a/src/renderer/index.tsx b/src/renderer/index.tsx index 0426b032..1213602f 100644 --- a/src/renderer/index.tsx +++ b/src/renderer/index.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; import { AppContainer } from 'react-hot-loader'; +import './index.css'; import Application from './components/Application'; diff --git a/assets/fonts/Avenir-Black.ttf b/static/fonts/Avenir-Black.ttf similarity index 100% rename from assets/fonts/Avenir-Black.ttf rename to static/fonts/Avenir-Black.ttf diff --git a/assets/fonts/Avenir-BlackOblique.ttf b/static/fonts/Avenir-BlackOblique.ttf similarity index 100% rename from assets/fonts/Avenir-BlackOblique.ttf rename to static/fonts/Avenir-BlackOblique.ttf diff --git a/assets/fonts/Avenir-Book.ttf b/static/fonts/Avenir-Book.ttf similarity index 100% rename from assets/fonts/Avenir-Book.ttf rename to static/fonts/Avenir-Book.ttf diff --git a/assets/fonts/Avenir-BookOblique.ttf b/static/fonts/Avenir-BookOblique.ttf similarity index 100% rename from assets/fonts/Avenir-BookOblique.ttf rename to static/fonts/Avenir-BookOblique.ttf diff --git a/assets/fonts/Avenir-Heavy.ttf b/static/fonts/Avenir-Heavy.ttf similarity index 100% rename from assets/fonts/Avenir-Heavy.ttf rename to static/fonts/Avenir-Heavy.ttf diff --git a/assets/fonts/Avenir-HeavyOblique.ttf b/static/fonts/Avenir-HeavyOblique.ttf similarity index 100% rename from assets/fonts/Avenir-HeavyOblique.ttf rename to static/fonts/Avenir-HeavyOblique.ttf diff --git a/assets/fonts/Avenir-Light.ttf b/static/fonts/Avenir-Light.ttf similarity index 100% rename from assets/fonts/Avenir-Light.ttf rename to static/fonts/Avenir-Light.ttf diff --git a/assets/fonts/Avenir-LightOblique.ttf b/static/fonts/Avenir-LightOblique.ttf similarity index 100% rename from assets/fonts/Avenir-LightOblique.ttf rename to static/fonts/Avenir-LightOblique.ttf diff --git a/assets/fonts/Avenir-Medium.ttf b/static/fonts/Avenir-Medium.ttf similarity index 100% rename from assets/fonts/Avenir-Medium.ttf rename to static/fonts/Avenir-Medium.ttf diff --git a/assets/fonts/Avenir-MediumOblique.ttf b/static/fonts/Avenir-MediumOblique.ttf similarity index 100% rename from assets/fonts/Avenir-MediumOblique.ttf rename to static/fonts/Avenir-MediumOblique.ttf diff --git a/assets/fonts/Avenir-Oblique.ttf b/static/fonts/Avenir-Oblique.ttf similarity index 100% rename from assets/fonts/Avenir-Oblique.ttf rename to static/fonts/Avenir-Oblique.ttf diff --git a/assets/fonts/Avenir-Roman.ttf b/static/fonts/Avenir-Roman.ttf similarity index 100% rename from assets/fonts/Avenir-Roman.ttf rename to static/fonts/Avenir-Roman.ttf diff --git a/assets/fonts/ringbearer.ttf b/static/fonts/ringbearer.ttf similarity index 100% rename from assets/fonts/ringbearer.ttf rename to static/fonts/ringbearer.ttf