Skip to content

Commit

Permalink
better style for editor
Browse files Browse the repository at this point in the history
  • Loading branch information
hvarg committed Feb 17, 2024
1 parent 30c799f commit a96b3bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/DataQuery/DataQueryTemplateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const DataQueryTemplateForm = ({value,onChange, showErrors}:DataQueryTemp
<CodeMirror value={QUERY_HEADER}
extensions={[StreamLanguage.define(sparql)]}
readOnly
className="cm-readonly"
className={"cm-readonly header" + (lastLine>11 ? " bigger" : "")}
/>
<CodeMirror value={template}
extensions={[
Expand All @@ -128,7 +128,7 @@ export const DataQueryTemplateForm = ({value,onChange, showErrors}:DataQueryTemp
lineNumbers({formatNumber: (lineNo:number, state: EditorState) => `${lastLine}`})
]}
readOnly
className="cm-readonly"
className={"cm-readonly footer " + (lastLine>11 ? "bigger" : "")}
/>
</Card>
</Box>
Expand Down
10 changes: 9 additions & 1 deletion src/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ code {
background: transparent !important;
}

.cm-readonly * .cm-gutters {
.cm-readonly.header * .cm-gutters {
padding-left: 7px !important;
}

.cm-readonly.header.bigger * .cm-gutters {
padding-left: 16px !important;
}

.cm-readonly.footer.bigger * .cm-gutters {
padding-left: 9px !important;
}

0 comments on commit a96b3bd

Please sign in to comment.