2019-10-25 20:46:51 +00:00
|
|
|
@import 'mediawiki.ui/variables.less';
|
2017-07-20 21:58:01 +00:00
|
|
|
|
2019-09-18 22:26:38 +00:00
|
|
|
@font-size-root: 100%;
|
2018-10-09 19:29:58 +00:00
|
|
|
@font-size-browser: 16; // Assumed browser default of `16px`
|
2014-08-07 11:38:34 +00:00
|
|
|
|
2020-03-07 09:27:37 +00:00
|
|
|
//
|
|
|
|
// == Typography ==
|
|
|
|
//
|
|
|
|
// Detailed documentation of the font choices:
|
|
|
|
// https://www.mediawiki.org/wiki/Wikimedia_User_Interface/Use_cases/Font_family_stack
|
|
|
|
// Source of this font stack definition in WikimediaUI Base:
|
|
|
|
// https://phabricator.wikimedia.org/source/wikimedia-ui-base/browse/master/wikimedia-ui-base.less$202
|
|
|
|
// See T73240 for a related discussion concerning the serif font stack.
|
|
|
|
// Note: Numbers in Georgia font are non-lining, the font-feature to change this is documented at:
|
|
|
|
// https://www.mediawiki.org/wiki/Talk:Typography_refresh/Archive_2#Numbers_looks_weird_in_article_title
|
|
|
|
|
|
|
|
@font-family-serif:
|
|
|
|
'Linux Libertine', // GNU+Linux, alternative to Times New Roman.
|
|
|
|
'Georgia', // Windows, intended as a serif typeface that would appear elegant but
|
|
|
|
// legible printed small or on low-resolution screens.
|
|
|
|
'Times', // Windows, very similar to Times New Roman with subtle differences.
|
|
|
|
serif; // Platform default: 'Times New Roman' on Windows.
|
|
|
|
|
|
|
|
//
|
|
|
|
// Body content uses the user setting in browser / the system default sans-serif font:
|
|
|
|
// Arial on Windows, Roboto on Android.
|
2019-09-26 22:48:15 +00:00
|
|
|
// FIXME: Use WikimediaUI Base's OS specific default sans-serif fonts.
|
2020-03-07 09:27:37 +00:00
|
|
|
|
2019-09-26 22:48:15 +00:00
|
|
|
@font-family-sans: sans-serif;
|
2020-03-07 09:27:37 +00:00
|
|
|
|
|
|
|
// Fallback for headings, language: ja,he,ko. See T73240,T65817,T65843,T65844,T65827.
|
2019-09-26 22:48:15 +00:00
|
|
|
@font-family-sans--fallback: sans-serif;
|
2017-07-25 21:41:00 +00:00
|
|
|
|
2020-03-07 09:27:37 +00:00
|
|
|
//
|
|
|
|
// == Page content ==
|
|
|
|
//
|
|
|
|
|
2019-09-26 21:12:01 +00:00
|
|
|
@background-color-base: #fff;
|
2020-04-15 16:30:22 +00:00
|
|
|
@color-base: #202122;
|
2019-09-30 06:36:58 +00:00
|
|
|
@color-base--emphasized: #000;
|
2019-09-26 21:12:01 +00:00
|
|
|
@color-link: #0645ad;
|
2019-09-30 06:36:58 +00:00
|
|
|
@color-link--visited: #0b0080;
|
|
|
|
@color-link-new: #a55858;
|
2019-09-26 21:12:01 +00:00
|
|
|
@color-link-selected: @color-base;
|
|
|
|
|
2019-09-26 23:43:42 +00:00
|
|
|
@font-size-base: unit( 14 / @font-size-browser, em ); // Equals `0.875em`.
|
|
|
|
@font-size-reset: @font-size-root;
|
2019-09-27 17:49:02 +00:00
|
|
|
@font-size-heading-1: 1.8em;
|
2019-09-26 23:43:42 +00:00
|
|
|
@font-size-heading-2: 1.5em;
|
|
|
|
@font-size-heading-3: 1.2em;
|
|
|
|
@font-size-notification: 0.8em;
|
|
|
|
@font-size-site-notice: 0.8em;
|
2019-09-27 04:25:59 +00:00
|
|
|
@line-height-base: 1.6;
|
|
|
|
@line-height-heading: 1.3;
|
|
|
|
@line-height-code: 1.3;
|
|
|
|
@line-height-footer-info: 1.4;
|
|
|
|
@line-height-footer-buttons: 2;
|
2019-09-26 23:43:42 +00:00
|
|
|
|
2014-08-07 11:38:34 +00:00
|
|
|
// FIXME: Use global variable since Echo and CentralNotice use this variable
|
2019-09-28 07:25:09 +00:00
|
|
|
@border-color-content: #a7d7f9;
|
2017-10-08 02:58:20 +00:00
|
|
|
// Due to darker background gradient, border needs to be darkened for aligned visual perception.
|
|
|
|
@border-color-content--tabs-inactive: darken( @border-color-content, 10% );
|
2019-09-28 06:24:34 +00:00
|
|
|
@padding-content: 1em;
|
2014-08-07 11:38:34 +00:00
|
|
|
|
|
|
|
// Navigation
|
2019-09-26 21:12:01 +00:00
|
|
|
@background-color-secondary: #f6f6f6;
|
2019-09-29 20:21:41 +00:00
|
|
|
@color-nav-subtle: #444;
|
2019-09-27 04:25:59 +00:00
|
|
|
// Navigation `line-height` has to be set in `em`s due to a rendering calculation issue.
|
2019-09-29 20:21:41 +00:00
|
|
|
@line-height-nav: 1.125em;
|
2014-08-07 11:38:34 +00:00
|
|
|
|
2019-09-29 20:21:41 +00:00
|
|
|
// Navigation: Main
|
|
|
|
@font-size-nav-main: inherit;
|
2014-08-07 11:38:34 +00:00
|
|
|
|
2019-09-29 20:21:41 +00:00
|
|
|
@font-size-nav-main-heading: unit( 12 / @font-size-browser, em ); // Equals `0.75em`.
|
2014-08-07 11:38:34 +00:00
|
|
|
|
2019-09-29 20:21:41 +00:00
|
|
|
@font-size-nav-main-body: unit( 12 / @font-size-browser, em );
|
Add opt-out link to Sidebar for Vector/Logged-in Users Without Abstractions
This commit is singularly focused on adding a link to the sidebar for
Vector, logged-in users. It does the bare minimum to fulfill the
requirements of T243281.
Additionally, it will help to answer the question "Do we need to use
abstractions (other than maybe different templates) to separate Legacy
Vector from Vector" by intentionally leaving out any abstractions in
order to make it easier to compare with a follow-up patch
(Ib2ef15180df73360cc1de25b893e49d415d23e1a) which does use abstractions.
It is a good thing to question whether or not we need addtional
abstractions in VectorTemplate and if they will help us as unnecessary
abstractions can have the opposite effect and just lead to further
frustrations down the road.
Therefore, I urge you, the reviewer, to let me know your thoughts! If
abstractions are viewed as not making our lives any easier, the
follow-up patches may be completely discarded and that's totally okay
with me. :) I think it's a good think to talk about now though.
Important changes:
* The VectorTemplate constructor was changed to allow injecting the
config, templateParser, and isLegacy boolean (only the config was
allowed before this commit). According to MediaWiki's Stable Interface
Policy, "Constructor signatures are generally considered unstable unless
explicitly declared stable for calling" [3]. Given that VecorTemplate's
constructor is not marked as stable, it is justified to do this without
warning according to the policy.
* Due to the above, the 'setTemplate' method is no longer needed and was
marked as deprecated.
* VectorTemplateTest was made to adapt to the new VectorTemplate
constructor. Additionally, it now extends from
MediaWikiIntegrationTestCase which my intelliphense server can pick up.
I *think* MediaWikiTestCase is just an alias to
MediaWikiIntegrationTestCase [1] and MediaWikiTestCase file was renamed
to MediaWikiIntegrationTestCase in [2], but I'm willing to change it
back if there is pushback to this.
Open questions:
* What are VectorTemplate's responsibilities? To me, it acts right now
as a controller (because it echos the full HTML string from the
template), a model (because SkinTemplate::prepareQuickTemplate sets data
on it which it later retrieves through `$this->get()`), a presenter
(because it adds data tailored for a web-centric view), and a view
(because it renders HTML strings instead of letting the view/template be
solely responsible for that). Arguably, some business logic might be
mixed in there as well (because it checks to see if a User is logged
in/has necessary permissions to show x which my changes here add to).
This might not be a problem if we keep VectorTemplate relatively small,
but will it remain this way as we progress further in Desktop
Improvements?
* How do we write tests for VectorTemplate without exposing unnecessary
public methods? For example, if I want to test the `getSkinData()`
method to see what state will be sent to the template, how should I do
this? One option might be to use `TestingAccessWrapper` to expose these
private methods which is what
`VectorTemplateTest::testbuildViewsProps()` does. Another option is to
accept this method as public. Is there a better way? Keep in mind that
even with access to this method, there might be many things to mock.
[1] https://github.com/wikimedia/mediawiki/blob/0030cb525be6cabc1d63de80586b2017d4bbe354/tests/common/TestsAutoLoader.php#L64
[2] Ie717b0ecf4fcfd089d46248f14853c80b7ef4a76
[3] https://www.mediawiki.org/wiki/Stable_interface_policy
Bug: T243281
Change-Id: I0571b041bcd7f19bec9f103fa7bccdd093f6394d
2020-03-17 20:21:33 +00:00
|
|
|
@margin-start-nav-main-body: 0.5em;
|
|
|
|
|
|
|
|
// Navigation: Portal
|
|
|
|
// Font size of the Portal links.
|
|
|
|
@font-size-portal-list-item: @font-size-nav-main-body;
|
|
|
|
|
|
|
|
// Margin space from the start of the Portal (left edge in LTR
|
|
|
|
// languages).
|
|
|
|
@margin-start-portal: 0.7em;
|
|
|
|
|
2020-03-27 16:15:30 +00:00
|
|
|
// Margin space from the end of the Portal (right edge in LTR
|
|
|
|
// languages).
|
|
|
|
@margin-end-portal: 0.6em;
|
|
|
|
|
Add opt-out link to Sidebar for Vector/Logged-in Users Without Abstractions
This commit is singularly focused on adding a link to the sidebar for
Vector, logged-in users. It does the bare minimum to fulfill the
requirements of T243281.
Additionally, it will help to answer the question "Do we need to use
abstractions (other than maybe different templates) to separate Legacy
Vector from Vector" by intentionally leaving out any abstractions in
order to make it easier to compare with a follow-up patch
(Ib2ef15180df73360cc1de25b893e49d415d23e1a) which does use abstractions.
It is a good thing to question whether or not we need addtional
abstractions in VectorTemplate and if they will help us as unnecessary
abstractions can have the opposite effect and just lead to further
frustrations down the road.
Therefore, I urge you, the reviewer, to let me know your thoughts! If
abstractions are viewed as not making our lives any easier, the
follow-up patches may be completely discarded and that's totally okay
with me. :) I think it's a good think to talk about now though.
Important changes:
* The VectorTemplate constructor was changed to allow injecting the
config, templateParser, and isLegacy boolean (only the config was
allowed before this commit). According to MediaWiki's Stable Interface
Policy, "Constructor signatures are generally considered unstable unless
explicitly declared stable for calling" [3]. Given that VecorTemplate's
constructor is not marked as stable, it is justified to do this without
warning according to the policy.
* Due to the above, the 'setTemplate' method is no longer needed and was
marked as deprecated.
* VectorTemplateTest was made to adapt to the new VectorTemplate
constructor. Additionally, it now extends from
MediaWikiIntegrationTestCase which my intelliphense server can pick up.
I *think* MediaWikiTestCase is just an alias to
MediaWikiIntegrationTestCase [1] and MediaWikiTestCase file was renamed
to MediaWikiIntegrationTestCase in [2], but I'm willing to change it
back if there is pushback to this.
Open questions:
* What are VectorTemplate's responsibilities? To me, it acts right now
as a controller (because it echos the full HTML string from the
template), a model (because SkinTemplate::prepareQuickTemplate sets data
on it which it later retrieves through `$this->get()`), a presenter
(because it adds data tailored for a web-centric view), and a view
(because it renders HTML strings instead of letting the view/template be
solely responsible for that). Arguably, some business logic might be
mixed in there as well (because it checks to see if a User is logged
in/has necessary permissions to show x which my changes here add to).
This might not be a problem if we keep VectorTemplate relatively small,
but will it remain this way as we progress further in Desktop
Improvements?
* How do we write tests for VectorTemplate without exposing unnecessary
public methods? For example, if I want to test the `getSkinData()`
method to see what state will be sent to the template, how should I do
this? One option might be to use `TestingAccessWrapper` to expose these
private methods which is what
`VectorTemplateTest::testbuildViewsProps()` does. Another option is to
accept this method as public. Is there a better way? Keep in mind that
even with access to this method, there might be many things to mock.
[1] https://github.com/wikimedia/mediawiki/blob/0030cb525be6cabc1d63de80586b2017d4bbe354/tests/common/TestsAutoLoader.php#L64
[2] Ie717b0ecf4fcfd089d46248f14853c80b7ef4a76
[3] https://www.mediawiki.org/wiki/Stable_interface_policy
Bug: T243281
Change-Id: I0571b041bcd7f19bec9f103fa7bccdd093f6394d
2020-03-17 20:21:33 +00:00
|
|
|
// Margin space from the start of the Portal body (left edge in LTR languages).
|
|
|
|
@margin-start-portal-body: @margin-start-nav-main-body;
|
2014-08-07 11:38:34 +00:00
|
|
|
|
2019-09-29 20:21:41 +00:00
|
|
|
// Navigation: Personal tools
|
|
|
|
@background-position-nav-personal-icon: left ( 4 / @font-size-browser / @font-size-nav-personal );
|
|
|
|
@background-size-nav-personal-icon: 14 / @font-size-browser / @font-size-nav-personal;
|
2020-04-06 21:57:13 +00:00
|
|
|
@top-personal-tools: 6px;
|
2019-09-29 20:21:41 +00:00
|
|
|
@font-size-nav-personal: 0.75em;
|
2019-09-27 04:25:59 +00:00
|
|
|
// Using `unit()` without second parameter to achieve a unitless output for `line-height`.
|
2019-09-29 20:21:41 +00:00
|
|
|
@line-height-nav-personal: unit( 14 / @font-size-browser / @font-size-nav-personal ); // Equals `1.667`.
|
2019-09-18 22:26:38 +00:00
|
|
|
|
2019-09-26 23:43:42 +00:00
|
|
|
// Tabs
|
|
|
|
@font-size-tabs: unit( 13 / @font-size-browser, em ); // Equals `0.8125em`.
|
|
|
|
|
2019-09-18 22:26:38 +00:00
|
|
|
// Search
|
|
|
|
@width-search-button: 24 / @font-size-browser / @font-size-search-input;
|
|
|
|
@font-size-search-input: unit( 13 / @font-size-browser, em ); // Equals `0.8125em`.
|
2019-09-26 23:43:42 +00:00
|
|
|
|
|
|
|
// Footer
|
|
|
|
// FIXME: Currently calculates at 11.2px, which is worth nothing and unreadable for a big
|
|
|
|
// part of our audiences. Push up _at least_ to 12px.
|
|
|
|
@font-size-footer: 0.7em;
|
2020-04-02 16:50:46 +00:00
|
|
|
|
|
|
|
// Z-indices
|
|
|
|
// See skinStyles/jquery.ui/jquery.ui.datepicker.css.
|
|
|
|
// @z-index-ui-datepicker-cover: -1;
|
|
|
|
@z-index-base: 0;
|
|
|
|
@z-index-menu-checkbox: 1;
|
|
|
|
@z-index-search-button: 1;
|
|
|
|
// Ensure that this is displayed on top of .mw-body-content and clickable.
|
|
|
|
@z-index-indicators: 1;
|
|
|
|
// See skinStyles/jquery.ui/jquery.ui.slider.css.
|
|
|
|
// @z-index-ui-slider-range: 1;
|
|
|
|
// Menus must overlap indicators (@z-index-indicators) and VisualEditor toolbar (z-index: 2).
|
|
|
|
@z-index-menu: 2;
|
|
|
|
// See skinStyles/jquery.ui/jquery.ui.slider.css.
|
|
|
|
// @z-index-ui-slider-handle: 2;
|
|
|
|
// Display on top of page tabs (T39158, T50078).
|
|
|
|
@z-index-personal: 100;
|
|
|
|
// See skinStyles/jquery.ui/jquery.ui.selectable.css.
|
|
|
|
// @z-index-ui-selectable-helper: 100;
|
|
|
|
@z-index-overlay: 101;
|
|
|
|
// See skinStyles/jquery.ui/jquery.ui.tooltip.css.
|
|
|
|
// @z-index-ui-tooltip: 9999;
|