Add multiple font size to frontend

Use integer value going forward as it will be easier
to manage.

Bug: T346954
Change-Id: I041a0cb21e872700ceeeddd3a39922e456aa7bb8
This commit is contained in:
Jon Robson 2023-10-13 11:03:49 -07:00 committed by Mabualruz
parent 77ea8245a6
commit 004b4c96f3
7 changed files with 25 additions and 16 deletions

View file

@ -40,8 +40,10 @@
"vector-feature-custom-font-size-name": "Type size",
"vector-feature-limited-width-0-label": "Full width",
"vector-feature-limited-width-1-label": "Limited width",
"vector-feature-custom-font-size-disabled-label": "Small",
"vector-feature-custom-font-size-enabled-label": "Standard",
"vector-feature-custom-font-size-0-label": "Small",
"vector-feature-custom-font-size-1-label": "Standard",
"vector-feature-custom-font-size-2-label": "Large",
"vector-feature-custom-font-size-3-label": "X-Large",
"vector-search-loader": "Loading search suggestions",
"vector-searchsuggest-containing": "Search for pages containing <strong class=\"cdx-typeahead-search__search-footer__query\">$1</strong>",
"vector-intro-page": "Help:Introduction",

View file

@ -57,8 +57,10 @@
"vector-feature-custom-font-size-name": "Heading label for font size",
"vector-feature-limited-width-0-label": "Label for option to disable limited width.",
"vector-feature-limited-width-1-label": "Label for option to enable limited width.",
"vector-feature-custom-font-size-disabled-label": "Label for small (legacy) font size.",
"vector-feature-custom-font-size-enabled-label": "Label for standard font size.",
"vector-feature-custom-font-size-0-label": "Label for small (legacy) font size.",
"vector-feature-custom-font-size-1-label": "Label for standard font size.",
"vector-feature-custom-font-size-2-label": "Label for large font size.",
"vector-feature-custom-font-size-3-label": "Label for x-large font size.",
"vector-search-loader": "Text to display below search input while the search suggestion module is loading",
"vector-searchsuggest-containing": "Label used in the special item of the search suggestions list which gives the user an option to perform a full text search for the term. Used in the Codex typeahead search component.",
"vector-intro-page": "Introduction or tutorial page for the wiki. Typically either Project/Help:Introduction ([[d:Q3945]]) or Project/Help:Tutorial ([[d:Q915263]]).",

View file

@ -141,14 +141,11 @@ class FeatureManager {
// Client side preferences
switch ( $featureClass ) {
case 'toc-pinned':
case 'custom-font-size':
case 'limited-width':
$suffixEnabled = 'clientpref-1';
$suffixDisabled = 'clientpref-0';
break;
case 'custom-font-size':
$suffixEnabled = 'clientpref-enabled';
$suffixDisabled = 'clientpref-disabled';
break;
default:
// FIXME: Eventually this should not be necessary.
$suffixEnabled = 'enabled';

View file

@ -1,6 +1,6 @@
{
"vector-feature-custom-font-size": {
"options": [ "disabled", "enabled" ],
"options": [ "0", "1", "2", "3" ],
"preferenceKey": "vector-font-size"
},
"vector-feature-limited-width": {

View file

@ -87,10 +87,6 @@ pre,
font-size: @font-size-base--trident-hack;
line-height: @line-height-base;
.vector-feature-custom-font-size-clientpref-enabled & {
font-size: 16px;
}
#siteSub {
font-size: 12.8px; // T311421
}

View file

@ -87,10 +87,20 @@ pre,
font-size: @font-size-base--trident-hack;
line-height: @line-height-base;
.vector-feature-custom-font-size-clientpref-enabled & {
// FIXME: Migrate `enabled` to `1`.
.vector-feature-custom-font-size-clientpref-enabled,
.vector-feature-custom-font-size-clientpref-1 & {
font-size: 16px;
}
.vector-feature-custom-font-size-clientpref-2 & {
font-size: 24px;
}
.vector-feature-custom-font-size-clientpref-3 & {
font-size: 40px;
}
#siteSub {
font-size: 12.8px; // T311421
}

View file

@ -367,8 +367,10 @@
"vector-feature-custom-font-size-name",
"vector-feature-limited-width-0-label",
"vector-feature-limited-width-1-label",
"vector-feature-custom-font-size-enabled-label",
"vector-feature-custom-font-size-disabled-label"
"vector-feature-custom-font-size-0-label",
"vector-feature-custom-font-size-1-label",
"vector-feature-custom-font-size-2-label",
"vector-feature-custom-font-size-3-label"
],
"dependencies": [
"mediawiki.user"