Skip to content

Commit 25a3733

Browse files
committed
fix top padding
1 parent df1cb0f commit 25a3733

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

packages/code-editor/src/CodeEditor/CodeEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ const BaseCodeEditor = forwardRef<CodeEditorHandle, CodeEditorProps>(
277277
createPanel: view => {
278278
const dom = document.createElement('div');
279279
dom.style.position = 'absolute';
280-
dom.style.top = '-8px'; // Accounts for top padding of the editor
280+
dom.style.top = '0';
281281
dom.style.right = '0';
282282
dom.style.left = '0';
283283
dom.style.display = 'flex';

packages/code-editor/src/CodeEditor/CodeEditor.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export const CodeEditorSelectors = {
9191
GutterElement: '.cm-gutterElement',
9292
Gutters: '.cm-gutters',
9393
HyperLink: '.cm-hyper-link-icon',
94+
InnerEditor: '.cm-scroller',
9495
Line: '.cm-line',
9596
LineNumbers: '.cm-lineNumbers',
9697
LineWrapping: '.cm-lineWrapping',

packages/code-editor/src/CodeEditor/hooks/extensions/useThemeExtension.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ export function useThemeExtension({
7777
borderTopLeftRadius: hasPanel ? 0 : `${borderRadius[300]}px`,
7878
borderTopRightRadius: hasPanel ? 0 : `${borderRadius[300]}px`,
7979
color: color[theme].text[Variant.Primary][InteractionState.Default],
80-
paddingTop: `${spacing[200]}px`,
81-
paddingBottom: `${spacing[200]}px`,
8280
},
8381

8482
[`&${CodeEditorSelectors.Focused}`]: {
@@ -87,6 +85,11 @@ export function useThemeExtension({
8785
${color[theme].border[Variant.Secondary][InteractionState.Default]}`,
8886
},
8987

88+
[CodeEditorSelectors.InnerEditor]: {
89+
paddingTop: `${spacing[200]}px`,
90+
paddingBottom: `${spacing[200]}px`,
91+
},
92+
9093
[CodeEditorSelectors.Content]: {
9194
fontFamily: fontFamilies.code,
9295
fontSize: `${fontSize}px`,

0 commit comments

Comments
 (0)