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

Is font-family: inherit; in .w-tc-editor required? #147

Open
ronny1020 opened this issue May 9, 2023 · 2 comments
Open

Is font-family: inherit; in .w-tc-editor required? #147

ronny1020 opened this issue May 9, 2023 · 2 comments

Comments

@ronny1020
Copy link

Thank you for your hard work.

I am using this library with Tailwind. However, after adding the font-mono class, it is not working in the library. The reason for this is that the class .w-tc-editor is set to font-family: inherit;, which overrides the font-mono setting. This could happen to any custom class.

Although I can use inline styles or !important to fix this issue, I believe that using a class to provide the style is better practice. Furthermore, even without any font settings, the element would still inherit the style.

@jaywcjlove
Copy link
Member

The component uses overlapping textarea and pre elements to implement code highlighting. If the fonts are inconsistent, it may cause shadowing issues.

@ronny1020

@ronny1020
Copy link
Author

Thanks for your reply. I understand that the code is currently using overlapping. However, I think it should work adequately only to add the font-family: inherit to the textarea and the pre-element since they share the same parent.

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

No branches or pull requests

2 participants