Skip to content
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

Customize the header render style(like h2:before prefix string) of the editing area #4735

Open
dolt131943 opened this issue Apr 9, 2024 · 3 comments

Comments

@dolt131943
Copy link

Describe feature

I want to change the header (h2,h3,h4,h5,h6) render style in editor.
for example: I want to use cascading numbers ( 1.1.1.1.1) instead of "##","###","####","#####","######".
but use AppTheme or AppCss can not change it .

I found that editor's header style is define in hard code :

src/public/app/widgets/type_widgets/read_only_text.js

src/public/app/widgets/type_widgets/editable_text.js

like:

 body.heading-style-markdown .note-detail-readonly-text h1::before { content: "#\\2004"; color: var(--muted-text-color); }
    body.heading-style-markdown .note-detail-readonly-text h2::before { content: "##\\2004"; color: var(--muted-text-color); }
    body.heading-style-markdown .note-detail-readonly-text h3::before { content: "###\\2004"; color: var(--muted-text-color); }
    body.heading-style-markdown .note-detail-readonly-text h4:not(.include-note-title)::before { content: "####\\2004"; color: var(--muted-text-color); }
    body.heading-style-markdown .note-detail-readonly-text h5::before { content: "#####\\2004"; color: var(--muted-text-color); }
    body.heading-style-markdown .note-detail-readonly-text h6::before { content: "######\\2004"; color: var(--muted-text-color); }

And these are defined in the main area of editor element, so they override the ThemeCss or AppCss that load in top of file.

Thanks.

Additional Information

No response

@Nriver
Copy link
Contributor

Nriver commented Apr 9, 2024

You can append !important to your style declarations in CSS to forcefully override other conflicting styles.

@dolt131943
Copy link
Author

After consulting with front-end development experts,
I found another workaround that could override the hard-coded style by positioning elements more precisely.

@dolt131943
Copy link
Author

You can append !important to your style declarations in CSS to forcefully override other conflicting styles.

yes, thanks.🌹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants