mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-23 12:45:38 +00:00
Merge pull request #4956 from bacteriostat/feature/single-line-editor-placeholder
feat: Add placeholder for SingleLineEditor
This commit is contained in:
@@ -26,6 +26,11 @@ const StyledWrapper = styled.div`
|
||||
|
||||
.CodeMirror-lines {
|
||||
padding: 0;
|
||||
|
||||
.CodeMirror-placeholder {
|
||||
color: ${(props) => props.theme.codemirror.placeholder.color} !important;
|
||||
opacity: ${(props) => props.theme.codemirror.placeholder.opacity} !important
|
||||
}
|
||||
}
|
||||
|
||||
.CodeMirror-cursor {
|
||||
|
||||
@@ -46,6 +46,7 @@ class SingleLineEditor extends Component {
|
||||
const noopHandler = () => {};
|
||||
|
||||
this.editor = CodeMirror(this.editorRef.current, {
|
||||
placeholder: this.props.placeholder ?? '',
|
||||
lineWrapping: false,
|
||||
lineNumbers: false,
|
||||
theme: this.props.theme === 'dark' ? 'monokai' : 'default',
|
||||
|
||||
@@ -248,6 +248,10 @@ const darkTheme = {
|
||||
codemirror: {
|
||||
bg: '#1e1e1e',
|
||||
border: '#373737',
|
||||
placeholder: {
|
||||
color: '#a2a2a2',
|
||||
opacity: 0.50
|
||||
},
|
||||
gutter: {
|
||||
bg: '#262626'
|
||||
},
|
||||
|
||||
@@ -249,6 +249,10 @@ const lightTheme = {
|
||||
codemirror: {
|
||||
bg: 'white',
|
||||
border: '#efefef',
|
||||
placeholder: {
|
||||
color: '#a2a2a2',
|
||||
opacity: 0.75
|
||||
},
|
||||
gutter: {
|
||||
bg: '#f3f3f3'
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user