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

✨ [Feature]: 需要Markdown MD 编辑器的代码风格支持可配置(previewRef支持自定义类名)。 #1861

Open
aolinpk opened this issue May 28, 2024 · 3 comments
Labels
enhancement Feature enhancement

Comments

@aolinpk
Copy link
Contributor

aolinpk commented May 28, 2024

What problem does this feature solve

dev_ui中的代码编辑器代码展示使用的是highlight.js,但是通过了父级类dp-md-view 强行覆盖了很多样式。希望可以支持高亮颜色可配置不受到写死的样式影响。
image

建议方案:将dp-md-view类根据参数赋予,配置可选参数,如果传入参数则代表用户使用默认的highlight或者自定义的highlight的样式。不被dev_ui中写死的颜色影响。

What does the proposed API look like

preview-style-class: default | string
default的值取 'dp-md-view'

@aolinpk
Copy link
Contributor Author

aolinpk commented May 29, 2024

本周内会提交PR

@aolinpk
Copy link
Contributor Author

aolinpk commented May 30, 2024

单纯的md可以通过 .myclass.dp-md-view覆盖。 如果是要覆盖编辑器中的预览样式可以通过.myclass .dp-md-view来覆盖。其实还是想覆盖的时候直接把.dp-md-view干掉的。算了 先留着这个类吧。 其实准确来说是 dp-md-view要做一个拆分,把颜色样式和其他地下的子组件样式拆成两个类。传入class的时候干掉与颜色有关的类。

@aolinpk
Copy link
Contributor Author

aolinpk commented May 30, 2024

目前暂时先通过选择器优先级的方式覆盖样式解决

@fu050409 fu050409 added the enhancement Feature enhancement label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature enhancement
Projects
None yet
Development

No branches or pull requests

2 participants