@import 'mw.rcfilters.mixins';
.mw-rcfilters-ui-filterTagItemWidget {
- background-color: #fff;
- border-color: #979797;
- color: #222;
-
// Background and color of the capsule widget need a bit
// more specificity to override ooui internals
- &-muted.oo-ui-tagItemWidget.oo-ui-widget-enabled {
+ &.oo-ui-flaggedElement-muted.oo-ui-tagItemWidget.oo-ui-widget-enabled {
// Muted state
background-color: #eaecf0;
border-color: #c8ccd1;
}
}
- &-conflicted.oo-ui-tagItemWidget.oo-ui-widget-enabled {
- background-color: #fee7e6; // Red90 AAA
- border-color: #b32424; // Red30 AAA
-
+ &.oo-ui-flaggedElement-invalid.oo-ui-tagItemWidget.oo-ui-widget-enabled {
.oo-ui-labelElement-label {
color: #b32424;
}
- .oo-ui-buttonWidget {
- opacity: @muted-opacity;
- }
}
- &-selected.oo-ui-tagItemWidget.oo-ui-widget-enabled {
+ // OOUI classes require super-specificity in order to override
+ // the white background
+ // The specificity is fixed in the patch: https://gerrit.wikimedia.org/r/#/c/349525/
+ // and will be available in the next OOUI release.
+ .oo-ui-tagMultiselectWidget.oo-ui-widget-enabled.oo-ui-tagMultiselectWidget-outlined .oo-ui-tagMultiselectWidget-handle &-selected.oo-ui-tagItemWidget.oo-ui-widget-enabled {
background-color: #eaf3ff;
border-color: #36c;
}
}
&.oo-ui-labelElement .oo-ui-labelElement-label {
- vertical-align: middle;
cursor: pointer;
}
// Initialization
this.$overlay.append( this.popup.$element );
this.$element
+ .addClass( 'mw-rcfilters-ui-filterTagItemWidget' )
.prepend( this.$highlight )
.attr( 'aria-haspopup', 'true' )
.on( 'mouseenter', this.onMouseEnter.bind( this ) )
* Set the current mute state for this item
*/
mw.rcfilters.ui.FilterTagItemWidget.prototype.setCurrentMuteState = function () {
- this.$element
- .toggleClass(
- 'mw-rcfilters-ui-filterTagItemWidget-muted',
+ this.setFlags( {
+ muted: (
!this.model.isSelected() ||
this.model.isIncluded() ||
this.model.isFullyCovered()
- )
- .toggleClass(
- 'mw-rcfilters-ui-filterTagItemWidget-conflicted',
- this.model.isSelected() && this.model.isConflicted()
- );
+ ),
+ invalid: this.model.isSelected() && this.model.isConflicted()
+ } );
};
/**