Add a skin-night-mode-page-disabled class to the HTML element when
a page was disabled by the new MinervaNightModeOptions configuration
flag.
Bug: T356653
Change-Id: I7a6582ef8f66e78cc6f07da06bc4d2a3277cfcf0
- Add config to skin.json
- Add the function in SkinMinerva.php to check exclusion of pages and namespaces.
Bug: T355705
Change-Id: I0fa0eab3bfa57cc6864dbdd2d6aeaa5582767c3c
Whereas previously, the value of the query param would simply determine
whether or not night mode was enabled, we would like to be able to
control the actual night mode setting off of the query param
Now, it functions as an option to force the user into a particular
setting, be it automatic, night, or day. If the query param is not set
(if night mode is enabled via config), we will default to the user
option as before
Bug: T355118
Change-Id: I38ed94bfc1b80d0a827c63c6dbdd92eb6f1bf531
Add a new user option, `minerva-night-mode`, and configure it with a
default value of 2 (automatic based on OS). Rework the code in
`getHtmlElementAttributes` to set the initial class value according to
the user option, which will be set and saved inside of MobileFrontend
Bug: T355118
Change-Id: I4b0d63a186f490ba10b7655b3af4dcb8b64bd400
All colors used in Minerva are converted from Less variables
into CSS custom properties. A new file called CSSCustomProperties.less
is created in the skins.minerva.base.styles module to store
these custom properties and an ADR is provided on the rationale for
dropping support for browsers that don't support custom properties.
The new CSS custom properties follow Codex design token conventions
where possible (and noted when not).
Link colors are unique because their styles are defined in core,
so in that case the Less variables values are set to custom properties.
Those values are then fed back into MediaWiki core for core link
styling.
Also adds a temporary night-mode color palette under the
.skin-nightmode-1 class on the <html> element.
Bug: T356074
Change-Id: Ida1f14138f12bd3c600c264bde7b5100f9dbf4ff
Converts all Less variable names from CamelCase to snake-case
per the MediaWiki coding conventions.
Removes the following unused Less variables, mostly
related to icons, since those were converted to Codex:
- @icon-touch-area-sm
- @icon-touch-area-md
- @min-size-icon (replaced with @size-icon-medium)
- @icon-glyph-size-sm
- @icon-size-sm
- @icon-padding-sm
- @icon-glyph-size-md
- @icon-size-md
- @margin-icon-md-labelled
Bug: T350581
Change-Id: I1b16e77942d9bea20dcc5636a63d64aa2325a173
Adds a config flag, `MinervaNightMode`, and wires it up as a skin option
for enabling/disabling the night mode toggle (sold separately)
Additionally, allow this feature to be enabled via the
`minervanightmode` query param
For now, turning the flag on will result in the class
`skin-nightmode-clientpref-1` being added to the HTML element, but in a
later change this will be updated to switch values based on the
forthcoming client pref
Bug: T355118
Change-Id: I35848ab80ee75d324ceb35d17794e2d3e620cc19
On English Wikipedia, talk tabs are enabled so this went undetected.
The history and diff pages should be loading these styles since they
both have tabs.
Bug: T356117
Change-Id: I380cc4ba9a4f809e4400873241d97de5a5fe6c1f
CHECKBOX_HACK_TARGET_SELECTOR only applies to the first list
and there are three lists in the menu. Use the parent instead.
Additional changes:
* Transform to ES6 while working on this code.
Bug: T354315
Change-Id: I354e33af872e9a2f93d97793f5f33b735d42e804
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: I1eec0823b7af97ea5031ff00b111e0c88b45a155
Currently `mw.util.addPortletLink` cannot properly add a portlet link to
the associated pages tabs, as there is no `p-associated-pages` id on
mobile. This change pulls the id from the page data, and adds the
necessary class for the tab to be styled correctly - since tabs do not
have corresponding icons while most portlet links do, we also branch on
this class (effectively on whether we are in the tab container) to
ensure an icon is not inserted
Finally, I added a few comments and spacing in the sections of code that
I touched to make them more readable and resolve some of the linter
warnings, but happy to hear if these are not helpful!
Bug: T340728
Change-Id: I33fc12611a6238552a3eb47f6ca37f087903a92a
As part of my work on fixing addPortletLink for tabs on mobile (T340728)
we need these tabs to be correctly designated as an unordered list (note,
this is also how they are rendered in Vector). In addition, update the
styles to account for the link being nested in a list item now
There should be no visual change as a result of this, but if there is
please let me know!! I will be testing locally in pixel after pushing
to ensure the change is transparent
Bug: T340728
Change-Id: I922558a59aa909ce76079bab057811d76467f644
Removes a `display: inherit` that was causing issues with the alignment of these two items in the menu. In addition, correctly sets display to none for jsonly-specified list items when client js is disabled and rename the class to make it more specific to the menu items
Note: this will have a visual impact as it is fixing what is currently a visual bug. The jsonly hiding will also not work with cached content, but since it's currently broken we figured this was acceptable
Bug: T346670
Change-Id: I56d2c4fcba09d199a0fd6aad2f1621509bbfaba5
Avoid use of the context when not needed as this is also called for
special page transclusion, avoid initialize of the skin in that newly
created context.
Change-Id: I56573491262a194f44bccb7fd6170eb7bf21c6ed
User-options related classes are being moved to the MediaWiki\User\Options namespace in MediaWiki Core; reflect that change here.
Bug: T352284
Depends-On: I9822eb1553870b876d0b8a927e4e86c27d83bd52
Change-Id: I5a540772aafd2c4686e02f748b5fc61155920397
The mediawiki.diff.styles can be loaded on pages other than the diff
page itself, so it is better to move this logic into SkinMinerva and
avoid outputting it for diff pages full stop.
Note this module is loaded on Special:MobileDiff and desktop
Minerva history page (without redirect) so we need to cater
for both cases.
Bug: T350515
Change-Id: If2d908b7cbe257184e0c899f78a04d4d5935ea8c
Why:
Minerva uses watchstar both as a client to action=watch
and as a CTA prompting users to create a new account.
To prevent error messages about permissions from being
displayed when logged in as a temp account (or not logged in
at all), the API requests should be only sent when users
actually has watchlist permissions.
This patch fixes that by only passing data-mw=interface when
the watchstar is actually used as part of MW watchlist interface,
ie. when user is logged in. That means the `mediawiki.page.watch.ajax`
module in core can avoid the watchstar element when it is not meant
as a watchstar, but as a "sign up" CTA button.
What:
* Make it possible to change (or omit) data-mw in SingleMenuEntry
by a new constructor parameter.
* Make ToolbarBuilder::createWatchPageAction omit data-mw when
user does not have watchlist permissions.
Notes: Based on coversation with Krinkle in
Ia0acdaf4dea5aa6788f89fdd73c5dba9af9f1ed7.
Bug: T344925
Change-Id: Id9d6d9e7394b52d11ac6ce0b7d33319b3a761789
empty() should only be used to suppress errors
When the type of the variable is array,
a falsy check is the same (checks for null, false and empty array)
Found by a new phan plugin (T234237)
Change-Id: If24015795219f6ff4f155c0d667472dc52a04d43
Minerva shows a watchstar for anonymous users.
Follow up to
I3c9d59f49f1b939981a7b2b450448db6736d5958
Bug: T348336
Change-Id: I36afb86f0c89c30dcb7695e1409f7c20d3dc31d1
Currently the last modified bar icon appears black rather than
white. This is because the last modified icon shares icon CSS
with the page actions in AMC.
Untie these by giving the icon in this context a different selector,
taking care to support cached HTML.
Change-Id: I98443b0dcb88911a5314092216809387b4fb80dc