Commit graph

376 commits

Author SHA1 Message Date
Jon Robson 6359571312 Use light theme colors for focus colors
According to Derek
"We actually just recently updated all focus tokens
to use the same value (#36c).
This is true for both light and dark modes.

Bug: T360845
Change-Id: I277b685b85c187ff2f25d1b9280bd77e0c0e5057
2024-04-26 17:33:14 +00:00
Jon Robson 8174fe629f Remove tokens with same values in light theme
Certain tokens have the same value in night and light theme so
do not need to be specified in the night mode palette

Bug: T360845
Change-Id: Ibaf6bb1f45997bfee4fa8334948def64265917b0
2024-04-26 17:33:06 +00:00
jenkins-bot b01d9420a0 Merge "Use tokens from Codex" 2024-04-25 20:50:56 +00:00
Jon Robson 551901726d Use tokens from Codex
Bug: T360845
Change-Id: Id32a8b861aacacdfddc528882973b1043d83a5ff
2024-04-23 16:05:50 -07:00
bwang 95c4454cf9 Remove MinervaKnownTemplateHacks
Bug: T362727
Change-Id: Iccb2e15df25f35d625d88ec4e39a16f97f84b505
2024-04-22 17:33:01 +00:00
Jan Drewniak fa71422bd0 Import codex-design-tokens-experimental.css as Less file
Previously, the Less @import was followed by the
`(inline)` option, which caused the `:extend` feature
on the following lines to not work as expected.

Importing the codex-design-tokens.css file with
the `(less)` option instead produces the desired
output, i.e: `:root, .skin-invert, .notheme {...}`.

Bug: T361325
Change-Id: I58d391b4105f077ac928a698403763268d2b4171
2024-04-19 13:51:48 -04:00
jenkins-bot c6a27036af Merge "Update imports for experimental file split in Codex" 2024-04-03 04:29:11 +00:00
Roan Kattouw 94ae5c67e9 Update imports for experimental file split in Codex
Codex v1.3.6 split the -experimental.less file into -experimental.less
and -experimental.css. The former only contains the Less variables, and
the latter contains the :root {} block with CSS variables. Both files
were also renamed. Update our imports accordingly, so that we import the
right things in the right place.

Bug: T360577
Depends-On: I12813bf0db89b72aa8f2a28ccccb3477e4361ac8
Change-Id: I0b2671cb42476eb264033fd7b15e038e74046602
2024-04-02 15:43:55 -07:00
Jon Robson 480f84bc04 Define background-color-neutral in night mode palette
Bug: T357998
Change-Id: Iab5ec302274f65658885325e239329a1836cc8c3
2024-04-01 22:47:02 +08:00
Jon Robson 3ced132ce1 Define background-color-neutral-subtle in dark mode palette
Needed by categories

Bug: T357166
Change-Id: Iea31b59d00c0619567068a5ea5c440222d45ee3e
2024-04-01 09:17:11 +08:00
jenkins-bot 2a233b1542 Merge "Remove styles in hacks.less that no longer apply" 2024-03-27 21:09:16 +00:00
bwang b8a6a9c1bd Remove styles in hacks.less that no longer apply
Bug: T360387
Change-Id: I3eb7ec0c8a52a39cc97b60443cac0e6a5bba5482
2024-03-27 14:14:09 -05:00
jenkins-bot 8df385d08f Merge "Minerva should use content-tables ResourceLoaderSkinModule feature" 2024-03-26 18:29:57 +00:00
jenkins-bot 4963900d70 Merge "Update padding on <p> elements" 2024-03-25 19:36:20 +00:00
Jon Robson 8f8fd6a1e4 Minerva should use content-tables ResourceLoaderSkinModule feature
The styles in Minerva are identical to the preset in core with the
own exception being padding. Therefore use the upstream styles
and retain only the override.

Bug: T357998
Depends-On: I206e91dac7e14d80a5ffc6b533255b54dafca29a
Change-Id: I3eb07a03b3b4e2a7544e5b07de6af9f67a1c965f
2024-03-21 22:49:14 +00:00
Moh'd Khier Abualruz 5d6b866890 Rename the skin night mode classes to more readable classes
The classes:
- skin-night-mode-clientpref-0
- skin-night-mode-clientpref-1
- skin-night-mode-clientpref-2
is being replaced with
- skin-theme-clientpref-day
- skin-theme-clientpref-night
- skin-theme-clientpref-os
- Moved $forceNightMode to be a text parameter (dat|night|os)
- Keep adding the old classes to the html element, to give the ability of gradual deployment

The preference is renamed from minerva-night-mode to minerva-theme (a follow up to consider
migrating existing values will follow).

The query string minervanightmode continues to behave the same but now
accepts other values such as day, night and os.

Bug: T359983
Change-Id: Ia253de68f94236e7fe2219b736dd6084c64ce838
2024-03-19 23:12:59 +00:00
bwang 9c52c298ad Update padding on <p> elements
Bug: T358808
Change-Id: I7f13bddaf79cd9b1061a1cac03e6ab1b767fc808
2024-03-18 19:10:20 +00:00
Jan Drewniak 1d379b3baa [refactor] Re-organize CSSCustomProperties.less
Organizes the code in CSSCustomProperties.less into
3 separate groups:
- Forced night-mode,
- auto night-mode
- night-mode helpers.

Also applies `color: var(--color-base)` to both .skin-invert
and .notheme to address situations where color is
defined by inheritance.

Change-Id: I9edc6fd81416f0f40eca975381f61023ac047e47
2024-03-15 23:26:56 +00:00
jenkins-bot 6d50ae266b Merge "Set color on tables" 2024-03-11 23:33:49 +00:00
Jon Robson d1c4eec649 Set color on tables
Bug: T357998
Change-Id: I602dd9616c5452f5151fdcea729ff7ccac4711aa
2024-03-11 15:59:34 -07:00
Steph Toyofuku 1f564dfb23 Fix color for inline styles with background color in night mode
Use CSS to target parsed content where a background color is defined
inline without an accompanying text color.  Additionally, add an ADR
documenting this decision to the repo

Visual change in night mode only, as the text color will now be correct

Bug: T358797
Change-Id: If375c4c9691462d314e91a74da0fc8365137cd8c
2024-03-11 15:43:37 -07:00
Jon Robson 0ca85691dd Expand the list of classes where colors are disabled in night mode
Based on list on [[mw:Recommendations_for_mobile_friendly_articles_on_Wikimedia_wikis]]
and running color contrast checker on every project.

Bug: T358164
Change-Id: I1ecbc1bac060eae4b9d99f461284d15b5da3d576
2024-03-08 21:55:59 +00:00
Jon Robson 9614949134 Force color and background rules in night mode for infoboxes
In the current theme the background and color can be overriden by
style attributes, however in night mode this shouldn't happen

This helps the following projects:
- https://ext.m.wikipedia.org/wiki/Par%C3%ADs?minervanightmode=1
- https://kl.m.wikipedia.org/wiki/Paris?minervanightmode=1
- https://szl.m.wikipedia.org/wiki/Pary%C5%BC?minervanightmode=1

Bug: T357453
Change-Id: I4c45b1e62b60d9ae42a2948707134745a9b7f808
2024-03-08 09:16:43 -08:00
Jan Drewniak 65f1300b78 Add color: var( --color-base ); to .notheme class
Adds a rule that makes elements using the .notheme class
inherit black text unless specified otherwise.
This addresses situations where elements relying on
inheritance for color.

Bug: T358528
Change-Id: Ie59c31b5e25684ff5ecad507a273fbe71af4bca0
2024-03-07 16:02:02 -08:00
Jan Drewniak aef7b869b1 Rename --color-link--visited to --color-visited
During the Codex experimental build integration, some non-standard
variable color names were not replaced with standardized ones.

This patch replaced:

--color-link--active -> --color-progressive--active
--color-link--visited -> --color-visited

Bug: T356928
Change-Id: I48925009300565adbd7af815138d150219c7e88a
2024-03-05 20:05:46 -05:00
bwang 72be98a638 Set background/color to inherit for common templates in dark mode
Bug: T358164
Change-Id: I494275970728e2c6be5cebe422249ab4c4f88ba5
2024-03-05 19:34:29 +00:00
Jdlrobson 211171f227 Partial Revert "Set background/color to inherit for common templates"
This (partially)
reverts commit 9f541aafcc.

Reason for revert: Applying in light mode as well as night
mode where it was intending. The [bgcolor] rule is safe in both
modes so can stay.

Bug: T358164
Change-Id: I68c4d81209199d0257b7ba2590d19c258d9152e6
2024-03-04 20:02:27 -08:00
jenkins-bot 6dc80f7f05 Merge "Define message box, diff colors and missing box shadows for two themes" 2024-03-05 02:17:20 +00:00
Jon Robson aa0a596c7d Define message box, diff colors and missing box shadows for two themes
Bug: T358402
Change-Id: I171b6ad8bb36e52704224c5d28bc6081bc07ace5
2024-03-05 01:51:18 +00:00
jenkins-bot 7721ffad8a Merge "Don't strip colors from links" 2024-03-05 01:17:05 +00:00
jenkins-bot d6330ef6d2 Merge "Strip color from infoboxes in night mode" 2024-03-05 01:16:23 +00:00
Jon Robson 9e4a81528a Don't strip colors from links
- in main page
- in sideboxes - these only contain over div elements so
use div instead of * selector

Bug: T357722
Change-Id: If0e9eeb9471f3990afd5254b51af8dbe9cb538e0
2024-03-05 00:54:46 +00:00
Steph Toyofuku 04708df310 Strip color from infoboxes in night mode
Target a number of common infobox formats and strip the custom colors of
text and backgrounds, as well as borders.  This is explicitly a first
pass, so not overly broad but will hopefully encompass a large portion
of the infoboxes we're concerned with

Visual change in night mode only

Bug: T357453
Change-Id: If57f1b1ef6b86a9e45ca655e2317fc31330d207e
2024-03-04 15:50:49 -08:00
jenkins-bot 708dc44fb9 Merge "Integrate Codex experimental design token build" 2024-03-04 23:46:36 +00:00
Jon Robson db465050d5 Fixes last modified bar colors when visited link
The last modified bar "by" text is purple when the link is visited.
(https://phabricator.wikimedia.org/F42396630)

Change-Id: I9a3789fe68b5427e00f617f1d0e1436e59842661
2024-03-04 23:17:09 +00:00
Jan Drewniak 649cb10622 Integrate Codex experimental design token build
Use the Codex experimental design token build to
providing CSS custom property version of design tokens
for night mode.

The build also provides Less variables which are
references to the CSS custom properties. These are
pulled into the mediawiki.skin.variables.less file
and propagated across core and extensions.

Bug: T358059
Change-Id: I78558f6cc1de91d62fb9f8cbf571f73b51eae8ca
2024-03-04 23:04:57 +00:00
bwang 9366943f7e Make notheme exception to CSS hacks
Bug: T358164
Change-Id: Ie7fe3b32be4fb6aa308574da42ce9413ab97eb94
2024-03-04 18:34:42 +00:00
jenkins-bot e5c670f25b Merge "Move color-scheme property from :root to .skin-night-mode-clientpref-2" 2024-03-01 22:02:22 +00:00
jenkins-bot 351cfebce9 Merge "Invert all icons in UI that use background-image" 2024-03-01 21:42:28 +00:00
Jon Robson 89c99df5ef Invert all icons in UI that use background-image
Bug: T356822
Change-Id: I02e89837310009135d084ba31ab76fe2be5907af
2024-03-01 15:09:35 -06:00
Jan Drewniak 0efbd88259 Move color-scheme property from :root to .skin-night-mode-clientpref-2
The color-scheme property allows certain elements
to change their appearance based on the system
light/dark mode settings.

Therefore, this property should only be applied if "auto"
night mode is enabled.

Bug: T358814
Change-Id: Ic2b836d9696706ab2c628e78cc2592716963e9a5
2024-03-01 14:00:37 -05:00
bwang 9f541aafcc Set background/color to inherit for common templates
Bug: T358164
Change-Id: Idb1c4ee6ff28ae576a144a8f661d772f9312535b
2024-02-29 23:24:52 +00:00
Jon Robson f7124fdc6c Separate image inversion from widget inversion
For images only the filter is needed, not the entire
widget

Bug: T356822
Change-Id: Id0ace19d4071a987d132224612724259ed40aa1b
2024-02-27 11:29:06 -07:00
anterdc99 0e068128a6
Assign a default background color for tables using "wikitable" class
Bug: T358449
Change-Id: Ia43683fe51aaffb08d08e40f5fe670d663749daa
2024-02-26 03:17:04 +08:00
Jon Robson c94c90d93d Adds color-emphasize to palette
Needed by the language overlay

Bug: T356825
Change-Id: I1d9551f1b42dec5be715e889069279f97f64749e
2024-02-23 20:21:02 +00:00
bwang dd32e6731d Add icon background styles to codex CSS icons
Bug: T358160
Change-Id: I6b7ec3c4e3837a68da98bd9f58dbade5fb4fa1ed
2024-02-23 20:20:26 +00:00
Jon Robson 9cec6a2230 Skin invert shouldn't apply in day mode.
Bug: T356425
Change-Id: Ic5c754734f7df093629d1121d61e89cd1f3225fc
2024-02-23 18:28:47 +00:00
Jon Robson d32a682aad Allow things to be mark themselves as invert-able
When content is inverted via CSS filter, this sometimes inverts
CSS variables which have already been themselves inverted. Allowing
markup to explicitly mark itself as invertable would be helpful.

For now, usage is intended only for extensions integrating with
the skin. Since we're not sure this can be considered a stable
interface by editors we intentionally use the `skin-` prefix rather
than `mw-` interface given the note about confusion about what is
stable in [[mw:Stable_interface_policy/Frontend#Writing_code]]

Bug: T356425
Change-Id: I0cd0e36a6abe0bba9e98d1b319e636bef2952301
2024-02-21 15:49:26 -08:00
Jan Drewniak 7f1e394e9e Follow-up to a30b575271 Map color-based skin variables to CSS variables
Add an @import for Codex variables, i.e.
@import 'mediawiki.skin.codex-design-tokens/theme-wikimedia-ui.less';
that adds overrides to the variables from
'mediawiki.skin.defaults.less' to CSSCustomProperties.less.

Bug: T356427
Change-Id: I7c2c3a07899b4de735f7e7fd24e003ab69d449bb
2024-02-21 10:17:39 -05:00
Jon Robson a30b575271 Map color-based skin variables to CSS variables
Additional changes:
* Separate CSSCustomProperties.less from skin.less so that
we can obtain the unmodified original values for the colors

Depends-On: I363a97d33d85a9033da753f2a8fe730d80206639
Depends-On: I148eaca747352ffdc9d1423f20d34bd5a1d0e447
Bug: T356427
Change-Id: I916450c276cabb0c7c871525c50f95fb87f498ad
2024-02-21 00:36:13 +00:00