8000 Import fonts only in Scope standalone by fbarl · Pull Request #3704 · weaveworks/scope · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Import fonts only in Scope standalone #3704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions client/app/scripts/components/global-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import '@fortawesome/fontawesome-free/css/all.css';
import '@fortawesome/fontawesome-free/css/v4-shims.css';
import 'rc-slider/dist/rc-slider.css';

import ProximaNova from '../../fonts/proximanova-regular.woff';
import RobotoMono from '../../fonts/robotomono-regular.ttf';

const scopeTheme = key => props => props.theme.scope[key];

const hideable = props => `
Expand Down Expand Up @@ -114,18 +111,6 @@ const overlayWrapper = props => `
`;

const GlobalStyle = createGlobalStyle`
/* stylelint-disable sh-waqar/declaration-use-variable */
@font-face {
font-family: 'proxima-nova';
src: url(${ProximaNova});
}

@font-face {
font-family: 'Roboto Mono';
src: url(${RobotoMono});
}
/* stylelint-enable sh-waqar/declaration-use-variable */

/*
* Contain all the styles in the root div instead of having them truly
* global, so that they don't interfere with the app they're injected into.
Expand Down
20 changes: 20 additions & 0 deletions client/app/scripts/fonts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { createGlobalStyle } from 'styled-components';

import ProximaNova from '../fonts/proximanova-regular.woff';
import RobotoMono from '../fonts/robotomono-regular.ttf';

const Fonts = createGlobalStyle`
/* stylelint-disable sh-waqar/declaration-use-variable */
@font-face {
font-family: 'proxima-nova';
src: url(${ProximaNova});
}

@font-face {
font-family: 'Roboto Mono';
src: url(${RobotoMono});
}
/* stylelint-enable sh-waqar/declaration-use-variable */
`;

export default Fonts;
2 changes: 2 additions & 0 deletions client/app/scripts/main.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Provider } from 'react-redux';

import '../images/favicon.ico';
import configureStore from './stores/configureStore.dev';
import Fonts from './fonts';

const store = configureStore();

Expand All @@ -13,6 +14,7 @@ function renderApp() {
ReactDOM.render(
(
<Provider store={store}>
<Fonts />
<App />
</Provider>
), document.getElementById('app')
Expand Down
2 changes: 2 additions & 0 deletions client/app/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Provider } from 'react-redux';

import '../images/favicon.ico';
import configureStore from './stores/configureStore';
import Fonts from './fonts';

const store = configureStore();

Expand All @@ -13,6 +14,7 @@ function renderApp() {
ReactDOM.render(
(
<Provider store={store}>
<Fonts />
<App />
</Provider>
), document.getElementById('app')
Expand Down
0