User:Layer-09/Sandbox/Command.css: Difference between revisions
No edit summary |
mNo edit summary |
||
| Line 5: | Line 5: | ||
border-radius: 4px; | border-radius: 4px; | ||
margin: 1em 0; | margin: 1em 0; | ||
padding: 0.75em; | padding: 0.75em 1em; | ||
position: relative; | position: relative; | ||
font-family: monospace, "Courier New"; | font-family: monospace, "Courier New"; | ||
| Line 13: | Line 12: | ||
} | } | ||
/* | /* Container for all the lines of code */ | ||
.mw-code-area { | .mw-code-area { | ||
overflow-x: auto; | overflow-x: auto; | ||
} | } | ||
/* | /* A single line, using flexbox for alignment */ | ||
.mw-code- | .mw-code-line { | ||
display: | display: flex; | ||
align-items: baseline; /* Aligns prefix and code nicely */ | |||
} | } | ||
/* The | /* The non-copyable prefix (line number and/or $) */ | ||
.mw-code- | .mw-code-prefix { | ||
flex-shrink: 0; /* Prevents the prefix from shrinking */ | |||
box-sizing: border-box; | box-sizing: border-box; | ||
width: | width: 4.5em; /* Give it a fixed width for alignment */ | ||
padding-right: 1em; | padding-right: 1em; | ||
text-align: right; | text-align: right; | ||
color: #6c757d; | color: #6c757d; | ||
user-select: none; /* Make | user-select: none; /* Make it non-selectable and non-copyable */ | ||
white-space: pre | white-space: pre; /* Preserve spacing */ | ||
} | } | ||
/* | /* The actual code text */ | ||
.mw-code-text { | |||
white-space: pre-wrap; /* Preserve whitespace and wrap long lines */ | |||
.mw-code- | word-break: break-all; /* Break long words that would overflow */ | ||
} | } | ||
/* | /* The copy button */ | ||
.mw-copy-button { | .mw-copy-button { | ||
position: absolute; | position: absolute; | ||
| Line 80: | Line 60: | ||
color: #0056b3; | color: #0056b3; | ||
text-decoration: underline; | text-decoration: underline; | ||
} | } | ||