From c4e224df294d7e86edc2642b3f517badf4bf3747 Mon Sep 17 00:00:00 2001 From: Jake Archibald Date: Thu, 5 Jul 2018 17:40:18 +0100 Subject: [PATCH] Adding line-height setting & granular font size. (#410) * Adding line-height option. Fixes #406. * Allowing more granular font size --- components/Carbon.js | 1 + components/Settings.js | 9 +++++++++ components/Slider.js | 4 +++- lib/constants.js | 1 + lib/routing.js | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/components/Carbon.js b/components/Carbon.js index d452eea..a96e3fc 100644 --- a/components/Carbon.js +++ b/components/Carbon.js @@ -202,6 +202,7 @@ class Carbon extends PureComponent { ${config.lineNumbers ? 'padding-left: 12px;' : ''} border-radius: 5px; font-family: ${config.fontFamily}, monospace !important; font-size: ${config.fontSize}; + line-height: ${config.lineHeight}; font-variant-ligatures: contextual; font-feature-settings: 'calt' 1; user-select: none; diff --git a/components/Settings.js b/components/Settings.js index 1c634fd..b8af3a6 100644 --- a/components/Settings.js +++ b/components/Settings.js @@ -51,6 +51,7 @@ class Settings extends React.Component { value={this.props.fontSize || 13} minValue={10} maxValue={18} + step={0.5} onChange={this.props.onChange.bind(null, 'fontSize')} /> + @@ -23,11 +24,12 @@ export default class extends React.Component { onChange={this.handleChange} min={minValue} max={maxValue} + step={step} />