Commit Graph

123 Commits

Author SHA1 Message Date
jdlrobson c0f48624c7 Print: Logo styles should apply in printed media
Bug: T253842
Change-Id: I7875795f12bb3e5e01e18aeb1e54ccfe7e44a020
2020-07-29 11:15:08 -07:00
jenkins-bot eeb6182a91 Merge "Restrict image border to images in border" 2020-07-28 18:30:02 +00:00
Volker E 89114e38ac MenuTabs: Remove IE 8 fallback
Also removing the image. `rgba()` for the win.

Change-Id: Ieeb33c6af1019df97ae641a017a970ce2e0ec8ff
2020-07-23 18:13:31 -07:00
Volker E 389141651b Remove unused images
All those have been lingering while not being used for a while.
- arrow* files are part of core 'mediawiki.icon' module
- 'link-icon.png' is without any reference nor clear original usage
- 'magnify-clip.png' is part of core 'mediawiki.skinning' module
- 'search-fade.png' was used in #simpleSearch before it got unified with
  Design Style Guide components

Change-Id: I985d3ec25b26eea359ce3dbf5abbe4647bc37ab4
2020-07-23 18:04:26 -07:00
Volker E 5b5378a54f Replace deprecated `background-image-svg()` mixin calls
Use normal `background-image` properties with SVGs only now
that IE 8 and Android 2.1 is removed from Grade C.
Also removing all PNG fallback images.

Bug: T248062
Change-Id: Ib91cd0514d331ab6a0f8b668aef6991cf3267fe2
2020-07-23 17:50:31 -07:00
jdlrobson 01dd41a0b3 Restrict image border to images in border
In future we will be displaying the header and logo in the print
display - to avoid adding unnecessary borders scope this rule.

Bug: T253842
Change-Id: I123b73fcaa09c0213914ca6fd8074a1305814529
2020-07-23 10:37:36 -07:00
jenkins-bot d09649250d Merge "Make collapsible code more resilient" 2020-07-20 22:08:07 +00:00
Jan Drewniak a8c79f3d52 Add config to disable sidebar state persistence for logged-in users.
Bug: T255727
Change-Id: Id28e0bc5249ba68b5de2a078a259e9964f619ef7
2020-07-17 09:32:21 -07:00
jdlrobson 17a07e4c76 Make collapsible code more resilient
$.collapsibleTabs.getSettings can return undefined so the code
should take this into account

Bug: T177108
Change-Id: I2630a2ba2884542869748047ab84752543072647
2020-07-16 14:17:30 -07:00
jenkins-bot 3651b41cb0 Merge "Max-width layout: Make page container fill viewport if content height is small" 2020-07-15 05:15:23 +00:00
Nicholas Ray acf42aa48f Max-width layout: Make page container fill viewport if content height is small
This will help mitigate the sidebar overflowing the page container
(related to T257518). Note that this does not prevent the overflow from
happening as the sidebar can still be longer than the viewport, but it
should reduce the number of times it can happen.

Bug: T257518
Change-Id: Id7138b4d4459242772bee8e11dc7edeaf76b3ca0
2020-07-14 17:20:06 -06:00
jdlrobson 018f30c615 [Refactor] Simplify searchbox layout rules
Follow up to I340b9e7e91960713c0ebb4d3d26e2ae2d5628f37

The layout styles reference internal CSS classes within
Vector components that may change at any time.

For legacy layout, I leave the styles the same (they have a FIXME)
As Aron noted on code review the impact such a change
could have on user styles. For modern however I simplify the styles
as follows:
* The top margin on the form is promoted to the main element - this has
the same end result.
* Likewise the width dimensions are moved from child elements to
the parent


Bug: T249363
Change-Id: If923a5dddaac6217462e75d476e07d923ee1743f
2020-07-14 21:02:03 +00:00
AronDemian ba8ec2f842 Split Searchbox layout styles for legacy and modern
No changes made to the CSS rules.
* 'SearchBox.less' is the common part that won't change in modern.
* layout styles copied to both 'layout.less'

Bug: T249363
Change-Id: I340b9e7e91960713c0ebb4d3d26e2ae2d5628f37
2020-07-14 13:01:35 -07:00
Nicholas Ray d5cb58b3f0 Max-Width Layout: Make footer width match content width to avoid overlap with sidebar
* `mw-content-container` now wraps the footer (as well as the content)
because we want the footer to match the content width at all times and
to expand with the content when the sidebar is closed (at small viewport
widths or when on history/special pages)

* `mw-footer-container` margins were replaced with padding to avoid
issues with margin collapsing.

* Applied a white background to sidebar to handle the case of the
sidebar overflowing the `mw-page-container`. When that happens, we at
least want the text in the sidebar to be legible.

* Closely related, `mw-page-container`'s `overflow: hidden` style was
removed to prevent `mw-page-container` from cutting off the sidebar. The
purpose of this style was make it appear as if the sidebar was being
hidden by `mw-page-container`, but tweaking the sidebar's translation
animation to achieves this effect as well.

Bug: T257518
Change-Id: I89edf89b2ac4abe2053f0c9b366f143133ff420f
2020-07-13 18:26:18 -06:00
jenkins-bot 02c44e7302 Merge "[docs] Fix typos in comments" 2020-07-10 22:22:56 +00:00
Jan Drewniak 2b5857f624 Add enter/spacebar keyboard support to sidebar.
Bug: T255727
Depends-On: I388ac873997aa02d713ae7453216e0cb7d983993
Change-Id: Ie438db4f752c77aa40191d2bceb83f52d3371c6c
2020-07-09 22:38:15 +02:00
Volker E aaf8b7721a [docs] Fix typos in comments
Following-up Ib1ce934f3646cd8fe.

Change-Id: Id32cbfb5256d55e6c9d8b081a126ca0275b7565d
2020-07-09 00:47:27 -07:00
Jan Drewniak 1fac82f895 Sidebar persistence for logged-in users in modern Vector.
- Creates a new user-preference called 'VectorSidebarVisible'
which stores the sidebar hidden/collapsed state for logged-in
users.
- Updates that user-preference on the client whenever the sidebar
is expanded or collapsed.
- Refactors the sidebar related javascript into a separate file.

Bug: T255727
Change-Id: Ib1ce934f3646cd8feebf0d3b15c38b5b969ec957
2020-07-09 00:28:52 +02:00
jenkins-bot 36a1516f96 Merge "Implement Page, Workspace, Content, and Article Toolbar Containers" 2020-07-08 01:21:49 +00:00
Nicholas Ray 092a2957af Implement Page, Workspace, Content, and Article Toolbar Containers
This patch closely follows the desired guidelines/desired
styles Alex Hollender has put forth in his prototype, but uses
multiple containers to achieve this look since our DOM order/structure
is different than the DOM structure in the prototype. The following
containers are used, but unlike his prototype, they are sometimes used
more than once:

* Page Container: Contains every other container and limits the overall
max-width of the white part of the page.

* Workspace Container: Contains the sidebar and content container. The
sidebar is displaced ~30 pixels to the start (left) of the workspace
container at all times.

* Content Container: Contains the content. The max-width of this changes
depending on whether you are on a special page/history page vs. other
pages.

* Article Toolbar Container: Contains the article toolbar. The max-width
of this is always the same as the max-width of the article content as we
don't want the toolbar to move when going from the article page to the
history/special page.

Changes to be aware:

* To test locally, `$wgVectorLayoutMaxWidth = true;`. This design is
temporarily feature flagged and defaults to being "off".

* Note that layout-max-width.less is a temporary file made to meet the
feature flag requirement of T246420 (intended to derisk the deployment).
After the deploy, we should merge most if not all of the rules into
layout.less where the max-width design will become the default.

* Per Jon's code review comment, I have relaxed the indenting of
skin.mustache to make the diff easier to reason about. If desired, the
correct indenting can be achieved in a (much less risky) follow-up
commit.

Bug: T246420
Bug: T153043
Change-Id: Ie49f629bc705850c6996164a516957476c034048
2020-07-07 18:34:38 -06:00
jdlrobson 04bcd93adf Logo shouldn't import layout
This explains a few issues that were occuring in the storybook
relating to modern/legacy.

Follow up to 5195f5fd6 which doesn't reference why.

Components should not import styles relating to one of the Vector
versions. They should all be self contained.

Change-Id: I6f9ef974be97f8be593cd2b79ce37c3e517d549f
2020-07-07 22:22:24 +00:00
Ed Sanders 36e91dc04f build: Update devDependencies
Applies new ESLint documentation rules

Change-Id: I7fe458cf52e98baf92f3baec2d9ff54484326673
2020-07-01 14:43:39 -07:00
jenkins-bot 9a1897be82 Merge "Use core `.mixin-clearfix()` instead of DOM element" 2020-07-01 18:45:47 +00:00
Volker E a9b35fa2e4 Use core `.mixin-clearfix()` instead of DOM element
Removing  presentational `<div class="visualClear"></div>` in process.
Only leaving in for legacy/layout.less and adding comment for future
evaluation if clearfix is continuously needed. In modern we've
got all parts of Vector in our awareness without featuring `float`s.

Bug: T254195
Depends-On: Iddf8f1dffc2d30299b89b3f4966b7fe8ee63090b
Change-Id: I673c28c2d7da4f96c31121d9aec6558e390de24e
2020-07-01 11:20:26 -07:00
Nicholas Ray b40c3f3743 Update CheckboxHack interface for future placement of `aria-expanded` on label button
Currently, the `aria-expanded` attribute is placed on the checkbox
element. However, since Ife287fc8c6e0d2aee5facf42d5d4308dea918ee3, the
checkbox is excluded from the accessibility tree, and this attribute
should be placed on the label button instead.

This commit prepares for future changes [1] to the checkbox hack interface
in a backwards compatible way:

* Passes button to `updateAriaExpanded` function

* Passes button to `bindUpdateAriaExpandedOnInput` function

[1] Ia2755e189babbd70945b66a1a812fc3ece40b577

Change-Id: Icc6ba994d57ea1f8050aa408aebc8c81f03d8783
2020-06-29 13:31:24 -06:00
Nicholas Ray bfc95effdb Move sidebar into header to improve tab order
* Moves the sidebar into the header so that user can tab directly from
the sidebar button into the sidebar (when open).

* Because the sidebar is absolutely positioned inside the header and the
header applies a top-margin, we need to adjust the top position
calculation for the sidebar.

* Removes the checkbox from the accessibility tree through CSS `display:
none;` instead of HTML attributes.

* Given that the checkbox is not able to receive focus, the
`#mw-sidebar-checkbox:focus ~ .mw-header .mw-checkbox-hack-button` CSS
rule is obsolete and moved instead to the label button. An additional
outline: 0 rule was added to remove the dotted outline that Firefox
applies.

* Makes the "Skip to navigation" jump link point to the sidebar now.
After the sidebar has been tabbed through, the rest of the navigation
can be tabbed to.

Bug: T246420
Change-Id: I981da3650854568bb9cfbf3c6c59e7625e7d094c
2020-06-25 16:55:34 -06:00
Volker E d2a0ae588a [less] Merge 'content.less' and 'typography.less'
This separation introduced in I8dbc29b7a19f7f doesn't work as well
as expected. All but strictly `.mw-jump-link` rule are typographic
rules.
In the current mish-mash of when to apply typographic styles only to
article content (`.mw-body`, `mw-body-content`, `.mw-parser-output`,
`#mw-data-after-content`?) inherited from core, it makes looking up
and finding issues between typographic styles harder, and leads to
unnecessary complexity instead of clean separation of concerns.
This question surfaced in where would link styles belong originated in
T213778.

Change-Id: I521185d505d8688f076dd09acbedb22e801f772e
2020-06-25 18:45:19 +00:00
AronDemian 2ccc975f0a [modern] Move sidebar checkbox above content, sidebar button into header
- Sidebar's checkbox hack CSS selectors adjusted.

Bug: T246420
Change-Id: I1cc1ad4eb1938c4931b1ae881b3878fbd6bb7a39
2020-06-23 07:09:38 +02:00
jenkins-bot 72afb66fb8 Merge "[less] Move `margin` and `padding` on `body` only" 2020-06-17 00:08:47 +00:00
AronDemian 772fb26683 Restore Watchlist star
Fixup for I8669d402b6b757cd5bf59a5e0df377b6023b0700:
Applied `.vector-tabs` selector instead of `.vector-menu-tabs`
Class `vector-menu-tabs` is added by VectorTemplate.php#383

Bug: T255574
Change-Id: Iae8176221662aa47dcd69123e9dd6a9d6693cd42
2020-06-16 19:09:44 +02:00
jenkins-bot 7ec918c3b8 Merge "[less] Remove default, already inherited user-agent properties" 2020-06-16 00:18:35 +00:00
Volker E 5691e4c7c4 [less] Move `margin` and `padding` on `body` only
Both properties are needed for normalizing different browsers (`padding`
infamous on older Operas) and are only needed on `body`.

Change-Id: I661869ed43491824cbfe86dc36e39f97e29ccf8a
2020-06-15 17:05:54 -07:00
Volker E 922daba0a9 [less] Remove default, already inherited user-agent properties
Also describe #simpleSearch reasoning clearer.

Change-Id: Ief3ebe9b1f1c519d6424dd8495a3522889efbbbc
2020-06-15 16:10:25 -07:00
jenkins-bot a2864cb5ef Merge "[less] Normalize focus styles in Blink based browsers" 2020-06-15 22:44:28 +00:00
Volker E 97566a026b [less] Amend subtle color to WikimediaUI Base default
Replace former non-base variables color with one from the standard
variables files in preparation for iit's usage in core and Vector.
Color is still confirming to WCAG level AA contrast ratio.

Bug: T254474
Change-Id: I06d981f05554b6429d11f19b8f5848ba5a7441a0
2020-06-15 22:20:41 +00:00
Volker E 41b0b6c434 [less] Normalize focus styles in Blink based browsers
Normalizing focus styles in Blink based browsers and aligning to
Design Style Guide components.

Bug: T245887
Change-Id: I4d571dcbbada5edffbfee631c8b438cf7c8d273a
2020-06-15 22:20:30 +00:00
jenkins-bot 7786fd9d1f Merge "[less] Extract cross-browser normalization rules into new 'normalize.less'" 2020-06-12 22:40:20 +00:00
Volker E 35b2f65914 [less] Extract cross-browser normalization rules into new 'normalize.less'
Change-Id: I23da024b47020212173380315acd37210b924327
2020-06-12 20:33:46 +00:00
AronDemian 22a8b6c5d5 Fix dropdown menu checkbox hack's CSS selector
`ul.vector-menu-content-list` was wrapped into `div.vector-menu-content`, thus becoming the sibling of
`input.vector-menu-checkbox`:
https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/589395/39/includes/templates/Menu.mustache#15
Rename of `.vectorMenuCheckbox` to `.vector-menu-checkbox`:
https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/597849/7/includes/templates/Menu.mustache#7

Follow-up to: Id59234aa6b822a24848386bdc04d8d7ed37ca145 and I00b4d2fd795195cd9c8add650a3b3cafdced5465

Bug: T255069
Change-Id: I299f4648acf83d2abdad274851e0960fe09a70b1
2020-06-12 14:06:27 +02:00
jenkins-bot f92df81fc5 Merge "[less] Put element selectors in the right place" 2020-06-12 00:07:22 +00:00
Volker E 0b1abe7a03 [less] Put element selectors in the right place
Element selectors need to come before class selectors.

Change-Id: I278adf4c5eb19e64fd0e2afdd4416dd45077389f
2020-06-11 16:41:44 -07:00
Volker E 7e7bdb4f54 Replace deprecated classes with modern ones
Following-up I00b4d2fd795195cd9c8add650a3b3cafdced5465
it's now time to settle on `.vector-menu*` classes.

Change-Id: I8669d402b6b757cd5bf59a5e0df377b6023b0700
2020-06-11 14:05:15 -07:00
jenkins-bot 23393d3685 Merge "Fix portal heading border in Safari" 2020-06-09 20:54:26 +00:00
Stephen Niedzielski 3003724a3a [fix][Less] disable sidebar animations on page load
There's a longstanding Chrome bug that causes CSS transitions to show in
their terminal states. This patch works around the issue by limiting
transitions to JavaScript users only via the `client-js` class which is
added to the root `html` Node some time after page content loads. The
effect is a better overall experience for everyone but transitions
unfortunately no longer appear for no-JS devices.

I am unable to reproduce this issue in Vector's configuration. This
patch should only be merged as a last resort.

Bug: T246419
Bug: T234570
Change-Id: Ifcb2bf1fddb85113a4858b7a210ded3954952e6e
2020-06-09 12:18:59 -06:00
Volker E 3888b4075e Fix portal heading border in Safari
By using `rgba()` instead of `transparent` the color gradient
calculation works as expected in Safari as it does in all
other browsers.
Also using same distance 33%/66% for gradient start and end.

Bug: T254489
Change-Id: I64ec6aa51a9ea931a2351c9c7a9ffaf28c8d130b
2020-06-08 14:02:09 -07:00
bkudiess-msft 3eea85aad9 Fixes "Contributions" control gets Overlapped in 200% Zoom mode
Bug: T253599
Change-Id: I37fa8b75982a2347bced878ae83e10e1af61360c
2020-06-05 00:29:18 +00:00
Stephen Niedzielski a0d2c2497b [fix][RTL] flip menu collapse button icon
Fix the icon button directionality in right-to-left languages.
Previously, the button was hardcoded to support left-to-right only.

- Replace the skin.vector.icons' `.mw-ui-icon-wikimedia-{name}:before`
  `selector` in skin.json with a placeholder, `{name}`. I don't think
  this selector should be needed but it seems to be erroneous not have
  one. I believe this issue of wanting a null selector was encountered
  in Minerva or MobileFrontend but am unable to locate the past
  discourse.

- Add check and unchecked menu button selectors to skin.json that set
  the appropriate background image. This shards some of the styles out
  of Less and into ResourceLoader-land but it's worthwhile.

- Revise the name of horizontal collapse icon to describe its form not
  function, "collapseHorizontal" to "chevronHorizontal". This has been
  an established convention that was missed a couple patches back.

- Add a flipped chevronHorizontal for RTL. I used Inkscape to do the
  flip and tried to match the style of the original by hand. Feel free
  to edit further.

- Drop the now unnecessary icon flipping JavaScript and initial Mustache
  class. This enables a real CSS-only solution for the icons.

Bug: T246419
Change-Id: I60f65b3c595bf18d309b667d9a0b066691b90c97
2020-06-03 17:09:38 -06:00
Volker E fd250975c4 Fix misconception on icon coloring
It's advisable to rely on default icon color and set it's color
by opacity. With that we've got a better playing field to respond
to user interaction with icon color changes, not relying on
several icons at once for different states and also being
backwards-compatible for a variety of browsers.

Change-Id: Iaff869774007ed962104d704103f0392a3516f4f
Bug: T246419
2020-06-02 23:06:49 -06:00
Volker E 4b30bceda3 [dev] Remove outdated selector now that cache has expired
Change-Id: Ia3f914c96f03e3c70c3cb4c8d7de96f34cb4b1f5
2020-06-01 21:45:08 +00:00
Stephen Niedzielski 909cbaac11 [fix][a11y][Less] use percentage for sidebar button icon size
The sidebar button's icon previously used pixel dimensions while the
button itself uses ems. This caused the button to scale with the user's
font such that the icon is distorted and unrecognizable.

This patch drops the vertical margin and sets the icon height to 100%.
The width is proportionally constrained so the effect is that the icon
may grow with the button but the margin stays consistently at 12px.

This approach deviates from other items in the header (globe,
notifications) and tab bar (watchstar, search icon), that were 
historically implemented without the user text zoom capability in mind.

Bug: T246419
Change-Id: I2ae46fd49dcb619004587b8b3560b9115c3bdaaa
2020-06-01 21:08:02 +00:00