The copy button in the code block looks strange when line wrap disabled

Steps to reproduce

  1. Set the CSS snippet to disable the code block line wrap.
/* Don't wrap codeblocks */
pre > code,
code[class*="language-"] {
    white-space: pre !important;
}
  1. Create a code block with lone line(s).
  2. Look at the copy button, it will also be scrolled to the left and didn’t looks user friendly.

Did you follow the troubleshooting guide? [Y/N]

Yes

Expected result

It should not be scrolled as the code and should remain some spaces on the right so that the button can be seen clearly.

Actual result

As above.

Environment

SYSTEM INFO:
Obsidian version: 1.12.7
Installer version: 1.7.7
Operating system: Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T8122 24.3.0
Login status: logged in
Language: en
Catalyst license: none
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: Border 1.13.4
Snippets enabled: 2
Restricted mode: off
Plugins installed: 31
Plugins enabled: 26
1: Style Settings v1.0.9
2: Dataview v0.5.68
3: Tag Wrangler v0.6.4
4: Excalidraw v2.18.0
5: Advanced Canvas v5.6.5
6: Attachment Uploader v1.1.0
7: Copilot v3.1.4
8: Vimrc Support v0.10.2
9: Vim Yank Highlight v1.0.8
10: Relative Line Numbers v3.0.0
11: Highlightr v1.2.2
12: PDF++ v0.40.31
13: Homepage v4.2.2
14: Smart Connections v3.0.80
15: Omnisearch v1.27.3
16: Iconize v2.14.7
17: Git v2.35.2
18: Linter v1.30.0
19: Auto Link Title v1.5.5
20: Various Complements v10.8.0
21: Better Word Count v0.10.1
22: ProZen v0.3
23: Hover Editor v0.11.26
24: Latex Suite v1.11.0
25: Local REST API v3.5.0
26: Keep the Rhythm v0.2.8
RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.


Additional information

Moved to Custom CSS section.