Add width adjustment. (#91)

main
Patryk Jóźwiak 7 years ago committed by Jake Dexheimer
parent 3985e35b52
commit ede83bf424

@ -83,6 +83,7 @@ class Carbon extends React.Component {
// create styles // create styles
const containerStyle = { const containerStyle = {
background: config.background, background: config.background,
minWidth: config.widthAdjustment ? '90px' : '680px',
padding: `${config.paddingVertical} ${config.paddingHorizontal}` padding: `${config.paddingVertical} ${config.paddingHorizontal}`
} }
@ -123,6 +124,10 @@ class Carbon extends React.Component {
box-shadow: none; box-shadow: none;
} }
#container :global(.CodeMirror__container) {
min-width: inherit;
}
#container :global(.CodeMirror__container.dropshadow) { #container :global(.CodeMirror__container.dropshadow) {
box-shadow: 0 20px 68px rgba(0, 0, 0, 0.55); box-shadow: 0 20px 68px rgba(0, 0, 0, 0.55);
border-radius: 5px; border-radius: 5px;
@ -130,7 +135,7 @@ class Carbon extends React.Component {
#container :global(.CodeMirror__container .CodeMirror) { #container :global(.CodeMirror__container .CodeMirror) {
height: auto; height: auto;
min-width: 680px; min-width: inherit;
padding: 18px 18px; padding: 18px 18px;
border-radius: 5px; border-radius: 5px;
font-family: Hack, monospace !important; font-family: Hack, monospace !important;

@ -46,6 +46,11 @@ class Settings extends React.Component {
enabled={this.props.enabled.windowControls} enabled={this.props.enabled.windowControls}
onChange={this.props.onChange.bind(null, 'windowControls')} onChange={this.props.onChange.bind(null, 'windowControls')}
/> />
<Toggle
label="Width adjustment"
enabled={this.props.enabled.widthAdjustment}
onChange={this.props.onChange.bind(null, 'widthAdjustment')}
/>
<Slider <Slider
label="Padding (vertical)" label="Padding (vertical)"
initialValue={16} initialValue={16}

@ -48,6 +48,7 @@ class Editor extends React.Component {
language: DEFAULT_LANGUAGE, language: DEFAULT_LANGUAGE,
dropShadow: true, dropShadow: true,
windowControls: true, windowControls: true,
widthAdjustment: true,
paddingVertical: '48px', paddingVertical: '48px',
paddingHorizontal: '32px', paddingHorizontal: '32px',
uploading: false, uploading: false,

Loading…
Cancel
Save