New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change font size #428
Comments
@sam-rez https://codesandbox.io/embed/react-codemirror-example-codemirror-6-https-github-com-uiwjs-react-codemirror-issues-428-tfoeku?fontsize=14&hidenavigation=1&theme=dark import React from "react";
import CodeMirror from "@uiw/react-codemirror";
import { EditorView } from "@codemirror/view";
import { javascript } from "@codemirror/lang-javascript";
const fontSize = EditorView.baseTheme({
"&": {
backgroundColor: "#fff",
fontSize: "34px"
}
});
export default function App() {
const onChange = React.useCallback((value, viewUpdate) => {
console.log("value:", value);
}, []);
return (
<div>
<CodeMirror
value="console.log('hello world!');"
height="200px"
theme="dark"
extensions={[fontSize, javascript({ jsx: true })]}
onChange={onChange}
/>
<CodeMirror
value="console.log('hello world!');"
height="200px"
extensions={[javascript({ jsx: true })]}
onChange={(value, viewUpdate) => {
console.log("value:", value);
}}
/>
</div>
);
} |
Is this recommended over adding CSS class? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a way setting to change font size? I'm on version 4.15.1
The text was updated successfully, but these errors were encountered: