Skip to content

Support CodePane font change #1068

Open
@asm0dey

Description

@asm0dey

Description

Currently, fonts used in CodePane are hardcoded into the themes.

Proposal

I propose to support customizing of them may be the same way we can customize other fonts now

Links / References

Currently I've written dirty hack to monkey patch it in runtime,

import codeTheme from 'react-syntax-highlighter/dist/cjs/styles/prism/material-dark';

const changeFont = obj => {
    if (typeof obj === 'object') {
        for (const keys in obj) {
            if (typeof obj[keys] === 'object') {
                changeFont(obj[keys])
            } else {
                if (keys==="fontFamily"){
                    obj[keys] = '"JetBrains Mono", monospace'
                }
            }
        }
    }
    return obj;
};
changeFont(codeTheme)

But of course, it's not how it should be done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature RequestRequest for or introduction of new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions