Skip to content

Commit

Permalink
Allow setting the font env variable to change the font (#35)
Browse files Browse the repository at this point in the history
fg123 authored and MichaelKim committed Aug 4, 2018
1 parent 092ba58 commit 6d2064d
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion build/main.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
* {
box-sizing: border-box;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
font-size: 12px;
}

10 changes: 8 additions & 2 deletions src/mercury/components/app.jsx
Original file line number Diff line number Diff line change
@@ -10,18 +10,19 @@ import type { StoreState, Dispatch, Workspace as WorkspaceType } from 'types';
type Props = {|
+currentWorkspace: WorkspaceType,
+background: string,
+font: string,
+title: string
|};

const App = (props: Props) => {
document.title = props.title;

return (
<div
style={{
width: '100%',
height: '100%',
background: props.background
background: props.background,
fontFamily: props.font
}}
>
<Workspace workspace={props.currentWorkspace} />
@@ -36,9 +37,14 @@ const mapStateToProps = (state: StoreState): Props => {
bg = 'url("' + bg + '") 0% 0% / cover';
}

let font = state.wsh.env.font;
if (!font) {
font = "'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace";
}
return {
currentWorkspace: state.workspaces[state.selectedWorkspace],
background: bg,
font: font,
title: state.wsh.env.title || Constants.NAME + ' ' + Constants.VERSION
};
};

0 comments on commit 6d2064d

Please sign in to comment.