Realtime preview: improve toolbar button style

* Add hover and active styles to match normal toolbar state styling.
* Move border from right to left on `.section-secondary .group`.
* Add a skinStyle for MonoBook so it doesn't get the button style,
  because it provides its own.

Bug: T303991
Change-Id: I6f08906156a9768729d779b6c50c9e804f51fb98
This commit is contained in:
Sam Wilson 2022-04-19 15:08:24 +08:00
parent 45a8a077b1
commit 3ab9a863a2
6 changed files with 34 additions and 3 deletions

View file

@ -339,7 +339,12 @@
"realtimepreview/TwoPaneLayout.less",
"realtimepreview/ErrorLayout.less",
"realtimepreview/ManualWidget.less"
]
],
"skinStyles": {
"monobook": [
"realtimepreview/monobook.less"
]
}
}
},
"ResourceFileModulePaths": {

View file

@ -9,10 +9,14 @@
box-shadow: 0 2px 1px 0 rgba( 0, 0, 0, 0.1 );
/* Groups */
.group,
.section-secondary .group {
border-color: #eaecf0;
}
.group {
min-height: 32px;
margin: 0;
border-color: #eaecf0;
padding-right: 0;
.label {

View file

@ -108,6 +108,12 @@
.section-secondary {
float: right;
.group {
padding-right: 0;
padding-left: 6px;
border-left: 1px solid #c8ccd1;
}
}
/* Groups */

View file

@ -91,7 +91,8 @@ RealtimePreview.prototype.getToolbarButton = function ( context ) {
icon: 'article',
value: this.enabled,
framed: false,
classes: [ 'tool' ] // T305953; So we can find usage of this class later: .tool
// T305953; So we can find usage of this class later: .tool
classes: [ 'tool', 'ext-WikiEditor-realtimepreview-button' ]
} );
this.button.connect( this, { change: this.toggle } );
return this.button;

View file

@ -1,5 +1,13 @@
@import 'mediawiki.ui/variables.less';
.ext-WikiEditor-realtimepreview-button:hover {
background-color: @colorGray14;
}
.ext-WikiEditor-realtimepreview-button.oo-ui-toggleWidget-on .oo-ui-labelElement-label {
color: @color-primary;
}
/* stylelint-disable selector-max-id */
#wpTextbox1,
.mw-editform #wpTextbox1 {

View file

@ -0,0 +1,7 @@
.ext-WikiEditor-realtimepreview-button:hover {
background-color: unset;
}
.ext-WikiEditor-realtimepreview-button.oo-ui-toggleWidget-on .oo-ui-labelElement-label {
color: unset;
}