mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-30 17:04:14 +00:00
81ec0c292a
Use Codex design tokens where possible, and implement custom dark theming for things for which there is no suitable design token. This means we're changing the colors for light mode ever so slightly. We need to style the search panel for dark mode, so we might as well tackle T371436 and use CSS-only Codex components. The same is done for the "Go to line" panel (can be opened with Mod+Alt+g). The messages in this panel are now also localizable. The search panel (and goto line panel) are abstracted, with helpers to create the Codex components. These will not only be used here but also for the upcoming preferences panel (T359498). Visually, the search and goto panels were inspired by the 2017 editor and share a similar layout. CodeMirror similarly uses a more compact design than usual to maximize the real estate of the editor itself. Other changes: * Bump codemirror/search to get latest bug fixes * Remove stylelint ignorance and fix errors * Move CM5 styles to ext.CodeMirror.less * Move CM-specific styles out of mediawiki.less and into codemirror.less * Move WikiEditor-specific styles to codemirror.wikieditor.less (incidentally, these only apply to CodeMirror 6) * Correct qqq documentation; the "dialog" should be called a "panel" * extension.json: alphabetize list of messages Bug: T365311 Bug: T371436 Bug: T359498 Change-Id: I6a3bbc6bce4e490886753ff484e377c1763de456
56 lines
1.3 KiB
Plaintext
56 lines
1.3 KiB
Plaintext
@import 'mediawiki.skin.variables.less';
|
|
|
|
// Overrides for WikiEditor.
|
|
|
|
.wikiEditor-ui-text .cm-editor {
|
|
border: inherit;
|
|
}
|
|
|
|
.cm-mw-toggle-wikieditor {
|
|
.oo-ui-icon-syntax-highlight {
|
|
background-color: @color-base;
|
|
// The SVG is just barely over 300 bytes, and is also only temporary
|
|
// until an official icon has been established in Codex/OOUI (T174145).
|
|
/* @embed */
|
|
@url: url( codemirror.icon.svg );
|
|
-webkit-mask-image: @url;
|
|
mask-image: @url;
|
|
-webkit-mask-size: @size-icon-medium;
|
|
mask-size: @size-icon-medium;
|
|
-webkit-mask-repeat: no-repeat;
|
|
mask-repeat: no-repeat;
|
|
-webkit-mask-position: center;
|
|
mask-position: center;
|
|
}
|
|
|
|
&:hover {
|
|
background-color: @background-color-interactive;
|
|
}
|
|
|
|
&.oo-ui-toggleWidget-on {
|
|
.oo-ui-labelElement-label {
|
|
color: @color-progressive;
|
|
}
|
|
|
|
.oo-ui-icon-syntax-highlight {
|
|
background-color: @color-progressive;
|
|
}
|
|
}
|
|
|
|
&.oo-ui-buttonElement-frameless.oo-ui-labelElement.oo-ui-iconElement:first-child {
|
|
margin-left: 0;
|
|
}
|
|
}
|
|
|
|
// Hide all buttons except CodeMirror on read only pages (T301615)
|
|
// This is the same hack that CodeEditor uses to customize the toolbar.
|
|
// WikiEditor should be updated to better handle read only pages (T188817).
|
|
.ext-codemirror-readonly {
|
|
.wikiEditor-section-secondary,
|
|
.group:not( .group-codemirror ),
|
|
.tabs,
|
|
.sections {
|
|
display: none;
|
|
}
|
|
}
|