mediawiki-skins-MinervaNeue/resources/skins.minerva.content.styles/hacks.less
Bartosz Dziewoński 6b0ce86410 Make Minerva section editing more like other skins
Goal: Make skins.minerva.editor not rely on Minerva-specific markup.

SkinMinerva.php:
* Add `class="mw-editsection"` to section edit links in SkinMinerva.
  This is the default behavior in SkinTemplate.
* Tweak the page "Edit" link generated in PHP to be the same as the
  link we were generating in JS: add class="edit-page" and change the
  message for the text.
* (Fix an unrelated code comment that was incorrect.)

skins.minerva.content.styles/hacks.less:
* Remove a hack that was hiding .mw-editsection, since we now use it.

skins.minerva.editor/init.js:
* Stop using the `data-section` attribute on links to decide which
  page section to open in the editor. Instead, use the `href`
  attribute and extract the `section` URL parameter from it.
* Stop using the `edit-page` class to find section edit links.
  Instead, use the `mw-editsection` class.
* Remove super weird code that removed the original "Edit" link from
  the page and generated an identical one to replace it, instead of
  just adding event handlers to the existing one.
* Centralize event handling for all types of edit links.

Bug: T198765
Change-Id: I79639c738ff1c3ec4b48ee2e462d23060151a21b
2018-10-04 14:07:27 -07:00

180 lines
4 KiB
Plaintext

/*
A file for css that corrects known rendering issues on known Wikimedia wikis.
the following definitions exist to deal with certain inline styles
present in wikitext.
This file should not need to exist
It will become redundant when the following RFC is resolved:
https://www.mediawiki.org/wiki/Requests_for_comment/Allow_styling_in_templates
FIXME: Review all of these hacks to see if they still apply.
*/
@import '../../minerva.less/minerva.variables';
@import '../../minerva.less/minerva.mixins';
@import 'templates/ambox.less';
.collapsible td {
width: auto !important;
}
.content {
.vertical-navbox,
.navbox {
display: none;
}
// Hide cleanup templates by default to non-javascript users as these stop them from reading the article itself
// Edit page notices
.action-edit .fmbox,
// Talk page informational boxes
.tmbox,
#coordinates,
// Hide article badges, clean-up notices, stub notices, and navigation boxes
.topicon {
// It's important as some of these are tables which become display: table on larger screens
display: none !important;
}
table {
// A lot of templates introduce floating and horizontal margins inline styles
float: none !important;
margin-left: 0 !important;
margin-right: 0 !important;
&.infobox {
font-size: 90%;
position: relative;
border: 1px solid @colorGray14;
margin-bottom: 2em;
background-color: @colorGray15;
display: flex;
flex: 1 1 100%;
flex-flow: column nowrap;
th, td {
vertical-align: top;
border: 0;
border-bottom: 1px solid @colorGray14;
padding: 7px 10px;
}
tbody > tr > td,
tbody > tr > th {
flex: 1 0;
}
td:only-child,
th:only-child {
width: 100%;
}
tr:last-child th,
tr:last-child td {
border: 0;
}
}
&.infobox > tbody,
&.infobox > caption {
display: flex;
flex-flow: column nowrap;
}
&.infobox > tbody > tr {
min-width: 100%;
display: flex;
flex-flow: row nowrap;
}
}
// Hack to assign info boxes properly when using RTL languages on LTR wiki
.mw-content-ltr table.infobox {
/* @noflip */
text-align: left;
}
// Hack to assign info boxes properly when using LTR languages on RTL wiki
.mw-content-rtl table.infobox {
/* @noflip */
text-align: right;
}
}
// FIXME: Remove when filetoc is stripped from file pages a la table of contents (toc)
#filetoc {
display: none;
}
/* bug 34878: Set an optimal width for a column.
* Makes sure that on small screens column-count is only honored if column-width hint is not violated.
* https://developer.mozilla.org/en-US/docs/CSS/column-width
*/
.references-column-count,
.column-count {
-moz-column-width: 35em;
-webkit-column-width: 35em;
column-width: 35em;
}
// When JavaScript is disabled clarify to the user which reference they clicked on
.references li:target {
background-color: #def;
}
.hatnote,
.dablink,
.rellink {
padding: 5px 7px;
color: @colorGray5;
font-size: 0.8em;
background-color: @colorGray15;
margin-bottom: 1px;
overflow: hidden;
a {
color: @colorProgressive;
}
}
@media all and ( min-width: @width-breakpoint-tablet ) {
// When in the HTML these should be revealed at tablet resolution (T172078)
.content {
.vertical-navbox,
.navbox {
display: inherit;
}
}
}
// Hacks to render galleries and multicol tables better on mobile
@media all and ( max-width: @width-breakpoint-tablet ) {
.content {
table {
// Make {{col-beg}}, {{col-break}}, and {{col-end}} templates display single column tables
&.multicol {
> tr > td,
> tbody > tr > td {
display: block !important;
width: auto !important;
}
}
}
// Deal with Template:Multiple_image. T38030 and T148505
.thumb .thumbinner {
.flex-display( flex );
justify-content: center;
flex-wrap: wrap;
align-content: flex-start;
// avoid image child overflowing the container (T200518)
// stylelint-disable-next-line declaration-block-no-redundant-longhand-properties
flex-direction: column;
> .thumbcaption {
.flex( 1, 0, 100% );
display: block;
}
}
}
}