-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Allow lineheight in font #597
base: main
Are you sure you want to change the base?
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
Deploy preview for codeimage-website-dev ready! ✅ Preview Built with commit ef68a01. |
Deploy preview for codeimage-highlight-dev ready! ✅ Preview Built with commit ef68a01. |
Deploy preview for codeimage ready! ✅ Preview Built with commit ef68a01. |
<> | ||
<pre>{editorState.options.lineHeight}</pre> | ||
<code class={`language-${selectedLanguage()?.id ?? 'default'}`}> | ||
<div ref={setRef} /> | ||
</code> | ||
</> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<> | |
<pre>{editorState.options.lineHeight}</pre> | |
<code class={`language-${selectedLanguage()?.id ?? 'default'}`}> | |
<div ref={setRef} /> | |
</code> | |
</> | |
<> | |
<code class={`language-${selectedLanguage()?.id ?? 'default'}`}> | |
<div ref={setRef} /> | |
</code> | |
</> |
we've to remove this
.hold(store.commands.setLineHeight, (linheHeight, {set}) => { | ||
set('options', 'lineHeight', linheHeight); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.hold(store.commands.setLineHeight, (linheHeight, {set}) => { | |
set('options', 'lineHeight', linheHeight); | |
.hold(store.commands.setLineHeight, (lineHeight, {set}) => { | |
set('options', 'lineHeight', lineHeight); |
@@ -153,6 +153,7 @@ export default function CustomEditor(props: VoidProps<CustomEditorProps>) { | |||
fontFamily: `${fontName}, monospace`, | |||
fontWeight: fontWeight, | |||
fontVariantLigatures, | |||
lineHeight: editorState.options.lineHeight, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd handle this separately to be more performant. createExtension will create a code mirror "compartment" then it will change only when lineHeight effectively changes.
createExtension(() => {
const lineHeight = editor.lineHeight;
if (!lineHeight) return null;
return EditorView.theme({
'.cm-content': { lineHeight }
})
})
<SuspenseEditorItem | ||
fallback={<SkeletonLine width={'85%'} height={'26px'} />} | ||
> | ||
<input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have to change it with NumberField of @codeui/kit when available.
currently it's still in progress due to a Maskito bug with float numbers. I'll probably leave that solution
896d10a
to
46f7d96
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
46f7d96
to
ef68a01
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information