stargrey / obsidian-better-codeblock

Add title, line number to Obsidian code block
MIT License
109 stars 10 forks source link

Use of !important in style sheet breaks css for other things #19

Open nimide opened 1 year ago

nimide commented 1 year ago

In your second styling element, you used an !important for the margin of the copy button. This makes the copy button perform this function across the entire vault and other plugins, including within things like notes, notices, etc. that use the "code-block" functionality. Also, the .copy-code-button is very broad. Could you make it more specific to the classes you are using in your plugin?

Code previously .copy-code-button{ margin-top: 42px !important; / 为自带的按钮增加上边距 / }

Changes I made to make the plugin compatible with the rest of my plugins. pre[class="code-block-pre"] .copy-code-button{ margin-top: 42px; / 为自带的按钮增加上边距 */ }

One thing I did not take the time to do is do this for every class type. I only did it for the situation where all three settings have been turned on for the plugin.

Thanks for all the hard work. I really enjoy using your plugin 😄