User:Layer-09/Sandbox/Command.css: Difference between revisions
Appearance
Created page with ".mw-command-block { background-color: #f9f9f9; border: 1px solid #ddd; border-radius: 3px; margin: 1em 0; padding: 0.5em 0.8em; padding-right: 5em; position: relative; font-family: monospace; font-size: 0.95em; line-height: 1.5; overflow-x: auto; } .mw-command-prefix { color: #555; padding-right: 0.5em; user-select: none; display: inline-block; vertical-align: top; white-space: pre; } .mw-command-text..." |
mNo edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
/* Main container for the code block */ | |||
.mw-command-block { | .mw-command-block { | ||
background-color: # | background-color: #f8f9fa; | ||
border: 1px solid # | border: 1px solid #dee2e6; | ||
border-radius: | border-radius: 4px; | ||
margin: 1em 0; | margin: 1em 0; | ||
padding: 0. | padding: 0.75em 1em; | ||
position: relative; | position: relative; | ||
font-family: monospace; | font-family: monospace, "Courier New"; | ||
font-size: 0. | font-size: 0.9em; | ||
line-height: 1.5; | line-height: 1.5; | ||
} | |||
/* Container for all the lines of code */ | |||
.mw-code-area { | |||
overflow-x: auto; | overflow-x: auto; | ||
} | } | ||
.mw- | /* A single line, using flexbox for alignment */ | ||
.mw-code-line { | |||
padding-right: | display: flex; | ||
align-items: baseline; /* Aligns prefix and code nicely */ | |||
} | |||
white-space: pre; | /* The non-copyable prefix (line number and/or $) */ | ||
.mw-code-prefix { | |||
flex-shrink: 0; /* Prevents the prefix from shrinking */ | |||
box-sizing: border-box; | |||
width: 4.5em; /* Give it a fixed width for alignment */ | |||
padding-right: 1em; | |||
text-align: right; | |||
color: #6c757d; | |||
user-select: none; /* Make it non-selectable and non-copyable */ | |||
white-space: pre; /* Preserve spacing */ | |||
} | } | ||
.mw- | /* The actual code text */ | ||
.mw-code-text { | |||
white-space: pre-wrap; /* Preserve whitespace and wrap long lines */ | |||
word-break: break-all; /* Break long words that would overflow */ | |||
white-space: pre-wrap; | |||
word-break: break- | |||
} | } | ||
/* The copy button */ | |||
.mw-copy-button { | .mw-copy-button { | ||
position: absolute; | position: absolute; | ||
top: | top: 6px; | ||
right: 8px; | right: 8px; | ||
color: #007bff; | color: #007bff; | ||
| Line 45: | Line 51: | ||
user-select: none; | user-select: none; | ||
background-color: transparent; | background-color: transparent; | ||
border: | border: 1px solid transparent; | ||
border-radius: 3px; | |||
padding: 2px 6px; | |||
z-index: 1; | z-index: 1; | ||
} | } | ||
.mw-copy-button:hover { | .mw-copy-button:hover { | ||
color: #0056b3; | |||
text-decoration: underline; | text-decoration: underline; | ||
} | } | ||
Latest revision as of 08:24, 8 June 2025
/* Main container for the code block */
.mw-command-block {
background-color: #f8f9fa;
border: 1px solid #dee2e6;
border-radius: 4px;
margin: 1em 0;
padding: 0.75em 1em;
position: relative;
font-family: monospace, "Courier New";
font-size: 0.9em;
line-height: 1.5;
}
/* Container for all the lines of code */
.mw-code-area {
overflow-x: auto;
}
/* A single line, using flexbox for alignment */
.mw-code-line {
display: flex;
align-items: baseline; /* Aligns prefix and code nicely */
}
/* The non-copyable prefix (line number and/or $) */
.mw-code-prefix {
flex-shrink: 0; /* Prevents the prefix from shrinking */
box-sizing: border-box;
width: 4.5em; /* Give it a fixed width for alignment */
padding-right: 1em;
text-align: right;
color: #6c757d;
user-select: none; /* Make it non-selectable and non-copyable */
white-space: pre; /* Preserve spacing */
}
/* The actual code text */
.mw-code-text {
white-space: pre-wrap; /* Preserve whitespace and wrap long lines */
word-break: break-all; /* Break long words that would overflow */
}
/* The copy button */
.mw-copy-button {
position: absolute;
top: 6px;
right: 8px;
color: #007bff;
cursor: pointer;
font-size: 0.85em;
user-select: none;
background-color: transparent;
border: 1px solid transparent;
border-radius: 3px;
padding: 2px 6px;
z-index: 1;
}
.mw-copy-button:hover {
color: #0056b3;
text-decoration: underline;
}