Skip to content

Commit f7c1bde

Browse files
committed
fixed commit area styling
the TextareaAutosize component seems to always have a height of rows*(1em + floor(1em/4px)) which can't be represented exactly in css because there is no floor
1 parent 5815239 commit f7c1bde

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed

src/components/CommitBox.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,14 @@ export class CommitBox extends React.Component<
7878
<TextareaAutosize
7979
className={classes(textInputStyle, stagedCommitMessageStyle)}
8080
disabled={!this.props.hasFiles}
81+
minRows={3}
82+
onChange={this.handleChange}
8183
placeholder={
8284
this.props.hasFiles
8385
? 'Input message to commit staged changes'
8486
: 'Stage your changes before commit'
8587
}
8688
value={this.state.value}
87-
onChange={this.handleChange}
8889
/>
8990
<input
9091
className={this.commitButtonStyle(this.props.hasFiles)}

src/style/BranchHeaderStyle.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,20 @@ export const branchListItemStyle = style({
8585
color: 'var(--jp-ui-font-color1)'
8686
});
8787

88+
// need to override font-size from user agent stylesheet
8889
export const stagedCommitButtonStyle = style({
8990
backgroundColor: 'var(--jp-brand-color1)',
9091
backgroundImage: 'var(--jp-checkmark)',
9192
backgroundSize: '100%',
9293
backgroundRepeat: 'no-repeat',
9394
backgroundPosition: 'center',
94-
color: 'white',
95-
height: '42px',
96-
width: '40px',
9795
border: '0',
98-
flex: '1 1 auto'
96+
color: 'white',
97+
flex: '1 1 auto',
98+
fontSize: 'var(--jp-ui-font-size1)',
99+
height: 'calc(3em + 9px)',
100+
padding: 'calc(var(--jp-code-padding) + 1px) 7px',
101+
width: '40px'
99102
});
100103

101104
export const stagedCommitButtonReadyStyle = style({
@@ -117,17 +120,18 @@ export const stagedCommitStyle = style({
117120
margin: '8px'
118121
});
119122

123+
// need to override font-size from user agent stylesheet
120124
export const stagedCommitMessageStyle = style({
121-
width: '75%',
122-
fontWeight: 300,
123-
height: '35px',
124-
overflowX: 'auto',
125-
border: 'var(--jp-border-width) solid var(--jp-border-color2)',
126-
flex: '20 1 auto',
127-
resize: 'vertical',
128-
padding: '4px 8px',
129125
backgroundColor: 'var(--jp-layout-color1)',
126+
border: 'var(--jp-border-width) solid var(--jp-border-color2)',
130127
color: 'var(--jp-ui-font-color0)',
128+
fontSize: 'var(--jp-ui-font-size1)',
129+
fontWeight: 300,
130+
flex: '20 1 auto',
131+
overflowX: 'auto',
132+
padding: 'var(--jp-code-padding)',
133+
resize: 'none',
134+
width: '75%',
131135

132136
$nest: {
133137
'&:focus': {

src/style/GitStageStyle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const sectionAreaStyle = style({
2828
});
2929

3030
export const sectionHeaderLabelStyle = style({
31-
fontSize: 'var(--jp-ui-font-size)',
31+
fontSize: 'var(--jp-ui-font-size1)',
3232
flex: '1 1 auto',
3333
textOverflow: 'ellipsis',
3434
overflow: 'hidden',

src/style/GitWidgetStyle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ export const gitWidgetStyle = style({
66
minWidth: '300px',
77
color: 'var(--jp-ui-font-color1)',
88
background: 'var(--jp-layout-color1)',
9-
fontSize: 'var(--jp-ui-font-size0)'
9+
fontSize: 'var(--jp-ui-font-size1)'
1010
});

0 commit comments

Comments
 (0)